upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Functions | Macros
device-client.c File Reference
Include dependency graph for device-client.c:

API Description

Lightweight base "class" for handling all BACnet objects belonging to a BACnet device, as well as Device-specific properties. This Device instance is designed to meet minimal functionality for simple clients.

Functions

int Device_Read_Property_Local (BACNET_READ_PROPERTY_DATA *rpdata)
 
int Routed_Device_Read_Property_Local (BACNET_READ_PROPERTY_DATA *rpdata)
 
bool Routed_Device_Write_Property_Local (BACNET_WRITE_PROPERTY_DATA *wp_data)
 
unsigned Device_Count (void)
 
uint32_t Device_Index_To_Instance (unsigned index)
 
uint32_t Device_Object_Instance_Number (void)
 
bool Device_Set_Object_Instance_Number (uint32_t object_id)
 
bool Device_Valid_Object_Instance_Number (uint32_t object_id)
 
bool Device_Object_Name (uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
 
bool Device_Set_Object_Name (BACNET_CHARACTER_STRING *object_name)
 
BACNET_DEVICE_STATUS Device_System_Status (void)
 
int Device_Set_System_Status (BACNET_DEVICE_STATUS status, bool local)
 
const char * Device_Vendor_Name (void)
 
uint16_t Device_Vendor_Identifier (void)
 
void Device_Set_Vendor_Identifier (uint16_t vendor_id)
 
const char * Device_Model_Name (void)
 
bool Device_Set_Model_Name (const char *name, size_t length)
 
const char * Device_Firmware_Revision (void)
 
const char * Device_Application_Software_Version (void)
 
bool Device_Set_Application_Software_Version (const char *name, size_t length)
 
const char * Device_Description (void)
 
bool Device_Set_Description (const char *name, size_t length)
 
const char * Device_Location (void)
 
bool Device_Set_Location (const char *name, size_t length)
 
uint8_t Device_Protocol_Version (void)
 
uint8_t Device_Protocol_Revision (void)
 
BACNET_SEGMENTATION Device_Segmentation_Supported (void)
 
uint32_t Device_Database_Revision (void)
 
void Device_Set_Database_Revision (uint32_t revision)
 
void Device_Inc_Database_Revision (void)
 
unsigned Device_Object_List_Count (void)
 
bool Device_Object_List_Identifier (unsigned array_index, int *object_type, uint32_t *instance)
 
bool Device_Valid_Object_Name (BACNET_CHARACTER_STRING *object_name1, int *object_type, uint32_t *object_instance)
 
bool Device_Valid_Object_Id (int object_type, uint32_t object_instance)
 
bool Device_Object_Name_Copy (BACNET_OBJECT_TYPE object_type, uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
 
void Device_getCurrentDateTime (BACNET_DATE_TIME *DateTime)
 
int32_t Device_UTC_Offset (void)
 
bool Device_Daylight_Savings_Status (void)
 
int Device_Read_Property (BACNET_READ_PROPERTY_DATA *rpdata)
 
void Device_Init (object_functions_t *object_table)
 

Macros

#define __USE_XOPEN
 
#define BACDL_MSTP   1
 

Function Documentation

uint16_t Device_Vendor_Identifier ( void  )

Returns the Vendor ID for this Device. See the assignments at http://www.bacnet.org/VendorID/BACnet%20Vendor%20IDs.htm

Returns
The Vendor ID of this Device.
unsigned Device_Object_List_Count ( void  )

Get the total count of objects supported by this Device Object.

Note
Since many network clients depend on the object list for discovery, it must be consistent!
Returns
The count of objects, for all supported Object types.

Here is the caller graph for this function:

bool Device_Object_List_Identifier ( unsigned  array_index,
int *  object_type,
uint32_t *  instance 
)

Lookup the Object at the given array index in the Device's Object List. Even though we don't keep a single linear array of objects in the Device, this method acts as though we do and works through a virtual, concatenated array of all of our object type arrays.

Parameters
array_index[in] The desired array index (1 to N)
object_type[out] The object's type, if found.
instance[out] The object's instance number, if found.
Returns
True if found, else false.

Here is the caller graph for this function:

bool Device_Valid_Object_Name ( BACNET_CHARACTER_STRING *  object_name1,
int *  object_type,
uint32_t *  object_instance 
)

Determine if we have an object with the given object_name. If the object_type and object_instance pointers are not null, and the lookup succeeds, they will be given the resulting values.

Parameters
object_name[in] The desired Object Name to look for.
object_type[out] The BACNET_OBJECT_TYPE of the matching Object.
object_instance[out] The object instance number of the matching Object.
Returns
True on success or else False if not found.

Here is the call graph for this function:

bool Device_Valid_Object_Id ( int  object_type,
uint32_t  object_instance 
)

Determine if we have an object of this type and instance number.

Parameters
object_type[in] The desired BACNET_OBJECT_TYPE
object_instance[in] The object instance number to be looked up.
Returns
True if found, else False if no such Object in this device.
bool Device_Object_Name_Copy ( BACNET_OBJECT_TYPE  object_type,
uint32_t  object_instance,
BACNET_CHARACTER_STRING *  object_name 
)

Copy a child object's object_name value, given its ID.

Parameters
object_type[in] The BACNET_OBJECT_TYPE of the child Object.
object_instance[in] The object instance number of the child Object.
object_name[out] The Object Name found for this child Object.
Returns
True on success or else False if not found.

Here is the call graph for this function: