From f10629260e017fb539bcae0b83843448d3e69eb6 Mon Sep 17 00:00:00 2001 From: skarg Date: Thu, 11 Feb 2010 17:16:21 +0000 Subject: [PATCH] cleaned up compile errors. --- bacnet-stack/ports/win32/dlmstp.c | 2 +- bacnet-stack/ports/win32/main.c | 94 +------------------------------ bacnet-stack/src/dlmstp.c | 6 +- 3 files changed, 7 insertions(+), 95 deletions(-) diff --git a/bacnet-stack/ports/win32/dlmstp.c b/bacnet-stack/ports/win32/dlmstp.c index 30b427b2..ea80b656 100644 --- a/bacnet-stack/ports/win32/dlmstp.c +++ b/bacnet-stack/ports/win32/dlmstp.c @@ -58,7 +58,7 @@ static uint8_t RxBuffer[MAX_MPDU]; /* that a node must wait for a station to begin replying to a */ /* confirmed request: 255 milliseconds. (Implementations may use */ /* larger values for this timeout, not to exceed 300 milliseconds.) */ -static uint8_t Treply_timeout = 260; +static uint16_t Treply_timeout = 260; /* The minimum time without a DataAvailable or ReceiveError event that a */ /* node must wait for a remote node to begin using a token or replying to */ /* a Poll For Master frame: 20 milliseconds. (Implementations may use */ diff --git a/bacnet-stack/ports/win32/main.c b/bacnet-stack/ports/win32/main.c index bc6f9358..dbd85055 100644 --- a/bacnet-stack/ports/win32/main.c +++ b/bacnet-stack/ports/win32/main.c @@ -58,95 +58,6 @@ /* buffer used for receive */ static uint8_t Rx_Buf[MAX_MPDU] = { 0 }; -static void Init_Object( - BACNET_OBJECT_TYPE object_type, - rpm_property_lists_function rpm_list_function, - read_property_function rp_function, - object_valid_instance_function object_valid_function, - write_property_function wp_function, - object_count_function count_function, - object_index_to_instance_function index_function, - object_name_function name_function) -{ - handler_read_property_object_set(object_type, rp_function, - object_valid_function); - handler_write_property_object_set(object_type, wp_function); - handler_read_property_multiple_list_set(object_type, rpm_list_function); - Device_Object_Function_Set(object_type, count_function, index_function, - name_function); -} - -static void Init_Objects( - void) -{ - Device_Init(); - Init_Object(OBJECT_DEVICE, Device_Property_Lists, - Device_Encode_Property_APDU, Device_Valid_Object_Instance_Number, - Device_Write_Property, NULL, NULL, NULL); - - Analog_Input_Init(); - Init_Object(OBJECT_ANALOG_INPUT, Analog_Input_Property_Lists, - Analog_Input_Encode_Property_APDU, Analog_Input_Valid_Instance, NULL, - Analog_Input_Count, Analog_Input_Index_To_Instance, Analog_Input_Name); - - Analog_Output_Init(); - Init_Object(OBJECT_ANALOG_OUTPUT, Analog_Output_Property_Lists, - Analog_Output_Encode_Property_APDU, Analog_Output_Valid_Instance, - Analog_Output_Write_Property, Analog_Output_Count, - Analog_Output_Index_To_Instance, Analog_Output_Name); - - Analog_Value_Init(); - Init_Object(OBJECT_ANALOG_VALUE, Analog_Value_Property_Lists, - Analog_Value_Encode_Property_APDU, Analog_Value_Valid_Instance, - Analog_Value_Write_Property, Analog_Value_Count, - Analog_Value_Index_To_Instance, Analog_Value_Name); - - Binary_Input_Init(); - Init_Object(OBJECT_BINARY_INPUT, Binary_Input_Property_Lists, - Binary_Input_Encode_Property_APDU, Binary_Input_Valid_Instance, NULL, - Binary_Input_Count, Binary_Input_Index_To_Instance, Binary_Input_Name); - - Binary_Output_Init(); - Init_Object(OBJECT_BINARY_OUTPUT, Binary_Output_Property_Lists, - Binary_Output_Encode_Property_APDU, Binary_Output_Valid_Instance, - Binary_Output_Write_Property, Binary_Output_Count, - Binary_Output_Index_To_Instance, Binary_Output_Name); - - Binary_Value_Init(); - Init_Object(OBJECT_BINARY_VALUE, Binary_Value_Property_Lists, - Binary_Value_Encode_Property_APDU, Binary_Value_Valid_Instance, - Binary_Value_Write_Property, Binary_Value_Count, - Binary_Value_Index_To_Instance, Binary_Value_Name); - - Life_Safety_Point_Init(); - Init_Object(OBJECT_LIFE_SAFETY_POINT, Life_Safety_Point_Property_Lists, - Life_Safety_Point_Encode_Property_APDU, - Life_Safety_Point_Valid_Instance, Life_Safety_Point_Write_Property, - Life_Safety_Point_Count, Life_Safety_Point_Index_To_Instance, - Life_Safety_Point_Name); - - Load_Control_Init(); - Init_Object(OBJECT_LOAD_CONTROL, Load_Control_Property_Lists, - Load_Control_Encode_Property_APDU, Load_Control_Valid_Instance, - Load_Control_Write_Property, Load_Control_Count, - Load_Control_Index_To_Instance, Load_Control_Name); - - Multistate_Output_Init(); - Init_Object(OBJECT_MULTI_STATE_OUTPUT, Multistate_Output_Property_Lists, - Multistate_Output_Encode_Property_APDU, - Multistate_Output_Valid_Instance, Multistate_Output_Write_Property, - Multistate_Output_Count, Multistate_Output_Index_To_Instance, - Multistate_Output_Name); - -#if defined(BACFILE) - bacfile_init(); - Init_Object(OBJECT_FILE, BACfile_Property_Lists, - bacfile_encode_property_apdu, bacfile_valid_instance, - bacfile_write_property, bacfile_count, bacfile_index_to_instance, - bacfile_name); -#endif -} - /* send a whois to see who is on the network */ static bool Who_Is_Request = true; bool I_Am_Request = true; @@ -255,9 +166,6 @@ static void LocalIAmHandler( static void Init_Service_Handlers( void) { - Device_Init(); - handler_read_property_object_set(OBJECT_DEVICE, - Device_Encode_Property_APDU, Device_Valid_Object_Instance_Number); /* 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_I_AM, LocalIAmHandler); @@ -327,7 +235,7 @@ int main( (void) argc; (void) argv; Device_Set_Object_Instance_Number(4194300); - Init_Objects(); + Device_Init(); address_init(); Init_Service_Handlers(); dlenv_init(); diff --git a/bacnet-stack/src/dlmstp.c b/bacnet-stack/src/dlmstp.c index 74ac3634..4ebf642c 100644 --- a/bacnet-stack/src/dlmstp.c +++ b/bacnet-stack/src/dlmstp.c @@ -43,7 +43,11 @@ /* Number of MS/TP Packets Rx/Tx */ uint16_t MSTP_Packets = 0; - +/* The minimum time without a DataAvailable or ReceiveError event */ +/* that a node must wait for a station to begin replying to a */ +/* confirmed request: 255 milliseconds. (Implementations may use */ +/* larger values for this timeout, not to exceed 300 milliseconds.) */ +static uint16_t Treply_timeout = 260; /* packet queues */ static DLMSTP_PACKET Receive_Packet; static HANDLE Receive_Packet_Flag;