get event information demo

This commit is contained in:
bow2
2015-03-23 12:28:46 +00:00
parent 672f499f54
commit 086840a763
8 changed files with 474 additions and 4 deletions
+26 -1
View File
@@ -43,6 +43,31 @@
static get_event_info_function Get_Event_Info[MAX_BACNET_OBJECT_TYPE];
/** print eventState
*/
void ge_ack_print_data(
BACNET_GET_EVENT_INFORMATION_DATA * data,
uint32_t device_id)
{
BACNET_GET_EVENT_INFORMATION_DATA *act_data = data;
const char* state_strs[] = {"NO", "FA", "ON", "HL", "LL"};
printf("DeviceID\tType\tInstance\teventState\n");
printf("--------------- ------- --------------- ---------------\n");
int count = 0;
while (act_data) {
printf("%u\t\t%u\t%u\t\t%s\n",
device_id,
act_data->objectIdentifier.type,
act_data->objectIdentifier.instance,
state_strs[data->eventState]
);
act_data = act_data->next;
count++;
}
printf("\n%u\t Total\n",count);
}
void handler_get_event_information_set(
BACNET_OBJECT_TYPE object_type,
get_event_info_function pFunction)
@@ -172,7 +197,7 @@ void handler_get_event_information(
goto GET_EVENT_ERROR;
}
#if PRINT_ENABLED
fprintf(stderr, "GetEventInformation: Sending Ack!\n");
fprintf(stderr, "Got a GetEventInformation request: Sending Ack!\n");
#endif
GET_EVENT_ERROR:
if (error) {