upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Macros | Typedefs
device.h File Reference
Include dependency graph for device.h:

API Description

Defines functions for handling all BACnet objects belonging to a BACnet device, as well as Device-specific properties.

Go to the source code of this file.

Data Structures

struct  object_functions
struct  commonBacObj_s
struct  devObj_s


void Device_Init (object_functions_t *object_table)
bool Device_Reinitialize (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)
void Device_getCurrentDateTime (BACNET_DATE_TIME *DateTime)
int32_t Device_UTC_Offset (void)
bool Device_Daylight_Savings_Status (void)
void Device_Property_Lists (const int **pRequired, const int **pOptional, const int **pProprietary)
void Device_Objects_Property_List (BACNET_OBJECT_TYPE object_type, struct special_property_list_t *pPropertyList)
bool Device_Encode_Value_List (BACNET_OBJECT_TYPE object_type, uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list)
bool Device_Value_List_Supported (BACNET_OBJECT_TYPE object_type)
bool Device_COV (BACNET_OBJECT_TYPE object_type, uint32_t object_instance)
void Device_COV_Clear (BACNET_OBJECT_TYPE object_type, uint32_t object_instance)
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)
unsigned Device_Object_List_Count (void)
bool Device_Object_List_Identifier (unsigned array_index, int *object_type, uint32_t *instance)
unsigned Device_Count (void)
uint32_t Device_Index_To_Instance (unsigned index)
bool Device_Object_Name (uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
bool Device_Set_Object_Name (BACNET_CHARACTER_STRING *object_name)
bool Device_Object_Name_Copy (BACNET_OBJECT_TYPE object_type, uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
bool Device_Object_Name_ANSI_Init (const char *value)
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)
bool Device_Valid_Object_Name (BACNET_CHARACTER_STRING *object_name, int *object_type, uint32_t *object_instance)
bool Device_Valid_Object_Id (int object_type, uint32_t object_instance)
int Device_Read_Property (BACNET_READ_PROPERTY_DATA *rpdata)
bool Device_Write_Property (BACNET_WRITE_PROPERTY_DATA *wp_data)
bool DeviceGetRRInfo (BACNET_READ_RANGE_DATA *pRequest, RR_PROP_INFO *pInfo)
int Device_Read_Property_Local (BACNET_READ_PROPERTY_DATA *rpdata)
bool Device_Write_Property_Local (BACNET_WRITE_PROPERTY_DATA *wp_data)
void Routing_Device_Init (uint32_t first_object_instance)
uint16_t Add_Routed_Device (uint32_t Object_Instance, BACNET_CHARACTER_STRING *Object_Name, const char *Description)
DEVICE_OBJECT_DATAGet_Routed_Device_Object (int idx)
BACNET_ADDRESS * Get_Routed_Device_Address (int idx)
void routed_get_my_address (BACNET_ADDRESS *my_address)
bool Routed_Device_Address_Lookup (int idx, uint8_t address_len, uint8_t *mac_adress)
bool Routed_Device_GetNext (BACNET_ADDRESS *dest, int *DNET_list, int *cursor)
bool Routed_Device_Is_Valid_Network (uint16_t dest_net, int *DNET_list)
uint32_t Routed_Device_Index_To_Instance (unsigned index)
bool Routed_Device_Valid_Object_Instance_Number (uint32_t object_id)
bool Routed_Device_Name (uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
uint32_t Routed_Device_Object_Instance_Number (void)
bool Routed_Device_Set_Object_Instance_Number (uint32_t object_id)
bool Routed_Device_Set_Object_Name (uint8_t encoding, const char *value, size_t length)
bool Routed_Device_Set_Description (const char *name, size_t length)
void Routed_Device_Inc_Database_Revision (void)
int Routed_Device_Service_Approval (BACNET_CONFIRMED_SERVICE service, int service_argument, uint8_t *apdu_buff, uint8_t invoke_id)


#define MAX_DEV_NAME_LEN   32
#define MAX_DEV_LOC_LEN   64
#define MAX_DEV_MOD_LEN   32
#define MAX_DEV_VER_LEN   16
#define MAX_DEV_DESC_LEN   64


typedef void(* object_init_function )(void)
typedef unsigned(* object_count_function )(void)
typedef uint32_t(* object_index_to_instance_function )(unsigned index)
typedef bool(* object_name_function )(uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
typedef bool(* object_valid_instance_function )(uint32_t object_instance)
typedef unsigned(* object_iterate_function )(unsigned current_index)
typedef bool(* object_value_list_function )(uint32_t object_instance, BACNET_PROPERTY_VALUE *value_list)
typedef bool(* object_cov_function )(uint32_t object_instance)
typedef void(* object_cov_clear_function )(uint32_t object_instance)
typedef void(* object_intrinsic_reporting_function )(uint32_t object_instance)
typedef struct object_functions object_functions_t
typedef struct commonBacObj_s COMMON_BAC_OBJECT
typedef struct devObj_s DEVICE_OBJECT_DATA

Function Documentation

unsigned Device_Object_List_Count ( void  )

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

Since many network clients depend on the object list for discovery, it must be consistent!
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.

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.
True if found, else false.

Here is the caller graph for this function:

bool Device_Object_Name_Copy ( BACNET_OBJECT_TYPE  object_type,
uint32_t  object_instance,

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

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.
True on success or else False if not found.
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

The Vendor ID of this Device.
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.

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.
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.

object_type[in] The desired BACNET_OBJECT_TYPE
object_instance[in] The object instance number to be looked up.
True if found, else False if no such Object in this device.

Typedef Documentation

Structure to define the Object Properties common to all Objects.

typedef struct devObj_s DEVICE_OBJECT_DATA

Structure to define the Properties of Device Objects which distinguish one instance from another. This structure only defines fields for properties that are unique to a given Device object. The rest may be fixed in device.c or hard-coded into the read-property encoding. This may be useful for implementations which manage multiple Devices, eg, a Gateway.