Indented using indent script.
This commit is contained in:
@@ -95,8 +95,8 @@ extern "C" {
|
||||
unsigned apdu_len);
|
||||
|
||||
int rr_address_list_encode(
|
||||
uint8_t *apdu,
|
||||
BACNET_READ_RANGE_DATA *pRequest);
|
||||
uint8_t * apdu,
|
||||
BACNET_READ_RANGE_DATA * pRequest);
|
||||
|
||||
void address_set_device_TTL(
|
||||
uint32_t device_id,
|
||||
|
||||
@@ -69,7 +69,7 @@ extern "C" {
|
||||
uint32_t instance);
|
||||
|
||||
int Analog_Input_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
bool Analog_Input_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
@@ -78,7 +78,7 @@ extern "C" {
|
||||
void Analog_Input_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
float value);
|
||||
|
||||
|
||||
void Analog_Input_Init(
|
||||
void);
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ extern "C" {
|
||||
void);
|
||||
|
||||
int Analog_Output_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
bool Analog_Output_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
|
||||
@@ -163,8 +163,8 @@ extern "C" {
|
||||
*/
|
||||
bool apdu_service_supported_to_index(
|
||||
BACNET_SERVICES_SUPPORTED service_supported,
|
||||
size_t *index,
|
||||
bool *bIsConfirmed );
|
||||
size_t * index,
|
||||
bool * bIsConfirmed);
|
||||
|
||||
|
||||
void apdu_set_error_handler(
|
||||
|
||||
@@ -49,7 +49,7 @@ extern "C" {
|
||||
uint32_t object_instance);
|
||||
|
||||
int Analog_Value_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
|
||||
bool Analog_Value_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
@@ -48,7 +48,7 @@ typedef struct {
|
||||
* to an object inside this Device.
|
||||
*/
|
||||
typedef struct {
|
||||
BACNET_OBJECT_ID deviceIndentifier; /**< Optional, for external device. */
|
||||
BACNET_OBJECT_ID deviceIndentifier; /**< Optional, for external device. */
|
||||
BACNET_OBJECT_ID objectIdentifier;
|
||||
} BACNET_DEVICE_OBJECT_REFERENCE;
|
||||
|
||||
|
||||
@@ -636,10 +636,10 @@ typedef enum {
|
||||
UNITS_SQUARE_METERS_PER_NEWTON = 185,
|
||||
UNITS_WATTS_PER_METER_PER_DEGREE_KELVIN = 189,
|
||||
UNITS_WATTS_PER_SQUARE_METER_DEGREE_KELVIN = 141,
|
||||
/* Enumerated values 0-255 are reserved for definition by ASHRAE. */
|
||||
/* Enumerated values 256-65535 may be used by others subject to */
|
||||
/* the procedures and constraints described in Clause 23. */
|
||||
/* The last enumeration used in this version is 189. */
|
||||
/* Enumerated values 0-255 are reserved for definition by ASHRAE. */
|
||||
/* Enumerated values 256-65535 may be used by others subject to */
|
||||
/* the procedures and constraints described in Clause 23. */
|
||||
/* The last enumeration used in this version is 189. */
|
||||
MAX_UNITS = 190
|
||||
} BACNET_ENGINEERING_UNITS;
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ extern "C" {
|
||||
|
||||
/* handling for read property service */
|
||||
int bacfile_read_property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
|
||||
/* handling for write property service */
|
||||
bool bacfile_write_property(
|
||||
|
||||
@@ -84,7 +84,7 @@ extern "C" {
|
||||
BACNET_PROPERTY_VALUE * value_list);
|
||||
|
||||
int Binary_Input_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
|
||||
bool Binary_Input_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
@@ -122,7 +122,6 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @defgroup DLBIP BACnet/IP DataLink Network Layer
|
||||
* @ingroup DataLink
|
||||
* Implementation of the Network Layer using BACnet/IP as the transport, as
|
||||
@@ -131,5 +130,4 @@ extern "C" {
|
||||
* DataLink level by serving as the implementation of the function templates.
|
||||
*
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -79,7 +79,7 @@ extern "C" {
|
||||
char *new_name);
|
||||
|
||||
int Binary_Output_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
|
||||
bool Binary_Output_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
@@ -53,7 +53,7 @@ extern "C" {
|
||||
void);
|
||||
|
||||
int Binary_Value_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
|
||||
bool Binary_Value_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
@@ -126,7 +126,6 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @defgroup DSCOV Data Sharing - Change of Value Service (DS-COV)
|
||||
* @ingroup DataShare
|
||||
* 13.1 Change of Value Reporting <br>
|
||||
@@ -140,5 +139,4 @@ extern "C" {
|
||||
* devices or to operators or logging devices. Any object, proprietary or
|
||||
* standard, may support COV reporting at the implementor's option.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
#define datalink_get_broadcast_address bip_get_broadcast_address
|
||||
#define datalink_get_my_address bip_get_my_address
|
||||
|
||||
#else /* Ie, BACDL_ALL */
|
||||
#else /* Ie, BACDL_ALL */
|
||||
#include "npdu.h"
|
||||
|
||||
#define MAX_HEADER (8)
|
||||
@@ -118,7 +118,6 @@ extern "C" {
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
/** @defgroup DataLink The BACnet Network (DataLink) Layer
|
||||
* <b>6 THE NETWORK LAYER </b><br>
|
||||
* The purpose of the BACnet network layer is to provide the means by which
|
||||
@@ -140,13 +139,10 @@ extern "C" {
|
||||
* chosen at runtime from among these choices.
|
||||
* - Clause 10 POINT-TO-POINT (PTP) and Clause 11 EIA/CEA-709.1 ("LonTalk") LAN
|
||||
* are not currently supported by this project.
|
||||
*/
|
||||
|
||||
/** @defgroup DLTemplates DataLink Template Functions
|
||||
*//** @defgroup DLTemplates DataLink Template Functions
|
||||
* @ingroup DataLink
|
||||
* Most of the functions in this group are function templates which are assigned
|
||||
* to a specific DataLink network layer implementation either at compile time or
|
||||
* at runtime.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -97,14 +97,11 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @defgroup RDMS Remote Device Management Services BIBBs
|
||||
* These device management BIBBs prescribe the BACnet capabilities required
|
||||
* to interoperably perform the device management functions enumerated in
|
||||
* 22.2.1.5 for the BACnet devices defined therein.
|
||||
*/
|
||||
|
||||
/** @defgroup DMDCC Device Management-Device Communication Control (DM-DCC)
|
||||
*//** @defgroup DMDCC Device Management-Device Communication Control (DM-DCC)
|
||||
* @ingroup RDMS
|
||||
* 16.1 DeviceCommunicationControl Service <br>
|
||||
* The DeviceCommunicationControl service is used by a client BACnet-user to
|
||||
@@ -118,5 +115,4 @@ extern "C" {
|
||||
* DeviceCommunicationControl or, if supported, ReinitializeDevice service,
|
||||
* not by time.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -106,7 +106,7 @@ typedef bool(
|
||||
* == 1) to indicate no more objects found.
|
||||
*/
|
||||
typedef unsigned (
|
||||
*object_iterate_function)(
|
||||
*object_iterate_function) (
|
||||
unsigned current_index);
|
||||
|
||||
|
||||
@@ -116,11 +116,12 @@ extern "C" {
|
||||
|
||||
void Device_Init(
|
||||
void);
|
||||
|
||||
|
||||
bool Device_Reinitialize(
|
||||
BACNET_REINITIALIZE_DEVICE_DATA *rd_data);
|
||||
|
||||
BACNET_REINITIALIZED_STATE Device_Reinitialized_State(void);
|
||||
BACNET_REINITIALIZE_DEVICE_DATA * rd_data);
|
||||
|
||||
BACNET_REINITIALIZED_STATE Device_Reinitialized_State(
|
||||
void);
|
||||
|
||||
rr_info_function Device_Objects_RR_Info(
|
||||
BACNET_OBJECT_TYPE object_type);
|
||||
@@ -146,7 +147,8 @@ extern "C" {
|
||||
int *object_type,
|
||||
uint32_t * instance);
|
||||
|
||||
unsigned Device_Count(void);
|
||||
unsigned Device_Count(
|
||||
void);
|
||||
uint32_t Device_Index_To_Instance(
|
||||
unsigned index);
|
||||
char *Device_Name(
|
||||
@@ -221,19 +223,18 @@ extern "C" {
|
||||
uint32_t object_instance);
|
||||
|
||||
int Device_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
bool Device_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
|
||||
bool DeviceGetRRInfo(
|
||||
BACNET_READ_RANGE_DATA *pRequest, /* Info on the request */
|
||||
RR_PROP_INFO *pInfo); /* Where to put the information */
|
||||
BACNET_READ_RANGE_DATA * pRequest, /* Info on the request */
|
||||
RR_PROP_INFO * pInfo); /* Where to put the information */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @defgroup ObjFrmwk Object Framework
|
||||
* The modules in this section describe the BACnet-stack's framework for
|
||||
* BACnet-defined Objects (Device, Analog Input, etc). There are two submodules
|
||||
@@ -243,15 +244,11 @@ extern "C" {
|
||||
* - The interface between the implemented Objects and the BAC-stack services,
|
||||
* specifically the handlers, which are mediated through function calls to
|
||||
* the Device object.
|
||||
*/
|
||||
|
||||
/** @defgroup ObjHelpers Object Helper Functions
|
||||
*//** @defgroup ObjHelpers Object Helper Functions
|
||||
* @ingroup ObjFrmwk
|
||||
* This section describes the function templates for the helper functions that
|
||||
* provide common object support.
|
||||
*/
|
||||
|
||||
/** @defgroup ObjIntf Handler-to-Object Interface Functions
|
||||
*//** @defgroup ObjIntf Handler-to-Object Interface Functions
|
||||
* @ingroup ObjFrmwk
|
||||
* This section describes the fairly limited set of functions that link the
|
||||
* BAC-stack handlers to the BACnet Object instances. All of these calls are
|
||||
@@ -266,6 +263,4 @@ extern "C" {
|
||||
* eg Object_Read_Property() for the RP handler.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -209,14 +209,11 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @defgroup ALMEVNT Alarm and Event Management BIBBs
|
||||
* These BIBBs prescribe the BACnet capabilities required to interoperably
|
||||
* perform the alarm and event management functions enumerated in 22.2.1.2
|
||||
* for the BACnet devices defined therein.
|
||||
*/
|
||||
|
||||
/** @defgroup EVNOTFCN Alarm and Event-Notification (AE-N)
|
||||
*//** @defgroup EVNOTFCN Alarm and Event-Notification (AE-N)
|
||||
* @ingroup ALMEVNT
|
||||
* 13.6 ConfirmedCOVNotification Service <br>
|
||||
* The ConfirmedCOVNotification service is used to notify subscribers about
|
||||
@@ -233,9 +230,7 @@ extern "C" {
|
||||
* For unsubscribed notifications, the algorithm for determining when to issue
|
||||
* this service is a local matter and may be based on a change of value,
|
||||
* periodic updating, or some other criteria.
|
||||
*/
|
||||
|
||||
/** @defgroup ALMACK Alarm and Event-ACK (AE-ACK)
|
||||
*//** @defgroup ALMACK Alarm and Event-ACK (AE-ACK)
|
||||
* @ingroup ALMEVNT
|
||||
* 13.5 AcknowledgeAlarm Service <br>
|
||||
* In some systems a device may need to know that an operator has seen the alarm
|
||||
@@ -246,5 +241,4 @@ extern "C" {
|
||||
* This service may be used in conjunction with either the
|
||||
* ConfirmedEventNotification service or the UnconfirmedEventNotification service.
|
||||
*/
|
||||
|
||||
#endif /* BACNET_EVENT_H_ */
|
||||
|
||||
@@ -59,10 +59,10 @@ extern "C" {
|
||||
|
||||
unsigned FIFO_Count(
|
||||
FIFO_BUFFER const *b);
|
||||
|
||||
|
||||
bool FIFO_Full(
|
||||
FIFO_BUFFER const *b);
|
||||
|
||||
|
||||
bool FIFO_Empty(
|
||||
FIFO_BUFFER const *b);
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ extern "C" {
|
||||
uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS * src);
|
||||
|
||||
|
||||
void handler_who_has(
|
||||
uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
@@ -84,7 +84,7 @@ extern "C" {
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS * src,
|
||||
BACNET_CONFIRMED_SERVICE_DATA * service_data);
|
||||
|
||||
|
||||
void handler_read_property_ack(
|
||||
uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
@@ -98,14 +98,14 @@ extern "C" {
|
||||
BACNET_CONFIRMED_SERVICE_DATA * service_data);
|
||||
|
||||
bool WPValidateString(
|
||||
BACNET_APPLICATION_DATA_VALUE *pValue,
|
||||
BACNET_APPLICATION_DATA_VALUE * pValue,
|
||||
int iMaxLen,
|
||||
bool bEmptyAllowed,
|
||||
BACNET_ERROR_CLASS * pErrorClass,
|
||||
BACNET_ERROR_CODE * pErrorCode);
|
||||
|
||||
bool WPValidateArgType(
|
||||
BACNET_APPLICATION_DATA_VALUE *pValue,
|
||||
BACNET_APPLICATION_DATA_VALUE * pValue,
|
||||
uint8_t ucExpectedType,
|
||||
BACNET_ERROR_CLASS * pErrorClass,
|
||||
BACNET_ERROR_CODE * pErrorCode);
|
||||
@@ -256,10 +256,7 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @defgroup MISCHNDLR Miscellaneous Handler Utilities
|
||||
* Various utilities and functions to support the Handlers.
|
||||
*/
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -56,7 +56,7 @@ extern "C" {
|
||||
void);
|
||||
|
||||
int Load_Control_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
|
||||
bool Load_Control_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
@@ -58,7 +58,7 @@ extern "C" {
|
||||
|
||||
/* ReadProperty service support */
|
||||
int Lighting_Output_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
/* WriteProperty service support */
|
||||
bool Lighting_Output_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
@@ -52,7 +52,7 @@ extern "C" {
|
||||
void);
|
||||
|
||||
int Life_Safety_Point_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
|
||||
bool Life_Safety_Point_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
@@ -51,7 +51,7 @@ extern "C" {
|
||||
uint32_t instance);
|
||||
|
||||
int Multistate_Input_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
|
||||
bool Multistate_Input_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
@@ -53,7 +53,7 @@ extern "C" {
|
||||
void);
|
||||
|
||||
int Multistate_Output_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
|
||||
bool Multistate_Output_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
|
||||
@@ -44,9 +44,9 @@ typedef struct BACnet_Reinitialize_Device_Data {
|
||||
BACNET_ERROR_CODE error_code;
|
||||
} BACNET_REINITIALIZE_DEVICE_DATA;
|
||||
|
||||
typedef bool (
|
||||
typedef bool(
|
||||
*reinitialize_device_function) (
|
||||
BACNET_REINITIALIZE_DEVICE_DATA *rd_data);
|
||||
BACNET_REINITIALIZE_DEVICE_DATA * rd_data);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -83,7 +83,6 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @defgroup DMRD Device Management-ReinitializeDevice (DM-RD)
|
||||
* @ingroup RDMS
|
||||
* 16.4 ReinitializeDevice Service <br>
|
||||
@@ -98,5 +97,4 @@ extern "C" {
|
||||
* to executing the service.
|
||||
*
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -103,26 +103,27 @@ typedef enum {
|
||||
|
||||
#define RR_OVERHEAD 16
|
||||
#define RR_1ST_SEQ_OVERHEAD 5
|
||||
#define RR_INDEX_OVERHEAD 3 /* or 5 if paranoid */
|
||||
|
||||
#define RR_INDEX_OVERHEAD 3 /* or 5 if paranoid */
|
||||
|
||||
/** Define pointer to function type for handling ReadRange request.
|
||||
This function will take the following parameters:
|
||||
- 1. A pointer to a buffer of at least MAX_APDU bytes to build the response in.
|
||||
- 2. A pointer to a BACNET_READ_RANGE_DATA structure with all the request
|
||||
information in it. The function is responsible for applying the request
|
||||
to the property in question and returning the response. */
|
||||
|
||||
typedef int (*rr_handler_function) (
|
||||
uint8_t *apdu,
|
||||
BACNET_READ_RANGE_DATA *pRequest);
|
||||
|
||||
typedef int (
|
||||
*rr_handler_function) (
|
||||
uint8_t * apdu,
|
||||
BACNET_READ_RANGE_DATA * pRequest);
|
||||
|
||||
/** Structure to return the type of requests a given object property can
|
||||
* accept and the address of the function to handle the request */
|
||||
|
||||
|
||||
typedef struct rrpropertyinfo {
|
||||
int RequestTypes;
|
||||
rr_handler_function Handler;
|
||||
} RR_PROP_INFO;
|
||||
} RR_PROP_INFO;
|
||||
|
||||
/** Function template for ReadRange information retrieval function.
|
||||
* A function template; @see device.c for assignment to object types.
|
||||
@@ -131,9 +132,10 @@ typedef struct rrpropertyinfo {
|
||||
* @param pInfo [out] Where to write the response to.
|
||||
* @return True on success, False on error or failure.
|
||||
*/
|
||||
typedef bool (*rr_info_function) (
|
||||
BACNET_READ_RANGE_DATA *pRequest, /* Info on the request */
|
||||
RR_PROP_INFO *pInfo); /* Where to write the response to */
|
||||
typedef bool(
|
||||
*rr_info_function) (
|
||||
BACNET_READ_RANGE_DATA * pRequest, /* Info on the request */
|
||||
RR_PROP_INFO * pInfo); /* Where to write the response to */
|
||||
|
||||
int rr_encode_apdu(
|
||||
uint8_t * apdu,
|
||||
@@ -158,7 +160,7 @@ int rr_ack_decode_service_request(
|
||||
uint8_t Send_ReadRange_Request(
|
||||
uint32_t device_id, /* destination device */
|
||||
BACNET_READ_RANGE_DATA * read_access_data);
|
||||
|
||||
|
||||
|
||||
/** @defgroup Trend Trending BIBBs
|
||||
* These BIBBs prescribe the BACnet capabilities required to interoperably
|
||||
@@ -176,4 +178,3 @@ uint8_t Send_ReadRange_Request(
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -43,11 +43,11 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
struct ring_buffer_t {
|
||||
uint8_t *data; /* block of memory or array of data */
|
||||
uint8_t *data; /* block of memory or array of data */
|
||||
unsigned element_size; /* how many bytes for each chunk */
|
||||
unsigned element_count; /* number of chunks of data */
|
||||
unsigned head; /* where the writes go */
|
||||
unsigned tail; /* where the reads come from */
|
||||
unsigned head; /* where the writes go */
|
||||
unsigned tail; /* where the reads come from */
|
||||
};
|
||||
typedef struct ring_buffer_t RING_BUFFER;
|
||||
|
||||
@@ -55,9 +55,9 @@ typedef struct ring_buffer_t RING_BUFFER;
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
unsigned Ringbuf_Count (
|
||||
unsigned Ringbuf_Count(
|
||||
RING_BUFFER const *b);
|
||||
bool Ringbuf_Full (
|
||||
bool Ringbuf_Full(
|
||||
RING_BUFFER const *b);
|
||||
bool Ringbuf_Empty(
|
||||
RING_BUFFER const *b);
|
||||
@@ -67,13 +67,13 @@ extern "C" {
|
||||
RING_BUFFER * b);
|
||||
bool Ringbuf_Put(
|
||||
RING_BUFFER * b, /* ring buffer structure */
|
||||
uint8_t *data_element); /* one element to add to the ring */
|
||||
uint8_t * data_element); /* one element to add to the ring */
|
||||
uint8_t *Ringbuf_Alloc(
|
||||
RING_BUFFER *b);
|
||||
RING_BUFFER * b);
|
||||
/* Note: element_count must be a power of two */
|
||||
void Ringbuf_Init(
|
||||
RING_BUFFER * b, /* ring buffer structure */
|
||||
uint8_t *data, /* data block or array of data */
|
||||
uint8_t * data, /* data block or array of data */
|
||||
unsigned element_size, /* size of one element in the data block */
|
||||
unsigned element_count); /* number of elements in the data block */
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ struct BACnet_Read_Access_Data;
|
||||
*/
|
||||
typedef int (
|
||||
*read_property_function) (
|
||||
BACNET_READ_PROPERTY_DATA *rp_data);
|
||||
BACNET_READ_PROPERTY_DATA * rp_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -106,7 +106,7 @@ extern "C" {
|
||||
int rp_ack_fully_decode_service_request(
|
||||
uint8_t * apdu,
|
||||
int apdu_len,
|
||||
struct BACnet_Read_Access_Data * read_access_data);
|
||||
struct BACnet_Read_Access_Data *read_access_data);
|
||||
|
||||
#ifdef TEST
|
||||
#include "ctest.h"
|
||||
@@ -131,19 +131,15 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @defgroup DataShare Data Sharing BIBBs
|
||||
* These BIBBs prescribe the BACnet capabilities required to interoperably
|
||||
* perform the data sharing functions enumerated in 22.2.1.1 for the BACnet
|
||||
* devices defined therein.
|
||||
*/
|
||||
|
||||
/** @defgroup DSRP Data Sharing -Read Property Service (DS-RP)
|
||||
*//** @defgroup DSRP Data Sharing -Read Property Service (DS-RP)
|
||||
* @ingroup DataShare
|
||||
* 15.5 ReadProperty Service <br>
|
||||
* The ReadProperty service is used by a client BACnet-user to request the
|
||||
* value of one property of one BACnet Object. This service allows read access
|
||||
* to any property of any object, whether a BACnet-defined object or not.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -79,7 +79,7 @@ struct special_property_list_t {
|
||||
typedef void (
|
||||
*rpm_object_property_lists_function) (
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
struct special_property_list_t *pPropertyList);
|
||||
struct special_property_list_t * pPropertyList);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -201,7 +201,6 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @defgroup DSRPM Data Sharing -Read Property Multiple Service (DS-RPM)
|
||||
* @ingroup DataShare
|
||||
* 15.7 ReadPropertyMultiple Service <br>
|
||||
@@ -214,5 +213,4 @@ extern "C" {
|
||||
* A 'Read Access Specification' with the property identifier ALL can be used to
|
||||
* learn the implemented properties of an object along with their values.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h> /* for time_t */
|
||||
#include <time.h> /* for time_t */
|
||||
#include "bacdef.h"
|
||||
#include "cov.h"
|
||||
#include "rp.h"
|
||||
@@ -38,17 +38,17 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Error code for Trend Log storage */
|
||||
typedef struct tl_error {
|
||||
uint16_t usClass;
|
||||
uint16_t usCode;
|
||||
} TL_ERROR;
|
||||
typedef struct tl_error {
|
||||
uint16_t usClass;
|
||||
uint16_t usCode;
|
||||
} TL_ERROR;
|
||||
|
||||
/* Bit string of up to 32 bits for Trend Log storage */
|
||||
|
||||
typedef struct tl_bits {
|
||||
uint8_t ucLen; /* bytes used in upper nibble/bits free in lower nibble */
|
||||
uint8_t ucStore[4];
|
||||
} TL_BITS;
|
||||
typedef struct tl_bits {
|
||||
uint8_t ucLen; /* bytes used in upper nibble/bits free in lower nibble */
|
||||
uint8_t ucStore[4];
|
||||
} TL_BITS;
|
||||
|
||||
/* Storage structure for Trend Log data
|
||||
*
|
||||
@@ -60,49 +60,49 @@ typedef struct tl_bits {
|
||||
* logging capacity as possible every little byte counts!
|
||||
*/
|
||||
|
||||
typedef struct tl_data_record {
|
||||
time_t tTimeStamp; /* When the event occurred */
|
||||
uint8_t ucRecType; /* What type of Event */
|
||||
uint8_t ucStatus; /* Optional Status for read value in b0-b2, b7 = 1 if status is used */
|
||||
union {
|
||||
uint8_t ucLogStatus; /* Change of log state flags */
|
||||
uint8_t ucBoolean; /* Stored boolean value */
|
||||
float fReal; /* Stored floating point value */
|
||||
uint32_t ulEnum; /* Stored enumerated value - max 32 bits */
|
||||
uint32_t ulUValue; /* Stored unsigned value - max 32 bits */
|
||||
int32_t lSValue; /* Stored signed value - max 32 bits */
|
||||
TL_BITS Bits; /* Stored bitstring - max 32 bits */
|
||||
TL_ERROR Error; /* Two part error class/code combo */
|
||||
float fTime; /* Interval value for change of time - seconds */
|
||||
} Datum;
|
||||
} TL_DATA_REC;
|
||||
typedef struct tl_data_record {
|
||||
time_t tTimeStamp; /* When the event occurred */
|
||||
uint8_t ucRecType; /* What type of Event */
|
||||
uint8_t ucStatus; /* Optional Status for read value in b0-b2, b7 = 1 if status is used */
|
||||
union {
|
||||
uint8_t ucLogStatus; /* Change of log state flags */
|
||||
uint8_t ucBoolean; /* Stored boolean value */
|
||||
float fReal; /* Stored floating point value */
|
||||
uint32_t ulEnum; /* Stored enumerated value - max 32 bits */
|
||||
uint32_t ulUValue; /* Stored unsigned value - max 32 bits */
|
||||
int32_t lSValue; /* Stored signed value - max 32 bits */
|
||||
TL_BITS Bits; /* Stored bitstring - max 32 bits */
|
||||
TL_ERROR Error; /* Two part error class/code combo */
|
||||
float fTime; /* Interval value for change of time - seconds */
|
||||
} Datum;
|
||||
} TL_DATA_REC;
|
||||
|
||||
#define TL_T_START_WILD 1 /* Start time is wild carded */
|
||||
#define TL_T_STOP_WILD 2 /* Stop Time is wild carded */
|
||||
#define TL_T_START_WILD 1 /* Start time is wild carded */
|
||||
#define TL_T_STOP_WILD 2 /* Stop Time is wild carded */
|
||||
|
||||
#define TL_MAX_ENTRIES 1000 /* Entries per datalog */
|
||||
#define TL_MAX_ENTRIES 1000 /* Entries per datalog */
|
||||
|
||||
/* Structure containing config and status info for a Trend Log */
|
||||
|
||||
typedef struct tl_log_info {
|
||||
bool bEnable; /* Trend log is active when this is true */
|
||||
BACNET_DATE_TIME StartTime; /* BACnet format start time */
|
||||
time_t tStartTime; /* Local time working copy of start time */
|
||||
BACNET_DATE_TIME StopTime; /* BACnet format stop time */
|
||||
time_t tStopTime; /* Local time working copy of stop time */
|
||||
uint8_t ucTimeFlags; /* Shorthand info on times */
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE Source; /* Where the data comes from */
|
||||
uint32_t ulLogInterval; /* Time between entries in seconds */
|
||||
bool bStopWhenFull; /* Log halts when full if true */
|
||||
uint32_t ulRecordCount; /* Count of items currently in the buffer */
|
||||
uint32_t ulTotalRecordCount; /* Count of all items that have ever been inserted into the buffer */
|
||||
BACNET_LOGGING_TYPE LoggingType; /* Polled/cov/triggered */
|
||||
bool bAlignIntervals; /* If true align to the clock */
|
||||
uint32_t ulIntervalOffset; /* Offset from start of period for taking reading in seconds */
|
||||
bool bTrigger; /* Set to 1 to cause a reading to be taken */
|
||||
int iIndex; /* Current insertion point */
|
||||
time_t tLastDataTime;
|
||||
} TL_LOG_INFO;
|
||||
typedef struct tl_log_info {
|
||||
bool bEnable; /* Trend log is active when this is true */
|
||||
BACNET_DATE_TIME StartTime; /* BACnet format start time */
|
||||
time_t tStartTime; /* Local time working copy of start time */
|
||||
BACNET_DATE_TIME StopTime; /* BACnet format stop time */
|
||||
time_t tStopTime; /* Local time working copy of stop time */
|
||||
uint8_t ucTimeFlags; /* Shorthand info on times */
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE Source; /* Where the data comes from */
|
||||
uint32_t ulLogInterval; /* Time between entries in seconds */
|
||||
bool bStopWhenFull; /* Log halts when full if true */
|
||||
uint32_t ulRecordCount; /* Count of items currently in the buffer */
|
||||
uint32_t ulTotalRecordCount; /* Count of all items that have ever been inserted into the buffer */
|
||||
BACNET_LOGGING_TYPE LoggingType; /* Polled/cov/triggered */
|
||||
bool bAlignIntervals; /* If true align to the clock */
|
||||
uint32_t ulIntervalOffset; /* Offset from start of period for taking reading in seconds */
|
||||
bool bTrigger; /* Set to 1 to cause a reading to be taken */
|
||||
int iIndex; /* Current insertion point */
|
||||
time_t tLastDataTime;
|
||||
} TL_LOG_INFO;
|
||||
|
||||
/*
|
||||
* Data types associated with a BACnet Log Record. We use these for managing the
|
||||
@@ -120,7 +120,7 @@ typedef struct tl_log_info {
|
||||
#define TL_TYPE_NULL 7
|
||||
#define TL_TYPE_ERROR 8
|
||||
#define TL_TYPE_DELTA 9
|
||||
#define TL_TYPE_ANY 10 /* We don't support this particular can of worms! */
|
||||
#define TL_TYPE_ANY 10 /* We don't support this particular can of worms! */
|
||||
|
||||
|
||||
void Trend_Log_Property_Lists(
|
||||
@@ -143,7 +143,7 @@ typedef struct tl_log_info {
|
||||
uint32_t object_instance);
|
||||
|
||||
int Trend_Log_Read_Property(
|
||||
BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_READ_PROPERTY_DATA * rpdata);
|
||||
|
||||
bool Trend_Log_Write_Property(
|
||||
BACNET_WRITE_PROPERTY_DATA * wp_data);
|
||||
@@ -154,44 +154,44 @@ typedef struct tl_log_info {
|
||||
int iLog,
|
||||
BACNET_LOG_STATUS eStatus,
|
||||
bool bState);
|
||||
|
||||
|
||||
bool TL_Is_Enabled(
|
||||
int iLog);
|
||||
|
||||
|
||||
time_t TL_BAC_Time_To_Local(
|
||||
BACNET_DATE_TIME *SourceTime);
|
||||
BACNET_DATE_TIME * SourceTime);
|
||||
|
||||
void TL_Local_Time_To_BAC(
|
||||
BACNET_DATE_TIME *DestTime,
|
||||
BACNET_DATE_TIME * DestTime,
|
||||
time_t SourceTime);
|
||||
|
||||
int TL_encode_entry(
|
||||
uint8_t *apdu,
|
||||
uint8_t * apdu,
|
||||
int iLog,
|
||||
int iEntry);
|
||||
|
||||
|
||||
int TL_encode_by_position(
|
||||
uint8_t *apdu,
|
||||
BACNET_READ_RANGE_DATA *pRequest);
|
||||
|
||||
uint8_t * apdu,
|
||||
BACNET_READ_RANGE_DATA * pRequest);
|
||||
|
||||
int TL_encode_by_sequence(
|
||||
uint8_t *apdu,
|
||||
BACNET_READ_RANGE_DATA *pRequest);
|
||||
uint8_t * apdu,
|
||||
BACNET_READ_RANGE_DATA * pRequest);
|
||||
|
||||
int TL_encode_by_time(
|
||||
uint8_t *apdu,
|
||||
BACNET_READ_RANGE_DATA *pRequest);
|
||||
uint8_t * apdu,
|
||||
BACNET_READ_RANGE_DATA * pRequest);
|
||||
|
||||
bool TrendLogGetRRInfo(
|
||||
BACNET_READ_RANGE_DATA *pRequest, /* Info on the request */
|
||||
RR_PROP_INFO *pInfo); /* Where to put the information */
|
||||
BACNET_READ_RANGE_DATA * pRequest, /* Info on the request */
|
||||
RR_PROP_INFO * pInfo); /* Where to put the information */
|
||||
|
||||
int rr_trend_log_encode(
|
||||
uint8_t *apdu,
|
||||
BACNET_READ_RANGE_DATA *pRequest);
|
||||
int rr_trend_log_encode(
|
||||
uint8_t * apdu,
|
||||
BACNET_READ_RANGE_DATA * pRequest);
|
||||
|
||||
void trend_log_timer(
|
||||
uint16_t uSeconds);
|
||||
void trend_log_timer(
|
||||
uint16_t uSeconds);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -106,7 +106,8 @@ extern "C" {
|
||||
/* use these in tandem */
|
||||
uint8_t tsm_next_free_invokeID(
|
||||
void);
|
||||
void tsm_invokeID_set(uint8_t invokeID);
|
||||
void tsm_invokeID_set(
|
||||
uint8_t invokeID);
|
||||
/* returns the same invoke ID that was given */
|
||||
void tsm_set_confirmed_unsegmented_transaction(
|
||||
uint8_t invokeID,
|
||||
|
||||
@@ -76,7 +76,6 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @defgroup DMDOB Device Management-Dynamic Object Binding (DM-DOB)
|
||||
* @ingroup RDMS
|
||||
* 16.9 Who-Has and I-Have Services <br>
|
||||
|
||||
@@ -67,7 +67,6 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @defgroup DMDDB Device Management-Dynamic Device Binding (DM-DDB)
|
||||
* @ingroup RDMS
|
||||
* 16.10 Who-Is and I-Am Services <br>
|
||||
@@ -87,5 +86,4 @@ extern "C" {
|
||||
* issuing the request is on the local network, or from the NPCI if the device
|
||||
* is on a remote network.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -102,7 +102,6 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** @defgroup DSWP Data Sharing - Write Property Service (DS-WP)
|
||||
* @ingroup DataShare
|
||||
* 15.9 WriteProperty Service <br>
|
||||
@@ -114,5 +113,4 @@ extern "C" {
|
||||
* to modify a restricted property shall result in the return of an error of
|
||||
* 'Error Class' PROPERTY and 'Error Code' WRITE_ACCESS_DENIED.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user