Edouard@2020: /************************************************************************** Edouard@2020: * Edouard@2020: * Copyright (C) 2006 Steve Karg Edouard@2020: * Copyright (C) 2017 Mario de Sousa Edouard@2020: * Edouard@2020: * Permission is hereby granted, free of charge, to any person obtaining Edouard@2020: * a copy of this software and associated documentation files (the Edouard@2020: * "Software"), to deal in the Software without restriction, including Edouard@2020: * without limitation the rights to use, copy, modify, merge, publish, Edouard@2020: * distribute, sublicense, and/or sell copies of the Software, and to Edouard@2020: * permit persons to whom the Software is furnished to do so, subject to Edouard@2020: * the following conditions: Edouard@2020: * Edouard@2020: * The above copyright notice and this permission notice shall be included Edouard@2020: * in all copies or substantial portions of the Software. Edouard@2020: * Edouard@2020: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, Edouard@2020: * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF Edouard@2020: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. Edouard@2020: * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY Edouard@2020: * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, Edouard@2020: * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE Edouard@2020: * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Edouard@2020: * Edouard@2020: *********************************************************************/ Edouard@2020: Edouard@2020: #ifndef SERVER_H_ Edouard@2020: #define SERVER_H_ Edouard@2020: Edouard@2020: Edouard@2020: #include Edouard@2020: #include Edouard@2020: Edouard@2020: Edouard@2020: msousa@2649: Edouard@2020: typedef struct{ msousa@2649: char location [%(BACnet_Param_String_Size)d]; msousa@2649: char network_interface [%(BACnet_Param_String_Size)d]; msousa@2649: char port_number [%(BACnet_Param_String_Size)d]; msousa@2649: char device_name [%(BACnet_Param_String_Size)d]; msousa@2649: char device_location [%(BACnet_Param_String_Size)d]; msousa@2649: char device_description [%(BACnet_Param_String_Size)d]; msousa@2649: char device_appsoftware_ver[%(BACnet_Param_String_Size)d]; msousa@2649: char comm_control_passwd [%(BACnet_Param_String_Size)d]; msousa@2649: // int override_local_config; // bool flag => msousa@2649: // // true : use these parameter values msousa@2649: // // false: use values stored on local file in PLC Edouard@2020: uint32_t device_id; // device ID is 22 bits long! uint16_t is not enough! Edouard@2020: int init_state; // store how far along the server's initialization has progressed Edouard@2020: pthread_t thread_id; // thread handling this server Edouard@2020: } server_node_t; Edouard@2020: Edouard@2020: Edouard@2020: Edouard@2020: /*initialization following all parameters given by user in application*/ Edouard@2020: static server_node_t server_node = { Edouard@2020: "%(locstr)s", msousa@2649: "%(network_interface)s", // interface (NULL => use default (eth0)) msousa@2649: "%(port_number)s", // Port number (NULL => use default) msousa@2649: "%(BACnet_Device_Name)s", // BACnet server's device (object) Name msousa@2649: "%(BACnet_Device_Location)s", // BACnet server's device (object) Location msousa@2649: "%(BACnet_Device_Description)s", // BACnet server's device (object) Description msousa@2649: "%(BACnet_Device_AppSoft_Version)s", // BACnet server's device (object) App. Software Ver. msousa@2649: "%(BACnet_Comm_Control_Password)s", // BACnet server's device (object) Password msousa@2649: // (Override_Parameters_Saved_on_PLC)d, // override locally saved parameters (bool flag) msousa@2649: %(BACnet_Device_ID)s // BACnet server's device (object) ID Edouard@2020: }; Edouard@2020: Edouard@2020: Edouard@2020: #endif /* SERVER_H_ */