BACnetGetEventInfo
(FUN)
FUNCTION BACnetGetEventInfo : IEC_BACNET_STATUS
Sends a GetEventInformation request.
Sends a request to obtain a summary of “event-active” objects within the given device that generates event notifications. The “event-active” objects are objects that have any value other than IEC_BACNET_EVENT_STATE.STATE_NORMAL for the Event_State property, or have an acked- transitions property that has at least one of the bits (IEC_BACNET_EVENT_TRANSITION_BITS.EVENT_TRANSITION_TO_OFFNORMAL, IEC_BACNET_EVENT_TRANSITION_BITS.EVENT_TRANSITION_TO_FAULT, IEC_BACNET_EVENT_TRANSITION_BITS.EVENT_TRANSITION_TO_NORMAL) set to FALSE. This routine allows to control APDU properties like APDU length, segmentation, and timeout for both requests and responses. This routine can execute asynchronously, i.e. this routine will return to the caller before the BACnet reply comes so that the application can keep running. In this case the response information will be received by the thread which is responsible for receiving asynchronous responses. An optional BACNET_EVENT_INFO_COMPLETE_CB routine, which is provided by the BACnet application, shall be used to process this information. If a number of asynchronous service requests are sent, the responses shall be queued and identified by the transaction handles. If the application does not supply the BACNET_EVENT_INFO_COMPLETE_CB routine, then this routine sends out a request and waits for a response.
Asynchron call, which fills pResult with the call result in an asynchronus manner. As soon as pInfoBufferStatus is IEC_BACNET_STATUS.BACNET_STATUS_OK the data in pResult is valid.
- InOut:
Scope
Name
Type
Comment
Return
BACnetGetEventInfo
A status indicating if the operation worked.
Input
pSourceAddress
POINTER TO IEC_BACNET_ADDRESS
If the BACnet application has only one device constructed and installed, this can be 0. In this case the MAC address of this device will be used. Otherwise this shall be the MAC address returned on device object construction.
pDestinationAddress
POINTER TO IEC_BACNET_ADDRESS
This is the MAC address of the device to which the request should be sent.
pServiceInfo
POINTER TO IEC_BACNET_EVENT_INFO_INFO
A pointer to a memory block that holds a data structure of datatype IEC_BACNET_EVENT_INFO_INFO. This data structure may contain optional ObjectID parameter to specify the last Object Identifier received in a preceding Get Event Info ACK if it’s moreEvents field was TRUE. If ObjectID parameter is omitted, the returned summary shall start with the first event-active object.
pAPDUParams
POINTER TO IEC_BACNET_APDU_PROPERTIES
A pointer to the APDU-Properties structure which sets APDU properties for this transaction only. This does not change global defaults or settings for the application APDU Properties. This argument may be 0. In this case APDU properties are used which were specified in the device object properties of the applications device which sends the request.
pInfoBuffer
POINTER TO IEC_BACNET_EVENT_INFO
A pointer to a memory block of datatype BACNET_EVENT_INFO to place the response information. It contains a list of Event Summary items. Each item of datatype IEC_BACNET_EVENT_SUMMARY consists of a number of parameters that describe the appropriate object. ObjectID, Event-State, Acked-Transitions, Notify-Type, and Event-Enable parameters convey values of the corresponding properties of the object. Event-Stamps parameter conveys the timestamps of the last event notifications for TO-OFFNORMAL, TO-FAULT, and TONORMAL events. Event-Priorities parameter conveys the priorities specified in the Priority property of the associated notification class object. Event Info data structure contains actual number of the items returned, and the total length of Event-Summary list buffer expressed as a number of items this buffer can hold. The last parameter of IEC_BACNET_EVENT_INFO data structure is the More Events flag which indicates whether (TRUE) or not (FALSE) more objects exist that should be listed, but that cannot be conveyed by the reply because APDU is too short. The application may initialize the pSummaries member of the IEC_BACNET_EVENT_INFO struture with a 0 pointer and bufferCount and summaryCount with 0 too. In this case the memory for the response is allocated by the API and the application is responsible to release it with a call to BACnetFreeStackAllocatedMemory if the buffer is no longer needed.
pTransactionToken
POINTER TO BACnetAsyncTransactionToken
Transaction token of the asynchronous call - see BACnetAsyncTransactionToken.
pError
POINTER TO IEC_BACNET_ERROR
A pointer to a structure to hold BACnet Error information. pError may be 0 if the application isn’t interested in detailed error information.