Sync service handler initialization in bacnet_basic_init() with apps/server when backup and restore, time master, and COV subscription features are enabled.
This commit is contained in:
+2
-3
@@ -188,13 +188,12 @@ static void Init_Service_Handlers(void)
|
|||||||
bacfile_pathname(object_data.object_instance), bacfile_count());
|
bacfile_pathname(object_data.object_instance), bacfile_count());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* set up our confirmed service unrecognized service handler - required! */
|
||||||
|
apdu_set_unrecognized_service_handler_handler(handler_unrecognized_service);
|
||||||
/* we need to handle who-is to support dynamic device binding */
|
/* we need to handle who-is to support dynamic device binding */
|
||||||
apdu_set_unconfirmed_handler(
|
apdu_set_unconfirmed_handler(
|
||||||
SERVICE_UNCONFIRMED_WHO_IS, handler_who_is_who_am_i_unicast);
|
SERVICE_UNCONFIRMED_WHO_IS, handler_who_is_who_am_i_unicast);
|
||||||
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_HAS, handler_who_has);
|
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_HAS, handler_who_has);
|
||||||
/* set the handler for all the services we don't implement */
|
|
||||||
/* It is required to send the proper reject message... */
|
|
||||||
apdu_set_unrecognized_service_handler_handler(handler_unrecognized_service);
|
|
||||||
/* Set the handlers for any confirmed services that we support. */
|
/* Set the handlers for any confirmed services that we support. */
|
||||||
/* We must implement read property - it's required! */
|
/* We must implement read property - it's required! */
|
||||||
apdu_set_confirmed_handler(
|
apdu_set_confirmed_handler(
|
||||||
|
|||||||
@@ -190,7 +190,8 @@ void bacnet_basic_init(void)
|
|||||||
/* set up our confirmed service unrecognized service handler - required! */
|
/* set up our confirmed service unrecognized service handler - required! */
|
||||||
apdu_set_unrecognized_service_handler_handler(handler_unrecognized_service);
|
apdu_set_unrecognized_service_handler_handler(handler_unrecognized_service);
|
||||||
/* we need to handle who-is to support dynamic device binding */
|
/* we need to handle who-is to support dynamic device binding */
|
||||||
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_IS, handler_who_is);
|
apdu_set_unconfirmed_handler(
|
||||||
|
SERVICE_UNCONFIRMED_WHO_IS, handler_who_is_who_am_i_unicast);
|
||||||
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_HAS, handler_who_has);
|
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_HAS, handler_who_has);
|
||||||
/* Set the handlers for any confirmed services that we support. */
|
/* Set the handlers for any confirmed services that we support. */
|
||||||
/* We must implement read property - it's required! */
|
/* We must implement read property - it's required! */
|
||||||
@@ -202,15 +203,37 @@ void bacnet_basic_init(void)
|
|||||||
SERVICE_CONFIRMED_WRITE_PROPERTY, handler_write_property);
|
SERVICE_CONFIRMED_WRITE_PROPERTY, handler_write_property);
|
||||||
apdu_set_confirmed_handler(
|
apdu_set_confirmed_handler(
|
||||||
SERVICE_CONFIRMED_WRITE_PROP_MULTIPLE, handler_write_property_multiple);
|
SERVICE_CONFIRMED_WRITE_PROP_MULTIPLE, handler_write_property_multiple);
|
||||||
|
#if defined BACNET_BACKUP_RESTORE
|
||||||
apdu_set_confirmed_handler(
|
apdu_set_confirmed_handler(
|
||||||
SERVICE_CONFIRMED_SUBSCRIBE_COV, handler_cov_subscribe);
|
SERVICE_CONFIRMED_ATOMIC_READ_FILE, handler_atomic_read_file);
|
||||||
/* handle communication so we can shutup when asked, or restart */
|
|
||||||
apdu_set_confirmed_handler(
|
apdu_set_confirmed_handler(
|
||||||
SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL,
|
SERVICE_CONFIRMED_ATOMIC_WRITE_FILE, handler_atomic_write_file);
|
||||||
handler_device_communication_control);
|
#endif
|
||||||
apdu_set_confirmed_handler(
|
apdu_set_confirmed_handler(
|
||||||
SERVICE_CONFIRMED_REINITIALIZE_DEVICE, handler_reinitialize_device);
|
SERVICE_CONFIRMED_REINITIALIZE_DEVICE, handler_reinitialize_device);
|
||||||
/* start the 1 second timer for non-critical cyclic tasks */
|
/* start the 1 second timer for non-critical cyclic tasks */
|
||||||
|
#if defined(BACNET_TIME_MASTER)
|
||||||
|
apdu_set_unconfirmed_handler(
|
||||||
|
SERVICE_UNCONFIRMED_UTC_TIME_SYNCHRONIZATION, handler_timesync_utc);
|
||||||
|
apdu_set_unconfirmed_handler(
|
||||||
|
SERVICE_UNCONFIRMED_TIME_SYNCHRONIZATION, handler_timesync);
|
||||||
|
#endif
|
||||||
|
apdu_set_unconfirmed_handler(
|
||||||
|
SERVICE_UNCONFIRMED_YOU_ARE, handler_you_are_device_id_set);
|
||||||
|
#if (BACNET_COV_SUBSCRIPTIONS_SIZE > 0)
|
||||||
|
apdu_set_confirmed_handler(
|
||||||
|
SERVICE_CONFIRMED_SUBSCRIBE_COV, handler_cov_subscribe);
|
||||||
|
#endif
|
||||||
|
apdu_set_confirmed_handler(
|
||||||
|
SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL,
|
||||||
|
handler_device_communication_control);
|
||||||
|
#if defined(BACNET_TIME_MASTER)
|
||||||
|
handler_timesync_init();
|
||||||
|
#endif
|
||||||
|
apdu_set_confirmed_handler(
|
||||||
|
SERVICE_CONFIRMED_CREATE_OBJECT, handler_create_object);
|
||||||
|
apdu_set_confirmed_handler(
|
||||||
|
SERVICE_CONFIRMED_DELETE_OBJECT, handler_delete_object);
|
||||||
mstimer_set(&BACnet_Task_Timer, 1000L);
|
mstimer_set(&BACnet_Task_Timer, 1000L);
|
||||||
/* start the timer for more time sensitive object specific cyclic tasks */
|
/* start the timer for more time sensitive object specific cyclic tasks */
|
||||||
if (mstimer_interval(&BACnet_Object_Timer) == 0) {
|
if (mstimer_interval(&BACnet_Object_Timer) == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user