Make most of functions const correct (#714)
* Make most of the functions const correct
Used clang-tidy and sonarlint to help find places where const could
pretty easily applied. Also lot of hand work.
This commit does not yet touch handlers and typedefs of those.
* Fix Arduino uno handler_who_is() has extra parenthesis
For some reason there is extra parenthesis. Remove it this is more
likely buildable.
* Bugfix/bacapp: Fix uninitilized array_index
We have changed bacapp_snprintf_value() to be const correct. After that
we got
```
/home/runner/work/bacnet-stack/bacnet-stack/src/bacnet/bacapp.c:3183:27: warning: 4th function call argument is an uninitialized value [core.CallAndMessage]
ret_val = bacapp_snprintf_weeklyschedule(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
```
So analyzer could now spot that we do not actually initilize array_index
at all. Fix this by setting array_index to zero. Note that I actually do
not know if zeroing is right thing to do here. I choose zero as if this
has worked before it is most likely that it will work with zero value.
* cmake: Add and ignore Wwrite-strings compiler option
Wwrite-strings helps find places where const correctness is broken.
Example it will warn about these
```C
void func1(char* str);
func("test") /* "test" is const so we should not pass it to func1().
char* func2()
{
return "test"; /* func2() should return const char*.
}
```
We still need to ignore it as not all are fixed but let's add it already
so we remember that it should be opened at some point.
---------
Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
@@ -253,7 +253,7 @@ void bvlc_maintenance_timer(uint16_t seconds)
|
||||
*
|
||||
* @return true if the IP from sin match me
|
||||
*/
|
||||
static bool bbmd_address_match_self(BACNET_IP_ADDRESS *addr)
|
||||
static bool bbmd_address_match_self(const BACNET_IP_ADDRESS *addr)
|
||||
{
|
||||
BACNET_IP_ADDRESS my_addr = { 0 };
|
||||
bool status = false;
|
||||
@@ -274,7 +274,7 @@ static bool bbmd_address_match_self(BACNET_IP_ADDRESS *addr)
|
||||
*
|
||||
* @return True if BDT member is found and has a unicast mask
|
||||
*/
|
||||
static bool bbmd_bdt_member_mask_is_unicast(BACNET_IP_ADDRESS *addr)
|
||||
static bool bbmd_bdt_member_mask_is_unicast(const BACNET_IP_ADDRESS *addr)
|
||||
{
|
||||
bool unicast = false;
|
||||
BACNET_IP_ADDRESS my_addr = { 0 };
|
||||
@@ -312,7 +312,9 @@ static bool bbmd_bdt_member_mask_is_unicast(BACNET_IP_ADDRESS *addr)
|
||||
* @return number of bytes encoded in the Forwarded NPDU
|
||||
*/
|
||||
static uint16_t bbmd_forward_npdu(
|
||||
BACNET_IP_ADDRESS *bip_src, uint8_t *npdu, uint16_t npdu_length)
|
||||
const BACNET_IP_ADDRESS *bip_src,
|
||||
const uint8_t *npdu,
|
||||
uint16_t npdu_length)
|
||||
{
|
||||
BACNET_IP_ADDRESS broadcast_address = { 0 };
|
||||
uint8_t mtu[BIP_MPDU_MAX] = { 0 };
|
||||
@@ -338,8 +340,8 @@ static uint16_t bbmd_forward_npdu(
|
||||
* @param original - was the message an original (not forwarded)
|
||||
* @return number of bytes encoded in the Forwarded NPDU
|
||||
*/
|
||||
static uint16_t bbmd_bdt_forward_npdu(BACNET_IP_ADDRESS *bip_src,
|
||||
uint8_t *npdu,
|
||||
static uint16_t bbmd_bdt_forward_npdu(const BACNET_IP_ADDRESS *bip_src,
|
||||
const uint8_t *npdu,
|
||||
uint16_t npdu_length,
|
||||
bool original)
|
||||
{
|
||||
@@ -403,8 +405,8 @@ static uint16_t bbmd_bdt_forward_npdu(BACNET_IP_ADDRESS *bip_src,
|
||||
* @param original - was the message an original (not forwarded)
|
||||
* @return number of bytes encoded in the Forwarded NPDU
|
||||
*/
|
||||
static uint16_t bbmd_fdt_forward_npdu(BACNET_IP_ADDRESS *bip_src,
|
||||
uint8_t *npdu,
|
||||
static uint16_t bbmd_fdt_forward_npdu(const BACNET_IP_ADDRESS *bip_src,
|
||||
const uint8_t *npdu,
|
||||
uint16_t npdu_length,
|
||||
bool original)
|
||||
{
|
||||
@@ -468,7 +470,7 @@ static uint16_t bbmd_fdt_forward_npdu(BACNET_IP_ADDRESS *bip_src,
|
||||
* @param original - was the message an original (not forwarded)
|
||||
*/
|
||||
static void bbmd_read_bdt_ack_handler(
|
||||
BACNET_IP_ADDRESS *addr, uint8_t *npdu, uint16_t npdu_length)
|
||||
const BACNET_IP_ADDRESS *addr, const uint8_t *npdu, uint16_t npdu_length)
|
||||
{
|
||||
#if PRINT_ENABLED
|
||||
BACNET_IP_BROADCAST_DISTRIBUTION_TABLE_ENTRY bdt_entry = { 0 };
|
||||
@@ -516,7 +518,7 @@ static void bbmd_read_bdt_ack_handler(
|
||||
* @param original - was the message an original (not forwarded)
|
||||
*/
|
||||
static void bbmd_read_fdt_ack_handler(
|
||||
BACNET_IP_ADDRESS *addr, uint8_t *npdu, uint16_t npdu_length)
|
||||
const BACNET_IP_ADDRESS *addr, const uint8_t *npdu, uint16_t npdu_length)
|
||||
{
|
||||
#if PRINT_ENABLED
|
||||
BACNET_IP_FOREIGN_DEVICE_TABLE_ENTRY fdt_entry = { 0 };
|
||||
@@ -566,9 +568,9 @@ static void bbmd_read_fdt_ack_handler(
|
||||
* @return Upon successful completion, returns the number of bytes sent.
|
||||
* Otherwise, -1 shall be returned and errno set to indicate the error.
|
||||
*/
|
||||
int bvlc_send_pdu(BACNET_ADDRESS *dest,
|
||||
BACNET_NPDU_DATA *npdu_data,
|
||||
uint8_t *pdu,
|
||||
int bvlc_send_pdu(const BACNET_ADDRESS *dest,
|
||||
const BACNET_NPDU_DATA *npdu_data,
|
||||
const uint8_t *pdu,
|
||||
unsigned pdu_len)
|
||||
{
|
||||
BACNET_IP_ADDRESS bvlc_dest = { 0 };
|
||||
@@ -637,7 +639,8 @@ int bvlc_send_pdu(BACNET_ADDRESS *dest,
|
||||
* @return Upon successful completion, returns the number of bytes sent.
|
||||
* Otherwise, -1 shall be returned and errno set to indicate the error.
|
||||
*/
|
||||
static int bvlc_send_result(BACNET_IP_ADDRESS *dest_addr, uint16_t result_code)
|
||||
static int bvlc_send_result(
|
||||
const BACNET_IP_ADDRESS *dest_addr, uint16_t result_code)
|
||||
{
|
||||
uint8_t mtu[BIP_MPDU_MAX] = { 0 };
|
||||
uint16_t mtu_len = 0;
|
||||
@@ -1192,7 +1195,8 @@ int bvlc_broadcast_handler(BACNET_IP_ADDRESS *addr,
|
||||
* 0 if no registration request is sent, or
|
||||
* -1 if registration fails.
|
||||
*/
|
||||
int bvlc_register_with_bbmd(BACNET_IP_ADDRESS *bbmd_addr, uint16_t ttl_seconds)
|
||||
int bvlc_register_with_bbmd(
|
||||
const BACNET_IP_ADDRESS *bbmd_addr, uint16_t ttl_seconds)
|
||||
{
|
||||
/* Store the BBMD address and port so that we won't broadcast locally. */
|
||||
/* We are a foreign device! */
|
||||
@@ -1232,7 +1236,7 @@ uint16_t bvlc_remote_bbmd_lifetime(void)
|
||||
* @param bbmd_addr - IPv4 address of BBMD with which to read
|
||||
* @return Positive number (of bytes sent) on success
|
||||
*/
|
||||
int bvlc_bbmd_read_bdt(BACNET_IP_ADDRESS *bbmd_addr)
|
||||
int bvlc_bbmd_read_bdt(const BACNET_IP_ADDRESS *bbmd_addr)
|
||||
{
|
||||
BVLC_Buffer_Len = bvlc_encode_read_broadcast_distribution_table(
|
||||
&BVLC_Buffer[0], sizeof(BVLC_Buffer));
|
||||
@@ -1245,7 +1249,7 @@ int bvlc_bbmd_read_bdt(BACNET_IP_ADDRESS *bbmd_addr)
|
||||
* @param bbmd_addr - IPv4 address of BBMD with which to read
|
||||
* @return Positive number (of bytes sent) on success
|
||||
*/
|
||||
int bvlc_bbmd_write_bdt(BACNET_IP_ADDRESS *bbmd_addr,
|
||||
int bvlc_bbmd_write_bdt(const BACNET_IP_ADDRESS *bbmd_addr,
|
||||
BACNET_IP_BROADCAST_DISTRIBUTION_TABLE_ENTRY *bdt_list)
|
||||
{
|
||||
BVLC_Buffer_Len = bvlc_encode_write_broadcast_distribution_table(
|
||||
@@ -1259,7 +1263,7 @@ int bvlc_bbmd_write_bdt(BACNET_IP_ADDRESS *bbmd_addr,
|
||||
* @param bbmd_addr - IPv4 address of BBMD with which to read
|
||||
* @return Positive number (of bytes sent) on success
|
||||
*/
|
||||
int bvlc_bbmd_read_fdt(BACNET_IP_ADDRESS *bbmd_addr)
|
||||
int bvlc_bbmd_read_fdt(const BACNET_IP_ADDRESS *bbmd_addr)
|
||||
{
|
||||
BVLC_Buffer_Len = bvlc_encode_read_foreign_device_table(
|
||||
&BVLC_Buffer[0], sizeof(BVLC_Buffer));
|
||||
|
||||
@@ -47,9 +47,9 @@ int bvlc_bbmd_disabled_handler(BACNET_IP_ADDRESS *addr,
|
||||
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int bvlc_send_pdu(BACNET_ADDRESS *dest,
|
||||
BACNET_NPDU_DATA *npdu_data,
|
||||
uint8_t *pdu,
|
||||
int bvlc_send_pdu(const BACNET_ADDRESS *dest,
|
||||
const BACNET_NPDU_DATA *npdu_data,
|
||||
const uint8_t *pdu,
|
||||
unsigned pdu_len);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -76,18 +76,18 @@ void bvlc_debug_disable(void);
|
||||
|
||||
/* send a Read BDT request */
|
||||
BACNET_STACK_EXPORT
|
||||
int bvlc_bbmd_read_bdt(BACNET_IP_ADDRESS *bbmd_addr);
|
||||
int bvlc_bbmd_read_bdt(const BACNET_IP_ADDRESS *bbmd_addr);
|
||||
BACNET_STACK_EXPORT
|
||||
int bvlc_bbmd_write_bdt(BACNET_IP_ADDRESS *bbmd_addr,
|
||||
int bvlc_bbmd_write_bdt(const BACNET_IP_ADDRESS *bbmd_addr,
|
||||
BACNET_IP_BROADCAST_DISTRIBUTION_TABLE_ENTRY *bdt_list);
|
||||
/* send a Read FDT request */
|
||||
BACNET_STACK_EXPORT
|
||||
int bvlc_bbmd_read_fdt(BACNET_IP_ADDRESS *bbmd_addr);
|
||||
int bvlc_bbmd_read_fdt(const BACNET_IP_ADDRESS *bbmd_addr);
|
||||
|
||||
/* registers with a bbmd as a foreign device */
|
||||
BACNET_STACK_EXPORT
|
||||
int bvlc_register_with_bbmd(
|
||||
BACNET_IP_ADDRESS *address, uint16_t time_to_live_seconds);
|
||||
const BACNET_IP_ADDRESS *address, uint16_t time_to_live_seconds);
|
||||
BACNET_STACK_EXPORT
|
||||
void bvlc_remote_bbmd_address(
|
||||
BACNET_IP_ADDRESS *address);
|
||||
|
||||
@@ -114,7 +114,7 @@ void bvlc6_maintenance_timer(uint16_t seconds)
|
||||
* @return true if the address was set
|
||||
*/
|
||||
static bool bbmd6_address_from_vmac(
|
||||
BACNET_IP6_ADDRESS *addr, struct vmac_data *vmac)
|
||||
BACNET_IP6_ADDRESS *addr, const struct vmac_data *vmac)
|
||||
{
|
||||
bool status = false;
|
||||
unsigned int i = 0;
|
||||
@@ -139,7 +139,7 @@ static bool bbmd6_address_from_vmac(
|
||||
* @return true if the address was set
|
||||
*/
|
||||
static bool bbmd6_address_to_vmac(
|
||||
struct vmac_data *vmac, BACNET_IP6_ADDRESS *addr)
|
||||
struct vmac_data *vmac, const BACNET_IP6_ADDRESS *addr)
|
||||
{
|
||||
bool status = false;
|
||||
unsigned int i = 0;
|
||||
@@ -162,7 +162,7 @@ static bool bbmd6_address_to_vmac(
|
||||
* @param device_id - device ID used as the key-pair
|
||||
* @param addr - IPv6 source address
|
||||
*/
|
||||
static void bbmd6_add_vmac(uint32_t device_id, BACNET_IP6_ADDRESS *addr)
|
||||
static void bbmd6_add_vmac(uint32_t device_id, const BACNET_IP6_ADDRESS *addr)
|
||||
{
|
||||
bool found = false;
|
||||
uint32_t list_device_id = 0;
|
||||
@@ -224,7 +224,7 @@ static void bbmd6_add_vmac(uint32_t device_id, BACNET_IP6_ADDRESS *addr)
|
||||
*
|
||||
* @return true if the IPv6 from sin match me
|
||||
*/
|
||||
static bool bbmd6_address_match_self(BACNET_IP6_ADDRESS *addr)
|
||||
static bool bbmd6_address_match_self(const BACNET_IP6_ADDRESS *addr)
|
||||
{
|
||||
BACNET_IP6_ADDRESS my_addr = { 0 };
|
||||
bool status = false;
|
||||
@@ -249,7 +249,7 @@ static bool bbmd6_address_match_self(BACNET_IP6_ADDRESS *addr)
|
||||
* @return true if the address was in the VMAC table
|
||||
*/
|
||||
static bool bbmd6_address_from_bacnet_address(
|
||||
BACNET_IP6_ADDRESS *addr, uint32_t *vmac_src, BACNET_ADDRESS *baddr)
|
||||
BACNET_IP6_ADDRESS *addr, uint32_t *vmac_src, const BACNET_ADDRESS *baddr)
|
||||
{
|
||||
struct vmac_data *vmac;
|
||||
bool status = false;
|
||||
@@ -285,9 +285,9 @@ static bool bbmd6_address_from_bacnet_address(
|
||||
* @return Upon successful completion, returns the number of bytes sent.
|
||||
* Otherwise, -1 shall be returned and errno set to indicate the error.
|
||||
*/
|
||||
int bvlc6_send_pdu(BACNET_ADDRESS *dest,
|
||||
BACNET_NPDU_DATA *npdu_data,
|
||||
uint8_t *pdu,
|
||||
int bvlc6_send_pdu(const BACNET_ADDRESS *dest,
|
||||
const BACNET_NPDU_DATA *npdu_data,
|
||||
const uint8_t *pdu,
|
||||
unsigned pdu_len)
|
||||
{
|
||||
BACNET_IP6_ADDRESS bvlc_dest = { 0 };
|
||||
@@ -451,7 +451,9 @@ static void bbmd6_send_forward_npdu(BACNET_IP6_ADDRESS *address,
|
||||
* Otherwise, -1 shall be returned and errno set to indicate the error.
|
||||
*/
|
||||
static int bvlc6_send_result(
|
||||
BACNET_IP6_ADDRESS *dest_addr, uint32_t vmac_src, uint16_t result_code)
|
||||
const BACNET_IP6_ADDRESS *dest_addr,
|
||||
uint32_t vmac_src,
|
||||
uint16_t result_code)
|
||||
{
|
||||
uint8_t mtu[BIP6_MPDU_MAX] = { 0 };
|
||||
uint16_t mtu_len = 0;
|
||||
@@ -473,7 +475,7 @@ static int bvlc6_send_result(
|
||||
* Otherwise, -1 shall be returned and errno set to indicate the error.
|
||||
*/
|
||||
static int bvlc6_send_address_resolution_ack(
|
||||
BACNET_IP6_ADDRESS *dest_addr, uint32_t vmac_src, uint32_t vmac_dst)
|
||||
const BACNET_IP6_ADDRESS *dest_addr, uint32_t vmac_src, uint32_t vmac_dst)
|
||||
{
|
||||
uint8_t mtu[BIP6_MPDU_MAX] = { 0 };
|
||||
uint16_t mtu_len = 0;
|
||||
@@ -497,7 +499,7 @@ static int bvlc6_send_address_resolution_ack(
|
||||
* Otherwise, -1 shall be returned and errno set to indicate the error.
|
||||
*/
|
||||
static int bvlc6_send_virtual_address_resolution_ack(
|
||||
BACNET_IP6_ADDRESS *dest_addr, uint32_t vmac_src, uint32_t vmac_dst)
|
||||
const BACNET_IP6_ADDRESS *dest_addr, uint32_t vmac_src, uint32_t vmac_dst)
|
||||
{
|
||||
uint8_t mtu[BIP6_MPDU_MAX] = { 0 };
|
||||
uint16_t mtu_len = 0;
|
||||
@@ -516,7 +518,7 @@ static int bvlc6_send_virtual_address_resolution_ack(
|
||||
* @param pdu_len - How many bytes in NPDU+APDU buffer.
|
||||
*/
|
||||
static void bbmd6_virtual_address_resolution_handler(
|
||||
BACNET_IP6_ADDRESS *addr, uint8_t *pdu, uint16_t pdu_len)
|
||||
const BACNET_IP6_ADDRESS *addr, const uint8_t *pdu, uint16_t pdu_len)
|
||||
{
|
||||
int function_len = 0;
|
||||
uint32_t vmac_src = 0;
|
||||
@@ -550,7 +552,7 @@ static void bbmd6_virtual_address_resolution_handler(
|
||||
* @param pdu_len - How many bytes in NPDU+APDU buffer.
|
||||
*/
|
||||
static void bbmd6_virtual_address_resolution_ack_handler(
|
||||
BACNET_IP6_ADDRESS *addr, uint8_t *pdu, uint16_t pdu_len)
|
||||
const BACNET_IP6_ADDRESS *addr, const uint8_t *pdu, uint16_t pdu_len)
|
||||
{
|
||||
int function_len = 0;
|
||||
uint32_t vmac_src = 0;
|
||||
@@ -578,7 +580,7 @@ static void bbmd6_virtual_address_resolution_ack_handler(
|
||||
* @param pdu_len - How many bytes in NPDU+APDU buffer.
|
||||
*/
|
||||
static void bbmd6_address_resolution_handler(
|
||||
BACNET_IP6_ADDRESS *addr, uint8_t *pdu, uint16_t pdu_len)
|
||||
const BACNET_IP6_ADDRESS *addr, const uint8_t *pdu, uint16_t pdu_len)
|
||||
{
|
||||
int function_len = 0;
|
||||
uint32_t vmac_src = 0;
|
||||
@@ -614,7 +616,7 @@ static void bbmd6_address_resolution_handler(
|
||||
* @param pdu_len - How many bytes in NPDU+APDU buffer.
|
||||
*/
|
||||
static void bbmd6_address_resolution_ack_handler(
|
||||
BACNET_IP6_ADDRESS *addr, uint8_t *pdu, uint16_t pdu_len)
|
||||
const BACNET_IP6_ADDRESS *addr, const uint8_t *pdu, uint16_t pdu_len)
|
||||
{
|
||||
int function_len = 0;
|
||||
uint32_t vmac_src = 0;
|
||||
@@ -1039,7 +1041,7 @@ int bvlc6_handler(BACNET_IP6_ADDRESS *addr,
|
||||
* 0 if no registration request is sent, or
|
||||
* -1 if registration fails.
|
||||
*/
|
||||
int bvlc6_register_with_bbmd(BACNET_IP6_ADDRESS *bbmd_addr,
|
||||
int bvlc6_register_with_bbmd(const BACNET_IP6_ADDRESS *bbmd_addr,
|
||||
uint16_t ttl_seconds)
|
||||
{
|
||||
uint8_t mtu[BIP6_MPDU_MAX] = { 0 };
|
||||
|
||||
@@ -41,14 +41,14 @@ extern "C" {
|
||||
uint16_t mtu_len);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int bvlc6_send_pdu(BACNET_ADDRESS *dest,
|
||||
BACNET_NPDU_DATA *npdu_data,
|
||||
uint8_t *pdu,
|
||||
int bvlc6_send_pdu(const BACNET_ADDRESS *dest,
|
||||
const BACNET_NPDU_DATA *npdu_data,
|
||||
const uint8_t *pdu,
|
||||
unsigned pdu_len);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int bvlc6_register_with_bbmd(
|
||||
BACNET_IP6_ADDRESS *bbmd_addr,
|
||||
const BACNET_IP6_ADDRESS *bbmd_addr,
|
||||
uint16_t time_to_live_seconds);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
@@ -52,7 +52,7 @@ unsigned int VMAC_Count(void)
|
||||
*
|
||||
* @return true if the device ID and MAC are added
|
||||
*/
|
||||
bool VMAC_Add(uint32_t device_id, struct vmac_data *src)
|
||||
bool VMAC_Add(uint32_t device_id, const struct vmac_data *src)
|
||||
{
|
||||
bool status = false;
|
||||
struct vmac_data *pVMAC = NULL;
|
||||
@@ -126,7 +126,9 @@ struct vmac_data *VMAC_Find_By_Key(uint32_t device_id)
|
||||
*
|
||||
* @return true if the addresses are different
|
||||
*/
|
||||
bool VMAC_Different(struct vmac_data *vmac1, struct vmac_data *vmac2)
|
||||
bool VMAC_Different(
|
||||
const struct vmac_data *vmac1,
|
||||
const struct vmac_data *vmac2)
|
||||
{
|
||||
bool status = false;
|
||||
unsigned int i = 0;
|
||||
@@ -157,7 +159,9 @@ bool VMAC_Different(struct vmac_data *vmac1, struct vmac_data *vmac2)
|
||||
*
|
||||
* @return true if the addresses are the same
|
||||
*/
|
||||
bool VMAC_Match(struct vmac_data *vmac1, struct vmac_data *vmac2)
|
||||
bool VMAC_Match(
|
||||
const struct vmac_data *vmac1,
|
||||
const struct vmac_data *vmac2)
|
||||
{
|
||||
bool status = false;
|
||||
unsigned int i = 0;
|
||||
@@ -190,7 +194,7 @@ bool VMAC_Match(struct vmac_data *vmac1, struct vmac_data *vmac2)
|
||||
*
|
||||
* @return true if the VMAC address was found
|
||||
*/
|
||||
bool VMAC_Find_By_Data(struct vmac_data *vmac, uint32_t *device_id)
|
||||
bool VMAC_Find_By_Data(const struct vmac_data *vmac, uint32_t *device_id)
|
||||
{
|
||||
bool status = false;
|
||||
struct vmac_data *list_vmac;
|
||||
|
||||
@@ -35,19 +35,19 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
struct vmac_data *VMAC_Find_By_Key(uint32_t device_id);
|
||||
BACNET_STACK_EXPORT
|
||||
bool VMAC_Find_By_Data(struct vmac_data *vmac, uint32_t *device_id);
|
||||
bool VMAC_Find_By_Data(const struct vmac_data *vmac, uint32_t *device_id);
|
||||
BACNET_STACK_EXPORT
|
||||
bool VMAC_Add(uint32_t device_id, struct vmac_data *pVMAC);
|
||||
bool VMAC_Add(uint32_t device_id, const struct vmac_data *pVMAC);
|
||||
BACNET_STACK_EXPORT
|
||||
bool VMAC_Delete(uint32_t device_id);
|
||||
BACNET_STACK_EXPORT
|
||||
bool VMAC_Different(
|
||||
struct vmac_data *vmac1,
|
||||
struct vmac_data *vmac2);
|
||||
const struct vmac_data *vmac1,
|
||||
const struct vmac_data *vmac2);
|
||||
BACNET_STACK_EXPORT
|
||||
bool VMAC_Match(
|
||||
struct vmac_data *vmac1,
|
||||
struct vmac_data *vmac2);
|
||||
const struct vmac_data *vmac1,
|
||||
const struct vmac_data *vmac2);
|
||||
BACNET_STACK_EXPORT
|
||||
void VMAC_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
@@ -382,7 +382,7 @@ bool address_get_by_device(
|
||||
*
|
||||
* @return true/false
|
||||
*/
|
||||
bool address_get_device_id(BACNET_ADDRESS *src, uint32_t *device_id)
|
||||
bool address_get_device_id(const BACNET_ADDRESS *src, uint32_t *device_id)
|
||||
{
|
||||
struct Address_Cache_Entry *pMatch;
|
||||
bool found = false; /* return value */
|
||||
@@ -413,7 +413,8 @@ bool address_get_device_id(BACNET_ADDRESS *src, uint32_t *device_id)
|
||||
* @param max_apdu Maximum APDU size.
|
||||
* @param src Pointer to address structure to add.
|
||||
*/
|
||||
void address_add(uint32_t device_id, unsigned max_apdu, BACNET_ADDRESS *src)
|
||||
void address_add(
|
||||
uint32_t device_id, unsigned max_apdu, const BACNET_ADDRESS *src)
|
||||
{
|
||||
bool found = false; /* return value */
|
||||
struct Address_Cache_Entry *pMatch;
|
||||
@@ -594,7 +595,7 @@ bool address_bind_request(
|
||||
* @param src Pointer to the BACnet address.
|
||||
*/
|
||||
void address_add_binding(
|
||||
uint32_t device_id, unsigned max_apdu, BACNET_ADDRESS *src)
|
||||
uint32_t device_id, unsigned max_apdu, const BACNET_ADDRESS *src)
|
||||
{
|
||||
struct Address_Cache_Entry *pMatch;
|
||||
unsigned index;
|
||||
|
||||
@@ -38,7 +38,7 @@ extern "C" {
|
||||
void address_add(
|
||||
uint32_t device_id,
|
||||
unsigned max_apdu,
|
||||
BACNET_ADDRESS * src);
|
||||
const BACNET_ADDRESS * src);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void address_remove_device(
|
||||
@@ -67,7 +67,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool address_get_device_id(
|
||||
BACNET_ADDRESS * src,
|
||||
const BACNET_ADDRESS * src,
|
||||
uint32_t * device_id);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -91,7 +91,7 @@ extern "C" {
|
||||
void address_add_binding(
|
||||
uint32_t device_id,
|
||||
unsigned max_apdu,
|
||||
BACNET_ADDRESS * src);
|
||||
const BACNET_ADDRESS * src);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int address_list_encode(
|
||||
|
||||
@@ -109,8 +109,8 @@ static void bacnet_data_object_init(void)
|
||||
}
|
||||
|
||||
static void bacnet_data_object_store(int index,
|
||||
BACNET_READ_PROPERTY_DATA *rp_data,
|
||||
BACNET_APPLICATION_DATA_VALUE *value)
|
||||
const BACNET_READ_PROPERTY_DATA *rp_data,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value)
|
||||
{
|
||||
BACNET_DATA_OBJECT *object = NULL;
|
||||
|
||||
@@ -189,7 +189,7 @@ void bacnet_data_value_save(uint32_t device_instance,
|
||||
* @brief Handles the BACnet Data Analog Value processing
|
||||
* @param object - BACnet object structure data pointer
|
||||
*/
|
||||
static void bacnet_data_object_process(BACNET_DATA_OBJECT *object)
|
||||
static void bacnet_data_object_process(const BACNET_DATA_OBJECT *object)
|
||||
{
|
||||
if (object && (object->Device_ID < BACNET_MAX_INSTANCE) &&
|
||||
(object->Object_ID < BACNET_MAX_INSTANCE)) {
|
||||
|
||||
@@ -555,8 +555,8 @@ bool bacnet_discover_object_property_identifier(uint32_t device_id,
|
||||
* @param device_data [in] Pointer to the device data structure
|
||||
*/
|
||||
static void bacnet_device_object_property_add(uint32_t device_id,
|
||||
BACNET_READ_PROPERTY_DATA *rp_data,
|
||||
BACNET_APPLICATION_DATA_VALUE *value,
|
||||
const BACNET_READ_PROPERTY_DATA *rp_data,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value,
|
||||
BACNET_DEVICE_DATA *device_data)
|
||||
{
|
||||
BACNET_OBJECT_DATA *object_data;
|
||||
|
||||
@@ -351,7 +351,7 @@ static uint8_t Send_RPM_All_Request(uint32_t device_id,
|
||||
* @param service_request [in] The contents of the service request.
|
||||
* @return true if the process is finished
|
||||
*/
|
||||
static bool bacnet_read_write_process(TARGET_DATA *target)
|
||||
static bool bacnet_read_write_process(const TARGET_DATA *target)
|
||||
{
|
||||
bool found = false;
|
||||
unsigned max_apdu = 0;
|
||||
|
||||
@@ -46,12 +46,12 @@
|
||||
*/
|
||||
int Send_Network_Layer_Message(BACNET_NETWORK_MESSAGE_TYPE network_message_type,
|
||||
BACNET_ADDRESS *dst,
|
||||
int *iArgs)
|
||||
const int *iArgs)
|
||||
{
|
||||
int len = 0;
|
||||
int pdu_len = 0;
|
||||
int bytes_sent = 0;
|
||||
int *pVal = iArgs; /* Start with first value */
|
||||
const int *pVal = iArgs; /* Start with first value */
|
||||
bool data_expecting_reply = false;
|
||||
BACNET_NPDU_DATA npdu_data;
|
||||
BACNET_ADDRESS bcastDest;
|
||||
@@ -209,7 +209,7 @@ void Send_I_Am_Router_To_Network(const int DNET_list[])
|
||||
{
|
||||
/* Use a NULL dst here since we want a broadcast MAC address. */
|
||||
Send_Network_Layer_Message(
|
||||
NETWORK_MESSAGE_I_AM_ROUTER_TO_NETWORK, NULL, (int *)DNET_list);
|
||||
NETWORK_MESSAGE_I_AM_ROUTER_TO_NETWORK, NULL, DNET_list);
|
||||
}
|
||||
|
||||
/** Finds a specific router, or all reachable BACnet networks.
|
||||
@@ -253,7 +253,7 @@ void Send_Initialize_Routing_Table(BACNET_ADDRESS *dst, const int DNET_list[])
|
||||
{
|
||||
/* Use a NULL dst here since we want a broadcast MAC address. */
|
||||
Send_Network_Layer_Message(
|
||||
NETWORK_MESSAGE_INIT_RT_TABLE, dst, (int *)DNET_list);
|
||||
NETWORK_MESSAGE_INIT_RT_TABLE, dst, DNET_list);
|
||||
}
|
||||
|
||||
/** Sends our Routing Table, built from our DNET[] array, as an ACK.
|
||||
@@ -277,7 +277,7 @@ void Send_Initialize_Routing_Table_Ack(
|
||||
BACNET_ADDRESS *dst, const int DNET_list[])
|
||||
{
|
||||
Send_Network_Layer_Message(
|
||||
NETWORK_MESSAGE_INIT_RT_TABLE_ACK, dst, (int *)DNET_list);
|
||||
NETWORK_MESSAGE_INIT_RT_TABLE_ACK, dst, DNET_list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@ extern "C" {
|
||||
int Send_Network_Layer_Message(
|
||||
BACNET_NETWORK_MESSAGE_TYPE network_message_type,
|
||||
BACNET_ADDRESS * dst,
|
||||
int *iArgs);
|
||||
const int *iArgs);
|
||||
BACNET_STACK_EXPORT
|
||||
void Send_Who_Is_Router_To_Network(
|
||||
BACNET_ADDRESS * dst,
|
||||
|
||||
@@ -56,7 +56,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Description_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Accumulator_Object_Name(
|
||||
|
||||
@@ -113,7 +113,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Description_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Access_Door_Out_Of_Service(
|
||||
|
||||
@@ -261,7 +261,7 @@ bool Analog_Input_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Analog_Input_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Analog_Input_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false;
|
||||
struct analog_input_descr *pObject;
|
||||
@@ -322,10 +322,10 @@ unsigned Analog_Input_Event_State(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Analog_Input_Description(uint32_t object_instance)
|
||||
const char *Analog_Input_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct analog_input_descr *pObject;
|
||||
const char *name = NULL;
|
||||
const struct analog_input_descr *pObject;
|
||||
|
||||
pObject = Analog_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
@@ -341,7 +341,8 @@ char *Analog_Input_Description(uint32_t object_instance)
|
||||
* @param new_name - holds the description to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Analog_Input_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Analog_Input_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct analog_input_descr *pObject;
|
||||
|
||||
@@ -32,8 +32,8 @@ typedef struct analog_input_descr {
|
||||
float Prior_Value;
|
||||
float COV_Increment;
|
||||
bool Changed;
|
||||
char* Object_Name;
|
||||
char* Description;
|
||||
const char* Object_Name;
|
||||
const char* Description;
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
uint32_t Time_Delay;
|
||||
uint32_t Notification_Class;
|
||||
@@ -85,18 +85,18 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char * Analog_Input_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Analog_Input_Description(
|
||||
const char *Analog_Input_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Input_Description_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Analog_Input_Reliability(
|
||||
|
||||
@@ -508,7 +508,7 @@ bool Analog_Output_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Analog_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Analog_Output_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -684,7 +684,7 @@ BACNET_RELIABILITY Analog_Output_Reliability(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return true the status flag is in Fault
|
||||
*/
|
||||
static bool Analog_Output_Object_Fault(struct object_data *pObject)
|
||||
static bool Analog_Output_Object_Fault(const struct object_data *pObject)
|
||||
{
|
||||
bool fault = false;
|
||||
|
||||
@@ -744,14 +744,14 @@ static bool Analog_Output_Fault(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Analog_Output_Description(uint32_t object_instance)
|
||||
const char *Analog_Output_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
}
|
||||
|
||||
return name;
|
||||
@@ -763,7 +763,8 @@ char *Analog_Output_Description(uint32_t object_instance)
|
||||
* @param new_name - holds the description to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Analog_Output_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Analog_Output_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -104,18 +104,18 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char * Analog_Output_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Analog_Output_Description(
|
||||
const char *Analog_Output_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Description_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Output_Units_Set(
|
||||
|
||||
@@ -273,7 +273,7 @@ bool Analog_Value_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Analog_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Analog_Value_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false;
|
||||
struct analog_value_descr *pObject;
|
||||
@@ -330,10 +330,10 @@ unsigned Analog_Value_Event_State(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Analog_Value_Description(uint32_t object_instance)
|
||||
const char *Analog_Value_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct analog_value_descr *pObject;
|
||||
const char *name = NULL;
|
||||
const struct analog_value_descr *pObject;
|
||||
|
||||
pObject = Analog_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
@@ -349,7 +349,8 @@ char *Analog_Value_Description(uint32_t object_instance)
|
||||
* @param new_name - holds the description to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Analog_Value_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Analog_Value_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct analog_value_descr *pObject;
|
||||
|
||||
@@ -34,7 +34,7 @@ typedef struct analog_value_descr {
|
||||
float COV_Increment;
|
||||
bool Changed;
|
||||
const char* Object_Name;
|
||||
char* Description;
|
||||
const char* Description;
|
||||
BACNET_RELIABILITY Reliability;
|
||||
#if defined(INTRINSIC_REPORTING)
|
||||
uint32_t Time_Delay;
|
||||
@@ -82,7 +82,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Analog_Value_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
@@ -131,12 +131,12 @@ extern "C" {
|
||||
float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Analog_Value_Description(
|
||||
const char *Analog_Value_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Analog_Value_Description_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Analog_Value_Reliability(
|
||||
|
||||
@@ -331,7 +331,7 @@ uint32_t bacfile_read(uint32_t object_instance, uint8_t *buffer,
|
||||
* @param buffer_size - in bytes
|
||||
* @return file size in bytes
|
||||
*/
|
||||
uint32_t bacfile_write(uint32_t object_instance, uint8_t *buffer,
|
||||
uint32_t bacfile_write(uint32_t object_instance, const uint8_t *buffer,
|
||||
uint32_t buffer_size)
|
||||
{
|
||||
const char *pFilename = NULL;
|
||||
@@ -877,14 +877,14 @@ bool bacfile_write_stream_data(BACNET_ATOMIC_WRITE_FILE_DATA *data)
|
||||
return found;
|
||||
}
|
||||
|
||||
bool bacfile_write_record_data(BACNET_ATOMIC_WRITE_FILE_DATA *data)
|
||||
bool bacfile_write_record_data(const BACNET_ATOMIC_WRITE_FILE_DATA *data)
|
||||
{
|
||||
const char *pFilename = NULL;
|
||||
bool found = false;
|
||||
FILE *pFile = NULL;
|
||||
uint32_t i = 0;
|
||||
char dummy_data[FILE_RECORD_SIZE];
|
||||
char *pData = NULL;
|
||||
const char *pData = NULL;
|
||||
|
||||
pFilename = bacfile_pathname(data->object_instance);
|
||||
if (pFilename) {
|
||||
@@ -913,7 +913,7 @@ bool bacfile_write_record_data(BACNET_ATOMIC_WRITE_FILE_DATA *data)
|
||||
}
|
||||
}
|
||||
for (i = 0; i < data->type.record.returnedRecordCount; i++) {
|
||||
if (fwrite(octetstring_value(&data->fileData[i]),
|
||||
if (fwrite(octetstring_value((BACNET_OCTET_STRING*)&data->fileData[i]),
|
||||
octetstring_length(&data->fileData[i]), 1,
|
||||
pFile) != 1) {
|
||||
/* do something if it fails? */
|
||||
@@ -927,7 +927,7 @@ bool bacfile_write_record_data(BACNET_ATOMIC_WRITE_FILE_DATA *data)
|
||||
}
|
||||
|
||||
bool bacfile_read_ack_stream_data(
|
||||
uint32_t instance, BACNET_ATOMIC_READ_FILE_DATA *data)
|
||||
uint32_t instance, const BACNET_ATOMIC_READ_FILE_DATA *data)
|
||||
{
|
||||
bool found = false;
|
||||
FILE *pFile = NULL;
|
||||
@@ -939,7 +939,7 @@ bool bacfile_read_ack_stream_data(
|
||||
pFile = fopen(pFilename, "rb+");
|
||||
if (pFile) {
|
||||
(void)fseek(pFile, data->type.stream.fileStartPosition, SEEK_SET);
|
||||
if (fwrite(octetstring_value(&data->fileData[0]),
|
||||
if (fwrite(octetstring_value((BACNET_OCTET_STRING*)&data->fileData[0]),
|
||||
octetstring_length(&data->fileData[0]), 1, pFile) != 1) {
|
||||
#if PRINT_ENABLED
|
||||
fprintf(stderr, "Failed to write to %s (%lu)!\n", pFilename,
|
||||
@@ -954,7 +954,7 @@ bool bacfile_read_ack_stream_data(
|
||||
}
|
||||
|
||||
bool bacfile_read_ack_record_data(
|
||||
uint32_t instance, BACNET_ATOMIC_READ_FILE_DATA *data)
|
||||
uint32_t instance, const BACNET_ATOMIC_READ_FILE_DATA *data)
|
||||
{
|
||||
bool found = false;
|
||||
FILE *pFile = NULL;
|
||||
@@ -978,7 +978,7 @@ bool bacfile_read_ack_record_data(
|
||||
}
|
||||
}
|
||||
for (i = 0; i < data->type.record.RecordCount; i++) {
|
||||
if (fwrite(octetstring_value(&data->fileData[i]),
|
||||
if (fwrite(octetstring_value((BACNET_OCTET_STRING*)&data->fileData[i]),
|
||||
octetstring_length(&data->fileData[i]), 1,
|
||||
pFile) != 1) {
|
||||
#if PRINT_ENABLED
|
||||
|
||||
@@ -110,7 +110,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_ack_stream_data(
|
||||
uint32_t instance,
|
||||
BACNET_ATOMIC_READ_FILE_DATA * data);
|
||||
const BACNET_ATOMIC_READ_FILE_DATA * data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_write_stream_data(
|
||||
BACNET_ATOMIC_WRITE_FILE_DATA * data);
|
||||
@@ -120,10 +120,10 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_read_ack_record_data(
|
||||
uint32_t instance,
|
||||
BACNET_ATOMIC_READ_FILE_DATA * data);
|
||||
const BACNET_ATOMIC_READ_FILE_DATA * data);
|
||||
BACNET_STACK_EXPORT
|
||||
bool bacfile_write_record_data(
|
||||
BACNET_ATOMIC_WRITE_FILE_DATA * data);
|
||||
const BACNET_ATOMIC_WRITE_FILE_DATA * data);
|
||||
|
||||
/* handling for read property service */
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -154,7 +154,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t bacfile_write(
|
||||
uint32_t object_instance,
|
||||
uint8_t *buffer,
|
||||
const uint8_t *buffer,
|
||||
uint32_t buffer_size);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
@@ -361,7 +361,7 @@ BACNET_RELIABILITY Binary_Input_Reliability(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return true the status flag is in Fault
|
||||
*/
|
||||
static bool Binary_Input_Object_Fault(struct object_data *pObject)
|
||||
static bool Binary_Input_Object_Fault(const struct object_data *pObject)
|
||||
{
|
||||
bool fault = false;
|
||||
|
||||
@@ -607,7 +607,7 @@ bool Binary_Input_Object_Name(
|
||||
* @param new_name - holds the object-name to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Binary_Input_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Input_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -682,17 +682,17 @@ bool Binary_Input_Polarity_Set(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Binary_Input_Description(uint32_t object_instance)
|
||||
const char *Binary_Input_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Binary_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description == NULL) {
|
||||
name = "";
|
||||
} else {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,7 +705,8 @@ char *Binary_Input_Description(uint32_t object_instance)
|
||||
* @param new_name - holds the description to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Binary_Input_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Input_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -725,14 +726,14 @@ bool Binary_Input_Description_Set(uint32_t object_instance, char *new_name)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return inactive-text property value
|
||||
*/
|
||||
char *Binary_Input_Inactive_Text(uint32_t object_instance)
|
||||
const char *Binary_Input_Inactive_Text(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Binary_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = (char *)pObject->Inactive_Text;
|
||||
name = pObject->Inactive_Text;
|
||||
}
|
||||
|
||||
return name;
|
||||
@@ -745,7 +746,8 @@ char *Binary_Input_Inactive_Text(uint32_t object_instance)
|
||||
* @param new_name - holds the inactive-text to be set
|
||||
* @return true if the inactive-text property value was set
|
||||
*/
|
||||
bool Binary_Input_Inactive_Text_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Input_Inactive_Text_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -765,14 +767,14 @@ bool Binary_Input_Inactive_Text_Set(uint32_t object_instance, char *new_name)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return active-text property value
|
||||
*/
|
||||
char *Binary_Input_Active_Text(uint32_t object_instance)
|
||||
const char *Binary_Input_Active_Text(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Binary_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = (char *)pObject->Active_Text;
|
||||
name = pObject->Active_Text;
|
||||
}
|
||||
|
||||
return name;
|
||||
@@ -785,7 +787,8 @@ char *Binary_Input_Active_Text(uint32_t object_instance)
|
||||
* @param new_name - holds the active-text to be set
|
||||
* @return true if the active-text property value was set
|
||||
*/
|
||||
bool Binary_Input_Active_Text_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Input_Active_Text_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -68,7 +68,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Input_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
@@ -82,12 +82,12 @@ extern "C" {
|
||||
BACNET_BINARY_PV value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Input_Description(
|
||||
const char *Binary_Input_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Description_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Binary_Input_Reliability(
|
||||
@@ -98,20 +98,20 @@ extern "C" {
|
||||
BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Input_Inactive_Text(
|
||||
const char *Binary_Input_Inactive_Text(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Inactive_Text_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Input_Active_Text(
|
||||
const char *Binary_Input_Active_Text(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Input_Active_Text_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_POLARITY Binary_Input_Polarity(
|
||||
|
||||
@@ -172,7 +172,7 @@ bool BitString_Value_Present_Value(
|
||||
* @return true if value is within range and copied
|
||||
*/
|
||||
bool BitString_Value_Present_Value_Set(
|
||||
uint32_t object_instance, BACNET_BIT_STRING *value)
|
||||
uint32_t object_instance, const BACNET_BIT_STRING *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -306,7 +306,7 @@ BACNET_RELIABILITY BitString_Value_Reliablity(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return true the status flag is in Fault
|
||||
*/
|
||||
static bool BitString_Value_Object_Fault(struct object_data *pObject)
|
||||
static bool BitString_Value_Object_Fault(const struct object_data *pObject)
|
||||
{
|
||||
bool fault = false;
|
||||
|
||||
@@ -460,7 +460,7 @@ bool BitString_Value_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool BitString_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool BitString_Value_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -498,15 +498,15 @@ const char *BitString_Value_Name_ASCII(uint32_t object_instance)
|
||||
* @return C-string pointer to the description,
|
||||
* or NULL if object doesn't exist
|
||||
*/
|
||||
char *BitString_Value_Description(uint32_t object_instance)
|
||||
const char *BitString_Value_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL; /* return value */
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL; /* return value */
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = BitString_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
} else {
|
||||
name = "";
|
||||
}
|
||||
@@ -525,7 +525,7 @@ char *BitString_Value_Description(uint32_t object_instance)
|
||||
* @return True on success, false otherwise.
|
||||
*/
|
||||
bool BitString_Value_Description_Set(
|
||||
uint32_t object_instance, char *value)
|
||||
uint32_t object_instance, const char *value)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -76,7 +76,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *BitString_Value_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
@@ -88,15 +88,15 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_BIT_STRING * value);
|
||||
const BACNET_BIT_STRING * value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *BitString_Value_Description(
|
||||
const char *BitString_Value_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Description_Set(
|
||||
uint32_t object_instance,
|
||||
char *text_string);
|
||||
const char *text_string);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool BitString_Value_Out_Of_Service(
|
||||
|
||||
@@ -171,7 +171,7 @@ unsigned Binary_Lighting_Output_Instance_To_Index(uint32_t object_instance)
|
||||
* @return the priority-array active status for the specific priority
|
||||
*/
|
||||
static bool Priority_Array_Active(
|
||||
struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
const struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
{
|
||||
bool active = false;
|
||||
|
||||
@@ -193,7 +193,7 @@ static bool Priority_Array_Active(
|
||||
* @return The priority-array value for the specific priority
|
||||
*/
|
||||
static BACNET_BINARY_LIGHTING_PV Priority_Array_Next_Value(
|
||||
struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
const struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
{
|
||||
BACNET_BINARY_LIGHTING_PV value = BINARY_LIGHTING_PV_OFF;
|
||||
unsigned p = 0;
|
||||
@@ -238,7 +238,7 @@ BACNET_BINARY_LIGHTING_PV Binary_Lighting_Output_Present_Value(
|
||||
* @return The priority-array value for the specific priority
|
||||
*/
|
||||
static BACNET_BINARY_LIGHTING_PV Priority_Array_Value(
|
||||
struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
const struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
{
|
||||
BACNET_BINARY_LIGHTING_PV value = BINARY_LIGHTING_PV_OFF;
|
||||
|
||||
@@ -290,7 +290,7 @@ static int Binary_Lighting_Output_Priority_Array_Encode(
|
||||
*
|
||||
* @return active priority 1..16, or 0 if no priority is active
|
||||
*/
|
||||
static unsigned Present_Value_Priority(struct object_data *pObject)
|
||||
static unsigned Present_Value_Priority(const struct object_data *pObject)
|
||||
{
|
||||
unsigned p = 0; /* loop counter */
|
||||
unsigned priority = 0; /* return value */
|
||||
@@ -787,7 +787,8 @@ bool Binary_Lighting_Output_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Binary_Lighting_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Lighting_Output_Name_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -826,15 +827,15 @@ const char *Binary_Lighting_Output_Name_ASCII(uint32_t object_instance)
|
||||
*
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Binary_Lighting_Output_Description(uint32_t object_instance)
|
||||
const char *Binary_Lighting_Output_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
} else {
|
||||
name = "";
|
||||
}
|
||||
@@ -852,7 +853,7 @@ char *Binary_Lighting_Output_Description(uint32_t object_instance)
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Binary_Lighting_Output_Description_Set(
|
||||
uint32_t object_instance, char *new_name)
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -84,14 +84,16 @@ BACNET_STACK_EXPORT
|
||||
bool Binary_Lighting_Output_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Lighting_Output_Name_Set(uint32_t object_instance, char *new_name);
|
||||
bool Binary_Lighting_Output_Name_Set(
|
||||
uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Lighting_Output_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Lighting_Output_Description(uint32_t instance);
|
||||
const char *Binary_Lighting_Output_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Lighting_Output_Description_Set(uint32_t instance, char *new_name);
|
||||
bool Binary_Lighting_Output_Description_Set(
|
||||
uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Lighting_Output_Out_Of_Service(uint32_t instance);
|
||||
|
||||
@@ -537,7 +537,7 @@ bool Binary_Output_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Binary_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Output_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -701,7 +701,7 @@ BACNET_RELIABILITY Binary_Output_Reliability(uint32_t object_instance)
|
||||
*
|
||||
* @return true the status flag is in Fault
|
||||
*/
|
||||
static bool Binary_Output_Object_Fault(struct object_data *pObject)
|
||||
static bool Binary_Output_Object_Fault(const struct object_data *pObject)
|
||||
{
|
||||
bool fault = false;
|
||||
|
||||
@@ -767,14 +767,14 @@ static bool Binary_Output_Fault(uint32_t object_instance)
|
||||
*
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Binary_Output_Description(uint32_t object_instance)
|
||||
const char *Binary_Output_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
}
|
||||
|
||||
return name;
|
||||
@@ -788,7 +788,8 @@ char *Binary_Output_Description(uint32_t object_instance)
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Binary_Output_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Output_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -809,14 +810,14 @@ bool Binary_Output_Description_Set(uint32_t object_instance, char *new_name)
|
||||
*
|
||||
* @return active text or NULL if not found
|
||||
*/
|
||||
char *Binary_Output_Active_Text(uint32_t object_instance)
|
||||
const char *Binary_Output_Active_Text(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = (char *)pObject->Active_Text;
|
||||
name = pObject->Active_Text;
|
||||
}
|
||||
|
||||
return name;
|
||||
@@ -830,7 +831,8 @@ char *Binary_Output_Active_Text(uint32_t object_instance)
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Binary_Output_Active_Text_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Output_Active_Text_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -851,14 +853,14 @@ bool Binary_Output_Active_Text_Set(uint32_t object_instance, char *new_name)
|
||||
*
|
||||
* @return active text or NULL if not found
|
||||
*/
|
||||
char *Binary_Output_Inactive_Text(uint32_t object_instance)
|
||||
const char *Binary_Output_Inactive_Text(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = (char *)pObject->Inactive_Text;
|
||||
name = pObject->Inactive_Text;
|
||||
}
|
||||
|
||||
return name;
|
||||
@@ -872,7 +874,8 @@ char *Binary_Output_Inactive_Text(uint32_t object_instance)
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Binary_Output_Inactive_Text_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Output_Inactive_Text_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -66,25 +66,25 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Output_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Output_Inactive_Text(
|
||||
const char *Binary_Output_Inactive_Text(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Inactive_Text_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Output_Active_Text(
|
||||
const char *Binary_Output_Active_Text(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Active_Text_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_BINARY_PV Binary_Output_Present_Value(
|
||||
@@ -115,12 +115,12 @@ extern "C" {
|
||||
bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Output_Description(
|
||||
const char *Binary_Output_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Output_Description_Set(
|
||||
uint32_t object_instance,
|
||||
char *text_string);
|
||||
const char *text_string);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_POLARITY Binary_Output_Polarity(
|
||||
|
||||
@@ -362,7 +362,7 @@ BACNET_RELIABILITY Binary_Value_Reliability(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return true the status flag is in Fault
|
||||
*/
|
||||
static bool Binary_Value_Object_Fault(struct object_data *pObject)
|
||||
static bool Binary_Value_Object_Fault(const struct object_data *pObject)
|
||||
{
|
||||
bool fault = false;
|
||||
|
||||
@@ -610,7 +610,7 @@ bool Binary_Value_Object_Name(
|
||||
* @param new_name - holds the object-name to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Binary_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Value_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -685,17 +685,17 @@ bool Binary_Value_Polarity_Set(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Binary_Value_Description(uint32_t object_instance)
|
||||
const char *Binary_Value_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Binary_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description == NULL) {
|
||||
name = "";
|
||||
} else {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,7 +708,8 @@ char *Binary_Value_Description(uint32_t object_instance)
|
||||
* @param new_name - holds the description to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Binary_Value_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Value_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -729,14 +730,14 @@ bool Binary_Value_Description_Set(uint32_t object_instance, char *new_name)
|
||||
*
|
||||
* @return active text or NULL if not found
|
||||
*/
|
||||
char *Binary_Value_Active_Text(uint32_t object_instance)
|
||||
const char *Binary_Value_Active_Text(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Binary_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = (char *)pObject->Active_Text;
|
||||
name = pObject->Active_Text;
|
||||
}
|
||||
|
||||
return name;
|
||||
@@ -750,7 +751,8 @@ char *Binary_Value_Active_Text(uint32_t object_instance)
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Binary_Value_Active_Text_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Value_Active_Text_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -771,14 +773,14 @@ bool Binary_Value_Active_Text_Set(uint32_t object_instance, char *new_name)
|
||||
*
|
||||
* @return active text or NULL if not found
|
||||
*/
|
||||
char *Binary_Value_Inactive_Text(uint32_t object_instance)
|
||||
const char *Binary_Value_Inactive_Text(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Binary_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = (char *)pObject->Inactive_Text;
|
||||
name = pObject->Inactive_Text;
|
||||
}
|
||||
|
||||
return name;
|
||||
@@ -792,7 +794,8 @@ char *Binary_Value_Inactive_Text(uint32_t object_instance)
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Binary_Value_Inactive_Text_Set(uint32_t object_instance, char *new_name)
|
||||
bool Binary_Value_Inactive_Text_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -71,7 +71,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Binary_Value_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
@@ -130,27 +130,27 @@ extern "C" {
|
||||
bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Value_Description(
|
||||
const char *Binary_Value_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Description_Set(
|
||||
uint32_t object_instance,
|
||||
char *text_string);
|
||||
const char *text_string);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Value_Inactive_Text(
|
||||
const char *Binary_Value_Inactive_Text(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Inactive_Text_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Binary_Value_Active_Text(
|
||||
const char *Binary_Value_Active_Text(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Binary_Value_Active_Text_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_POLARITY Binary_Value_Polarity(
|
||||
|
||||
@@ -239,7 +239,7 @@ Calendar_Date_List_Get(uint32_t object_instance, uint8_t index)
|
||||
* @return true if the entity is add successfully.
|
||||
*/
|
||||
bool Calendar_Date_List_Add(
|
||||
uint32_t object_instance, BACNET_CALENDAR_ENTRY *value)
|
||||
uint32_t object_instance, const BACNET_CALENDAR_ENTRY *value)
|
||||
{
|
||||
bool st = false;
|
||||
BACNET_CALENDAR_ENTRY *entry;
|
||||
@@ -403,7 +403,7 @@ bool Calendar_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Calendar_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Calendar_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -442,15 +442,15 @@ const char *Calendar_Name_ASCII(uint32_t object_instance)
|
||||
*
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Calendar_Description(uint32_t object_instance)
|
||||
const char *Calendar_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
} else {
|
||||
name = "";
|
||||
}
|
||||
@@ -467,7 +467,7 @@ char *Calendar_Description(uint32_t object_instance)
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Calendar_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Calendar_Description_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -47,7 +47,7 @@ BACNET_STACK_EXPORT
|
||||
bool Calendar_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Calendar_Name_Set(uint32_t object_instance, char *new_name);
|
||||
bool Calendar_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Calendar_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
@@ -68,7 +68,7 @@ BACNET_CALENDAR_ENTRY *Calendar_Date_List_Get(
|
||||
uint32_t object_instance, uint8_t index);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Calendar_Date_List_Add(
|
||||
uint32_t object_instance, BACNET_CALENDAR_ENTRY *value);
|
||||
uint32_t object_instance, const BACNET_CALENDAR_ENTRY *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Calendar_Date_List_Delete_All(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -78,9 +78,9 @@ int Calendar_Date_List_Encode(
|
||||
uint32_t object_instance, uint8_t *apdu, int max_apdu);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Calendar_Description(uint32_t object_instance);
|
||||
const char *Calendar_Description(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Calendar_Description_Set(uint32_t object_instance, char *new_name);
|
||||
bool Calendar_Description_Set(uint32_t object_instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Calendar_Write_Enabled(uint32_t instance);
|
||||
|
||||
@@ -99,7 +99,7 @@ void Channel_Property_Lists(
|
||||
*/
|
||||
bool Channel_Valid_Instance(uint32_t object_instance)
|
||||
{
|
||||
struct object_data *pObject;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
@@ -179,7 +179,7 @@ BACNET_CHANNEL_VALUE *Channel_Present_Value(uint32_t object_instance)
|
||||
unsigned Channel_Last_Priority(uint32_t object_instance)
|
||||
{
|
||||
unsigned priority = 0;
|
||||
struct object_data *pObject;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
@@ -199,7 +199,7 @@ unsigned Channel_Last_Priority(uint32_t object_instance)
|
||||
BACNET_WRITE_STATUS Channel_Write_Status(uint32_t object_instance)
|
||||
{
|
||||
BACNET_WRITE_STATUS write_status = BACNET_WRITE_STATUS_IDLE;
|
||||
struct object_data *pObject;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
@@ -219,7 +219,7 @@ BACNET_WRITE_STATUS Channel_Write_Status(uint32_t object_instance)
|
||||
uint16_t Channel_Number(uint32_t object_instance)
|
||||
{
|
||||
uint16_t value = 0;
|
||||
struct object_data *pObject;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
@@ -266,7 +266,7 @@ static int Channel_Reference_List_Member_Element_Encode(
|
||||
uint32_t object_instance, BACNET_ARRAY_INDEX array_index, uint8_t *apdu)
|
||||
{
|
||||
int apdu_len = BACNET_STATUS_ERROR;
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *value;
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *value;
|
||||
unsigned count = 0;
|
||||
|
||||
count = Channel_Reference_List_Member_Count(object_instance);
|
||||
@@ -287,7 +287,7 @@ static int Channel_Reference_List_Member_Element_Encode(
|
||||
* @return member count
|
||||
*/
|
||||
static bool Channel_Reference_List_Member_Valid(
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMember)
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMember)
|
||||
{
|
||||
bool status = false;
|
||||
|
||||
@@ -348,7 +348,7 @@ BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *Channel_Reference_List_Member_Element(
|
||||
*/
|
||||
bool Channel_Reference_List_Member_Element_Set(uint32_t object_instance,
|
||||
unsigned array_index,
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMemberSrc)
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMemberSrc)
|
||||
{
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMember = NULL;
|
||||
bool status = false;
|
||||
@@ -378,7 +378,7 @@ bool Channel_Reference_List_Member_Element_Set(uint32_t object_instance,
|
||||
* zero if not added
|
||||
*/
|
||||
unsigned Channel_Reference_List_Member_Element_Add(uint32_t object_instance,
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMemberSrc)
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMemberSrc)
|
||||
{
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMember = NULL;
|
||||
unsigned array_index = 0;
|
||||
@@ -414,7 +414,7 @@ uint16_t Channel_Control_Groups_Element(
|
||||
uint32_t object_instance, int32_t array_index)
|
||||
{
|
||||
uint16_t value = 0;
|
||||
struct object_data *pObject;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
@@ -469,7 +469,7 @@ static int Channel_Control_Groups_Element_Encode(
|
||||
{
|
||||
int apdu_len = BACNET_STATUS_ERROR;
|
||||
uint16_t value = 1;
|
||||
struct object_data *pObject;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject && (array_index < CONTROL_GROUPS_MAX)) {
|
||||
@@ -490,7 +490,7 @@ static int Channel_Control_Groups_Element_Encode(
|
||||
* @return true if values are able to be copied
|
||||
*/
|
||||
bool Channel_Value_Copy(
|
||||
BACNET_CHANNEL_VALUE *cvalue, BACNET_APPLICATION_DATA_VALUE *value)
|
||||
BACNET_CHANNEL_VALUE *cvalue, const BACNET_APPLICATION_DATA_VALUE *value)
|
||||
{
|
||||
bool status = false;
|
||||
|
||||
@@ -631,7 +631,7 @@ bool Channel_Value_Copy(
|
||||
* @return number of bytes in the APDU, or BACNET_STATUS_ERROR
|
||||
*/
|
||||
int Channel_Value_Encode(
|
||||
uint8_t *apdu, int apdu_max, BACNET_CHANNEL_VALUE *value)
|
||||
uint8_t *apdu, int apdu_max, const BACNET_CHANNEL_VALUE *value)
|
||||
{
|
||||
int apdu_len = BACNET_STATUS_ERROR;
|
||||
|
||||
@@ -743,7 +743,7 @@ int Channel_Value_Encode(
|
||||
* @return number of bytes in the APDU, or BACNET_STATUS_ERROR if error.
|
||||
*/
|
||||
static int Coerce_Data_Encode(uint8_t *apdu,
|
||||
BACNET_APPLICATION_DATA_VALUE *value,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value,
|
||||
BACNET_APPLICATION_TAG tag)
|
||||
{
|
||||
int apdu_len = 0; /* total length of the apdu, return value */
|
||||
@@ -1060,7 +1060,7 @@ static int Coerce_Data_Encode(uint8_t *apdu,
|
||||
*/
|
||||
int Channel_Coerce_Data_Encode(uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_APPLICATION_DATA_VALUE *value,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value,
|
||||
BACNET_APPLICATION_TAG tag)
|
||||
{
|
||||
int len;
|
||||
@@ -1084,7 +1084,7 @@ int Channel_Coerce_Data_Encode(uint8_t *apdu,
|
||||
* @return true if values are within range and present-value is sent.
|
||||
*/
|
||||
bool Channel_Write_Member_Value(
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data, BACNET_APPLICATION_DATA_VALUE *value)
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data, const BACNET_APPLICATION_DATA_VALUE *value)
|
||||
{
|
||||
bool status = false;
|
||||
int apdu_len = 0;
|
||||
@@ -1191,13 +1191,13 @@ bool Channel_Write_Member_Value(
|
||||
* @return true if values are within range and present-value is sent.
|
||||
*/
|
||||
static bool Channel_Write_Members(struct object_data *pObject,
|
||||
BACNET_APPLICATION_DATA_VALUE *value,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value,
|
||||
uint8_t priority)
|
||||
{
|
||||
BACNET_WRITE_PROPERTY_DATA wp_data = { 0 };
|
||||
bool status = false;
|
||||
unsigned m = 0;
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMember = NULL;
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMember = NULL;
|
||||
|
||||
if (pObject && value) {
|
||||
pObject->Write_Status = BACNET_WRITE_STATUS_IN_PROGRESS;
|
||||
@@ -1244,7 +1244,7 @@ static bool Channel_Write_Members(struct object_data *pObject,
|
||||
* @return true if values are within range and present-value is sent.
|
||||
*/
|
||||
bool Channel_Present_Value_Set(
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data, BACNET_APPLICATION_DATA_VALUE *value)
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data, const BACNET_APPLICATION_DATA_VALUE *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -1291,7 +1291,7 @@ bool Channel_Object_Name(
|
||||
{
|
||||
bool status = false;
|
||||
char name_text[24] = "CHANNEL-4194303";
|
||||
struct object_data *pObject;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
@@ -1316,7 +1316,7 @@ bool Channel_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Channel_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Channel_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -1359,7 +1359,7 @@ const char *Channel_Name_ASCII(uint32_t object_instance)
|
||||
bool Channel_Out_Of_Service(uint32_t object_instance)
|
||||
{
|
||||
bool value = false;
|
||||
struct object_data *pObject;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
@@ -1402,7 +1402,7 @@ int Channel_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
int apdu_len = 0; /* return value */
|
||||
BACNET_BIT_STRING bit_string;
|
||||
BACNET_CHARACTER_STRING char_string;
|
||||
BACNET_CHANNEL_VALUE *cvalue = NULL;
|
||||
const BACNET_CHANNEL_VALUE *cvalue = NULL;
|
||||
uint32_t unsigned_value = 0;
|
||||
unsigned count = 0;
|
||||
bool state = false;
|
||||
|
||||
@@ -119,7 +119,7 @@ BACNET_STACK_EXPORT
|
||||
bool Channel_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Channel_Name_Set(uint32_t object_instance, char *new_name);
|
||||
bool Channel_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Channel_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
@@ -132,7 +132,7 @@ BACNET_STACK_EXPORT
|
||||
BACNET_CHANNEL_VALUE *Channel_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Channel_Present_Value_Set(
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data, BACNET_APPLICATION_DATA_VALUE *value);
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data, const BACNET_APPLICATION_DATA_VALUE *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Channel_Out_Of_Service(uint32_t object_instance);
|
||||
@@ -155,10 +155,10 @@ BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *Channel_Reference_List_Member_Element(
|
||||
BACNET_STACK_EXPORT
|
||||
bool Channel_Reference_List_Member_Element_Set(uint32_t object_instance,
|
||||
unsigned array_index,
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMemberSrc);
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMemberSrc);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Channel_Reference_List_Member_Element_Add(uint32_t object_instance,
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMemberSrc);
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *pMemberSrc);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Channel_Control_Groups_Element(
|
||||
uint32_t object_instance, int32_t array_index);
|
||||
@@ -167,18 +167,18 @@ bool Channel_Control_Groups_Element_Set(
|
||||
uint32_t object_instance, int32_t array_index, uint16_t value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Channel_Value_Copy(
|
||||
BACNET_CHANNEL_VALUE *cvalue, BACNET_APPLICATION_DATA_VALUE *value);
|
||||
BACNET_CHANNEL_VALUE *cvalue, const BACNET_APPLICATION_DATA_VALUE *value);
|
||||
BACNET_STACK_EXPORT
|
||||
int Channel_Value_Encode(
|
||||
uint8_t *apdu, int apdu_max, BACNET_CHANNEL_VALUE *value);
|
||||
uint8_t *apdu, int apdu_max, const BACNET_CHANNEL_VALUE *value);
|
||||
BACNET_STACK_EXPORT
|
||||
int Channel_Coerce_Data_Encode(uint8_t *apdu,
|
||||
size_t apdu_size,
|
||||
BACNET_APPLICATION_DATA_VALUE *value,
|
||||
const BACNET_APPLICATION_DATA_VALUE *value,
|
||||
BACNET_APPLICATION_TAG tag);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Channel_Write_Member_Value(
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data, BACNET_APPLICATION_DATA_VALUE *value);
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data, const BACNET_APPLICATION_DATA_VALUE *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Channel_Write_Property_Internal_Callback_Set(
|
||||
|
||||
@@ -383,7 +383,7 @@ bool Device_Object_Name(
|
||||
return status;
|
||||
}
|
||||
|
||||
bool Device_Set_Object_Name(BACNET_CHARACTER_STRING *object_name)
|
||||
bool Device_Set_Object_Name(const BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
bool status = false; /*return value */
|
||||
|
||||
@@ -724,7 +724,7 @@ int Device_Object_List_Element_Encode(
|
||||
* Object.
|
||||
* @return True on success or else False if not found.
|
||||
*/
|
||||
bool Device_Valid_Object_Name(BACNET_CHARACTER_STRING *object_name1,
|
||||
bool Device_Valid_Object_Name(const BACNET_CHARACTER_STRING *object_name1,
|
||||
BACNET_OBJECT_TYPE *object_type,
|
||||
uint32_t *object_instance)
|
||||
{
|
||||
|
||||
@@ -188,7 +188,7 @@ bool Color_Present_Value(uint32_t object_instance, BACNET_XY_COLOR *value)
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
bool Color_Present_Value_Set(uint32_t object_instance, BACNET_XY_COLOR *value)
|
||||
bool Color_Present_Value_Set(uint32_t object_instance, const BACNET_XY_COLOR *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -214,7 +214,7 @@ bool Color_Present_Value_Set(uint32_t object_instance, BACNET_XY_COLOR *value)
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Present_Value_Write(uint32_t object_instance,
|
||||
BACNET_XY_COLOR *value,
|
||||
const BACNET_XY_COLOR *value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
@@ -273,7 +273,8 @@ bool Color_Tracking_Value(uint32_t object_instance, BACNET_XY_COLOR *value)
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
bool Color_Tracking_Value_Set(uint32_t object_instance, BACNET_XY_COLOR *value)
|
||||
bool Color_Tracking_Value_Set(
|
||||
uint32_t object_instance, const BACNET_XY_COLOR *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -315,7 +316,8 @@ bool Color_Command(uint32_t object_instance, BACNET_COLOR_COMMAND *value)
|
||||
* @param value - color command data
|
||||
* @return true if values are within range and value is set.
|
||||
*/
|
||||
bool Color_Command_Set(uint32_t object_instance, BACNET_COLOR_COMMAND *value)
|
||||
bool Color_Command_Set(
|
||||
uint32_t object_instance, const BACNET_COLOR_COMMAND *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -341,7 +343,7 @@ bool Color_Command_Set(uint32_t object_instance, BACNET_COLOR_COMMAND *value)
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Command_Write(uint32_t object_instance,
|
||||
BACNET_COLOR_COMMAND *value,
|
||||
const BACNET_COLOR_COMMAND *value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
@@ -440,7 +442,8 @@ bool Color_Default_Color(uint32_t object_instance, BACNET_XY_COLOR *value)
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
bool Color_Default_Color_Set(uint32_t object_instance, BACNET_XY_COLOR *value)
|
||||
bool Color_Default_Color_Set(
|
||||
uint32_t object_instance, const BACNET_XY_COLOR *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -466,7 +469,7 @@ bool Color_Default_Color_Set(uint32_t object_instance, BACNET_XY_COLOR *value)
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
static bool Color_Default_Color_Write(uint32_t object_instance,
|
||||
BACNET_XY_COLOR *value,
|
||||
const BACNET_XY_COLOR *value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
@@ -708,7 +711,7 @@ bool Color_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Color_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Color_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -747,15 +750,15 @@ const char *Color_Name_ASCII(uint32_t object_instance)
|
||||
*
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Color_Description(uint32_t object_instance)
|
||||
const char *Color_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
} else {
|
||||
name = "";
|
||||
}
|
||||
@@ -772,7 +775,7 @@ char *Color_Description(uint32_t object_instance)
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Color_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Color_Description_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -987,7 +990,7 @@ bool Color_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
int len = 0;
|
||||
BACNET_APPLICATION_DATA_VALUE value;
|
||||
int apdu_size = 0;
|
||||
uint8_t *apdu = NULL;
|
||||
const uint8_t *apdu = NULL;
|
||||
|
||||
/* decode the some of the request */
|
||||
apdu = wp_data->application_data;
|
||||
|
||||
@@ -48,7 +48,7 @@ BACNET_STACK_EXPORT
|
||||
bool Color_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Name_Set(uint32_t object_instance, char *new_name);
|
||||
bool Color_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Color_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
@@ -59,7 +59,8 @@ BACNET_STACK_EXPORT
|
||||
bool Color_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Present_Value_Set(uint32_t object_instance, BACNET_XY_COLOR *value);
|
||||
bool Color_Present_Value_Set(
|
||||
uint32_t object_instance, const BACNET_XY_COLOR *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Present_Value(uint32_t object_instance, BACNET_XY_COLOR *value);
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -67,17 +68,20 @@ void Color_Write_Present_Value_Callback_Set(
|
||||
color_write_present_value_callback cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Tracking_Value_Set(uint32_t object_instance, BACNET_XY_COLOR *value);
|
||||
bool Color_Tracking_Value_Set(
|
||||
uint32_t object_instance, const BACNET_XY_COLOR *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Tracking_Value(uint32_t object_instance, BACNET_XY_COLOR *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Command(uint32_t object_instance, BACNET_COLOR_COMMAND *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Command_Set(uint32_t object_instance, BACNET_COLOR_COMMAND *value);
|
||||
bool Color_Command_Set(
|
||||
uint32_t object_instance, const BACNET_COLOR_COMMAND *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Default_Color_Set(uint32_t object_instance, BACNET_XY_COLOR *value);
|
||||
bool Color_Default_Color_Set(
|
||||
uint32_t object_instance, const BACNET_XY_COLOR *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Default_Color(uint32_t object_instance, BACNET_XY_COLOR *value);
|
||||
|
||||
@@ -99,9 +103,9 @@ bool Color_Transition_Set(
|
||||
uint32_t object_instance, BACNET_COLOR_TRANSITION value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Color_Description(uint32_t instance);
|
||||
const char *Color_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Description_Set(uint32_t instance, char *new_name);
|
||||
bool Color_Description_Set(uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Write_Enabled(uint32_t instance);
|
||||
|
||||
@@ -410,7 +410,7 @@ bool Color_Temperature_Command(
|
||||
* @return true if values are within range and value is set.
|
||||
*/
|
||||
bool Color_Temperature_Command_Set(
|
||||
uint32_t object_instance, BACNET_COLOR_COMMAND *value)
|
||||
uint32_t object_instance, const BACNET_COLOR_COMMAND *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -945,7 +945,7 @@ bool Color_Temperature_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Color_Temperature_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Color_Temperature_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -984,15 +984,15 @@ const char *Color_Temperature_Name_ASCII(uint32_t object_instance)
|
||||
*
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Color_Temperature_Description(uint32_t object_instance)
|
||||
const char *Color_Temperature_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
} else {
|
||||
name = "";
|
||||
}
|
||||
@@ -1009,7 +1009,8 @@ char *Color_Temperature_Description(uint32_t object_instance)
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Color_Temperature_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Color_Temperature_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -1406,7 +1407,7 @@ bool Color_Temperature_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
int len = 0;
|
||||
BACNET_APPLICATION_DATA_VALUE value;
|
||||
int apdu_size = 0;
|
||||
uint8_t *apdu = NULL;
|
||||
const uint8_t *apdu = NULL;
|
||||
|
||||
/* decode the some of the request */
|
||||
apdu = wp_data->application_data;
|
||||
|
||||
@@ -45,7 +45,8 @@ BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_Name_Set(uint32_t object_instance, char *new_name);
|
||||
bool Color_Temperature_Name_Set(
|
||||
uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Color_Temperature_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
@@ -87,7 +88,7 @@ bool Color_Temperature_Command(
|
||||
uint32_t object_instance, BACNET_COLOR_COMMAND *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_Command_Set(
|
||||
uint32_t object_instance, BACNET_COLOR_COMMAND *value);
|
||||
uint32_t object_instance, const BACNET_COLOR_COMMAND *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_Default_Color_Temperature_Set(
|
||||
@@ -129,9 +130,10 @@ bool Color_Temperature_Transition_Set(
|
||||
uint32_t object_instance, BACNET_COLOR_TRANSITION value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Color_Temperature_Description(uint32_t instance);
|
||||
const char *Color_Temperature_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_Description_Set(uint32_t instance, char *new_name);
|
||||
bool Color_Temperature_Description_Set(
|
||||
uint32_t instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Color_Temperature_Write_Enabled(uint32_t instance);
|
||||
|
||||
@@ -72,7 +72,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Command_Description_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Command_Read_Property(
|
||||
|
||||
@@ -186,7 +186,7 @@ bool CharacterString_Value_Present_Value(
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
bool CharacterString_Value_Present_Value_Set(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name)
|
||||
uint32_t object_instance, const BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
bool status = false;
|
||||
unsigned index = 0; /* offset from instance lookup */
|
||||
@@ -332,7 +332,7 @@ static char *CharacterString_Value_Description(uint32_t object_instance)
|
||||
* @return True on success, false otherwise.
|
||||
*/
|
||||
bool CharacterString_Value_Description_Set(
|
||||
uint32_t object_instance, char *new_descr)
|
||||
uint32_t object_instance, const char *new_descr)
|
||||
{
|
||||
unsigned index = 0; /* offset from instance lookup */
|
||||
size_t i = 0; /* loop counter */
|
||||
@@ -390,7 +390,8 @@ bool CharacterString_Value_Object_Name(
|
||||
*
|
||||
* @return True on success, false otherwise.
|
||||
*/
|
||||
bool CharacterString_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool CharacterString_Value_Name_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
unsigned index = 0; /* offset from instance lookup */
|
||||
size_t i = 0; /* loop counter */
|
||||
|
||||
@@ -59,7 +59,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Present_Value(
|
||||
@@ -68,11 +68,11 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Present_Value_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_CHARACTER_STRING * value);
|
||||
const BACNET_CHARACTER_STRING * value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Description_Set(
|
||||
uint32_t object_instance,
|
||||
char *text_string);
|
||||
const char *text_string);
|
||||
BACNET_STACK_EXPORT
|
||||
bool CharacterString_Value_Out_Of_Service(
|
||||
uint32_t object_instance);
|
||||
|
||||
@@ -574,7 +574,7 @@ bool Device_Objects_Property_List_Member(
|
||||
static uint32_t Object_Instance_Number = 260001;
|
||||
static BACNET_CHARACTER_STRING My_Object_Name;
|
||||
static BACNET_DEVICE_STATUS System_Status = STATUS_OPERATIONAL;
|
||||
static char *Vendor_Name = BACNET_VENDOR_NAME;
|
||||
static const char *Vendor_Name = BACNET_VENDOR_NAME;
|
||||
static uint16_t Vendor_Identifier = BACNET_VENDOR_ID;
|
||||
static char Model_Name[MAX_DEV_MOD_LEN + 1] = "GNU";
|
||||
static char Application_Software_Version[MAX_DEV_VER_LEN + 1] = "1.0";
|
||||
@@ -783,7 +783,7 @@ bool Device_Object_Name(
|
||||
return status;
|
||||
}
|
||||
|
||||
bool Device_Set_Object_Name(BACNET_CHARACTER_STRING *object_name)
|
||||
bool Device_Set_Object_Name(const BACNET_CHARACTER_STRING *object_name)
|
||||
{
|
||||
bool status = false; /*return value */
|
||||
|
||||
@@ -1124,7 +1124,7 @@ int Device_Object_List_Element_Encode(
|
||||
* Object.
|
||||
* @return True on success or else False if not found.
|
||||
*/
|
||||
bool Device_Valid_Object_Name(BACNET_CHARACTER_STRING *object_name1,
|
||||
bool Device_Valid_Object_Name(const BACNET_CHARACTER_STRING *object_name1,
|
||||
BACNET_OBJECT_TYPE *object_type,
|
||||
uint32_t *object_instance)
|
||||
{
|
||||
@@ -1519,7 +1519,7 @@ int Device_Read_Property_Local(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
* @return The length of the APDU on success, else BACNET_STATUS_ERROR
|
||||
*/
|
||||
static int Read_Property_Common(
|
||||
struct object_functions *pObject, BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
const struct object_functions *pObject, BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
{
|
||||
int apdu_len = BACNET_STATUS_ERROR;
|
||||
BACNET_CHARACTER_STRING char_string;
|
||||
@@ -1852,7 +1852,7 @@ static bool Device_Write_Property_Object_Name(
|
||||
BACNET_OBJECT_TYPE object_type = OBJECT_NONE;
|
||||
uint32_t object_instance = 0;
|
||||
int apdu_size = 0;
|
||||
uint8_t *apdu = NULL;
|
||||
const uint8_t *apdu = NULL;
|
||||
|
||||
if (!wp_data) {
|
||||
return false;
|
||||
|
||||
@@ -312,7 +312,7 @@ extern "C" {
|
||||
void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_UUID_Set(
|
||||
uint8_t *new_uuid,
|
||||
const uint8_t *new_uuid,
|
||||
size_t length);
|
||||
BACNET_STACK_EXPORT
|
||||
void Device_UUID_Get(
|
||||
@@ -353,7 +353,7 @@ extern "C" {
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Set_Object_Name(
|
||||
BACNET_CHARACTER_STRING * object_name);
|
||||
const BACNET_CHARACTER_STRING * object_name);
|
||||
/* Copy a child object name, given its ID. */
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Object_Name_Copy(
|
||||
@@ -443,7 +443,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Device_Valid_Object_Name(
|
||||
BACNET_CHARACTER_STRING * object_name,
|
||||
const BACNET_CHARACTER_STRING * object_name,
|
||||
BACNET_OBJECT_TYPE *object_type,
|
||||
uint32_t * object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -498,7 +498,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Add_Routed_Device(
|
||||
uint32_t Object_Instance,
|
||||
BACNET_CHARACTER_STRING * Object_Name,
|
||||
const BACNET_CHARACTER_STRING * Object_Name,
|
||||
const char *Description);
|
||||
BACNET_STACK_EXPORT
|
||||
DEVICE_OBJECT_DATA *Get_Routed_Device_Object(
|
||||
@@ -511,16 +511,16 @@ extern "C" {
|
||||
bool Routed_Device_Address_Lookup(
|
||||
int idx,
|
||||
uint8_t address_len,
|
||||
uint8_t * mac_adress);
|
||||
const uint8_t * mac_adress);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_GetNext(
|
||||
BACNET_ADDRESS * dest,
|
||||
int *DNET_list,
|
||||
const BACNET_ADDRESS * dest,
|
||||
const int *DNET_list,
|
||||
int *cursor);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Routed_Device_Is_Valid_Network(
|
||||
uint16_t dest_net,
|
||||
int *DNET_list);
|
||||
const int *DNET_list);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Routed_Device_Index_To_Instance(
|
||||
|
||||
@@ -89,7 +89,7 @@ uint16_t iCurrent_Device_Idx = 0;
|
||||
* there isn't enough room to add this Device.
|
||||
*/
|
||||
uint16_t Add_Routed_Device(uint32_t Object_Instance,
|
||||
BACNET_CHARACTER_STRING *sObject_Name,
|
||||
const BACNET_CHARACTER_STRING *sObject_Name,
|
||||
const char *sDescription)
|
||||
{
|
||||
int i = Num_Managed_Devices;
|
||||
@@ -192,7 +192,7 @@ void routed_get_my_address(BACNET_ADDRESS *my_address)
|
||||
* meaning MAC broadcast, so it's an automatic match).
|
||||
* Else False if no match or invalid idx is given.
|
||||
*/
|
||||
bool Routed_Device_Address_Lookup(int idx, uint8_t dlen, uint8_t *dadr)
|
||||
bool Routed_Device_Address_Lookup(int idx, uint8_t dlen, const uint8_t *dadr)
|
||||
{
|
||||
bool result = false;
|
||||
DEVICE_OBJECT_DATA *pDev;
|
||||
@@ -245,7 +245,8 @@ bool Routed_Device_Address_Lookup(int idx, uint8_t dlen, uint8_t *dadr)
|
||||
* match). Else False if no match or invalid idx is given; the cursor will be
|
||||
* returned as -1 in these cases.
|
||||
*/
|
||||
bool Routed_Device_GetNext(BACNET_ADDRESS *dest, int *DNET_list, int *cursor)
|
||||
bool Routed_Device_GetNext(
|
||||
const BACNET_ADDRESS *dest, const int *DNET_list, int *cursor)
|
||||
{
|
||||
int dnet = DNET_list[0]; /* Get the DNET of our virtual network */
|
||||
int idx = *cursor;
|
||||
@@ -315,7 +316,7 @@ bool Routed_Device_GetNext(BACNET_ADDRESS *dest, int *DNET_list, int *cursor)
|
||||
* Device (the gateway), or is BACNET_BROADCAST_NETWORK,
|
||||
* which is an automatic match. Else False if not a reachable network.
|
||||
*/
|
||||
bool Routed_Device_Is_Valid_Network(uint16_t dest_net, int *DNET_list)
|
||||
bool Routed_Device_Is_Valid_Network(uint16_t dest_net, const int *DNET_list)
|
||||
{
|
||||
int dnet = DNET_list[0]; /* Get the DNET of our virtual network */
|
||||
bool bSuccess = false;
|
||||
|
||||
@@ -259,7 +259,7 @@ bool Load_Control_Object_Name(
|
||||
* @param new_name - holds the object-name to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Load_Control_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Load_Control_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -359,7 +359,8 @@ static float Requested_Shed_Level_Value(struct object_data *pObject)
|
||||
* @param dest - destination data
|
||||
* @param src - source data
|
||||
*/
|
||||
static void Shed_Level_Copy(BACNET_SHED_LEVEL *dest, BACNET_SHED_LEVEL *src)
|
||||
static void Shed_Level_Copy(
|
||||
BACNET_SHED_LEVEL *dest, const BACNET_SHED_LEVEL *src)
|
||||
{
|
||||
if (dest && src) {
|
||||
dest->type = src->type;
|
||||
@@ -445,7 +446,7 @@ static bool Able_To_Meet_Shed_Request(struct object_data *pObject)
|
||||
* @param object_index - object index in the list
|
||||
* @param bdatetime - current date and time
|
||||
*/
|
||||
void Load_Control_State_Machine(int object_index, BACNET_DATE_TIME *bdatetime)
|
||||
void Load_Control_State_Machine(int object_index, const BACNET_DATE_TIME *bdatetime)
|
||||
{
|
||||
int diff = 0; /* used for datetime comparison */
|
||||
float amount;
|
||||
@@ -799,7 +800,7 @@ bool Load_Control_Manipulated_Variable_Reference(
|
||||
*/
|
||||
bool Load_Control_Manipulated_Variable_Reference_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_OBJECT_PROPERTY_REFERENCE *object_property_reference)
|
||||
const BACNET_OBJECT_PROPERTY_REFERENCE *object_property_reference)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -908,7 +909,8 @@ static int Load_Control_Shed_Level_Descriptions_Encode(
|
||||
* @param value [in] The value to encode
|
||||
* @return The length of the apdu encoded
|
||||
*/
|
||||
static int BACnet_Shed_Level_Encode(uint8_t *apdu, BACNET_SHED_LEVEL *value)
|
||||
static int BACnet_Shed_Level_Encode(
|
||||
uint8_t *apdu, const BACNET_SHED_LEVEL *value)
|
||||
{
|
||||
int apdu_len = 0;
|
||||
|
||||
@@ -1095,7 +1097,7 @@ int Load_Control_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
*/
|
||||
static bool Load_Control_Requested_Shed_Level_Write(
|
||||
uint32_t object_instance,
|
||||
BACNET_SHED_LEVEL *value,
|
||||
const BACNET_SHED_LEVEL *value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
@@ -1188,7 +1190,7 @@ static bool Load_Control_Requested_Shed_Level_Write(
|
||||
*/
|
||||
static bool Load_Control_Start_Time_Write(
|
||||
uint32_t object_instance,
|
||||
BACNET_DATE_TIME *value,
|
||||
const BACNET_DATE_TIME *value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
@@ -1602,7 +1604,7 @@ void Load_Control_Manipulated_Object_Read_Callback_Set(
|
||||
bool Load_Control_Shed_Level_Array_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t array_index,
|
||||
struct shed_level_data *value)
|
||||
const struct shed_level_data *value)
|
||||
{
|
||||
int key_index;
|
||||
struct shed_level_data *entry;
|
||||
|
||||
@@ -92,7 +92,7 @@ BACNET_STACK_EXPORT
|
||||
bool Load_Control_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Load_Control_Name_Set(uint32_t object_instance, char *new_name);
|
||||
bool Load_Control_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Load_Control_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
@@ -103,7 +103,7 @@ BACNET_STACK_EXPORT
|
||||
bool Load_Control_Shed_Level_Array_Set(
|
||||
uint32_t object_instance,
|
||||
uint32_t array_index,
|
||||
struct shed_level_data *value);
|
||||
const struct shed_level_data *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Load_Control_Shed_Level_Array(
|
||||
uint32_t object_instance,
|
||||
@@ -133,7 +133,7 @@ bool Load_Control_Manipulated_Variable_Reference(
|
||||
BACNET_STACK_EXPORT
|
||||
bool Load_Control_Manipulated_Variable_Reference_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_OBJECT_PROPERTY_REFERENCE *object_property_reference);
|
||||
const BACNET_OBJECT_PROPERTY_REFERENCE *object_property_reference);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Load_Control_Manipulated_Object_Write_Callback_Set(
|
||||
@@ -158,7 +158,7 @@ bool Load_Control_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
/* functions used for unit testing */
|
||||
BACNET_STACK_EXPORT
|
||||
void Load_Control_State_Machine(int object_index, BACNET_DATE_TIME *bdatetime);
|
||||
void Load_Control_State_Machine(int object_index, const BACNET_DATE_TIME *bdatetime);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -198,7 +198,8 @@ unsigned Lighting_Output_Instance_To_Index(uint32_t object_instance)
|
||||
* @return the priority-array active status for the specific priority
|
||||
*/
|
||||
static bool
|
||||
Priority_Array_Active(struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
Priority_Array_Active(
|
||||
const struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
{
|
||||
bool active = false;
|
||||
|
||||
@@ -219,7 +220,8 @@ Priority_Array_Active(struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
* @return The priority-array value for the specific priority
|
||||
*/
|
||||
static float
|
||||
Priority_Array_Value(struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
Priority_Array_Value(
|
||||
const struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
{
|
||||
float real_value = 0.0;
|
||||
|
||||
@@ -241,7 +243,7 @@ Priority_Array_Value(struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
* @return The priority-array value for the specific priority
|
||||
*/
|
||||
static float Priority_Array_Next_Value(
|
||||
struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
const struct object_data *pObject, BACNET_ARRAY_INDEX priority)
|
||||
{
|
||||
float real_value = 0.0;
|
||||
unsigned p = 0;
|
||||
@@ -316,7 +318,7 @@ static int Lighting_Output_Priority_Array_Encode(
|
||||
*
|
||||
* @return active priority 1..16, or 0 if no priority is active
|
||||
*/
|
||||
static unsigned Present_Value_Priority(struct object_data *pObject)
|
||||
static unsigned Present_Value_Priority(const struct object_data *pObject)
|
||||
{
|
||||
unsigned p = 0; /* loop counter */
|
||||
unsigned priority = 0; /* return value */
|
||||
@@ -837,7 +839,7 @@ bool Lighting_Output_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Lighting_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Lighting_Output_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -876,15 +878,15 @@ const char *Lighting_Output_Name_ASCII(uint32_t object_instance)
|
||||
*
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Lighting_Output_Description(uint32_t object_instance)
|
||||
const char *Lighting_Output_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
} else {
|
||||
name = "";
|
||||
}
|
||||
@@ -901,7 +903,8 @@ char *Lighting_Output_Description(uint32_t object_instance)
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Lighting_Output_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Lighting_Output_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -924,7 +927,7 @@ bool Lighting_Output_Description_Set(uint32_t object_instance, char *new_name)
|
||||
* @return true if lighting command was set
|
||||
*/
|
||||
bool Lighting_Output_Lighting_Command_Set(
|
||||
uint32_t object_instance, BACNET_LIGHTING_COMMAND *value)
|
||||
uint32_t object_instance, const BACNET_LIGHTING_COMMAND *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -970,7 +973,7 @@ Lighting_Command_Stop(struct object_data *pObject, unsigned priority)
|
||||
*/
|
||||
static bool Lighting_Output_Lighting_Command_Write(
|
||||
uint32_t object_instance,
|
||||
BACNET_LIGHTING_COMMAND *value,
|
||||
const BACNET_LIGHTING_COMMAND *value,
|
||||
uint8_t priority,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
@@ -1858,7 +1861,7 @@ bool Lighting_Output_Color_Reference(
|
||||
* @return true if property value was set
|
||||
*/
|
||||
bool Lighting_Output_Color_Reference_Set(
|
||||
uint32_t object_instance, BACNET_OBJECT_ID *value)
|
||||
uint32_t object_instance, const BACNET_OBJECT_ID *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -1922,7 +1925,7 @@ bool Lighting_Output_Override_Color_Reference(
|
||||
* @return true if property value was set
|
||||
*/
|
||||
bool Lighting_Output_Override_Color_Reference_Set(
|
||||
uint32_t object_instance, BACNET_OBJECT_ID *value)
|
||||
uint32_t object_instance, const BACNET_OBJECT_ID *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -99,18 +99,18 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Lighting_Output_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Lighting_Output_Description(
|
||||
const char *Lighting_Output_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Description_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Out_Of_Service(
|
||||
@@ -123,7 +123,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Lighting_Command_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_LIGHTING_COMMAND *value);
|
||||
const BACNET_LIGHTING_COMMAND *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Lighting_Command(
|
||||
uint32_t object_instance,
|
||||
@@ -219,7 +219,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Color_Reference_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_OBJECT_ID *value);
|
||||
const BACNET_OBJECT_ID *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Override_Color_Reference(
|
||||
@@ -228,7 +228,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Lighting_Output_Override_Color_Reference_Set(
|
||||
uint32_t object_instance,
|
||||
BACNET_OBJECT_ID *value);
|
||||
const BACNET_OBJECT_ID *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Lighting_Output_Timer(
|
||||
|
||||
@@ -507,7 +507,7 @@ static int Life_Safety_Zone_Members_Encode(
|
||||
*/
|
||||
bool Life_Safety_Zone_Members_Add(
|
||||
uint32_t object_instance,
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *data)
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *data)
|
||||
{
|
||||
bool status = false;
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *entry;
|
||||
@@ -553,7 +553,7 @@ void Life_Safety_Zone_Members_Clear(
|
||||
static bool Life_Safety_Zone_Members_Write(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
{
|
||||
int len = 0, apdu_len = 0, apdu_size = 0;
|
||||
uint8_t *apdu = NULL;
|
||||
const uint8_t *apdu = NULL;
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE data = { 0 };
|
||||
|
||||
if (wp_data == NULL) {
|
||||
|
||||
@@ -98,7 +98,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Life_Safety_Zone_Members_Add(
|
||||
uint32_t object_instance,
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *data);
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *data);
|
||||
BACNET_STACK_EXPORT
|
||||
void Life_Safety_Zone_Members_Clear(
|
||||
uint32_t object_instance);
|
||||
|
||||
@@ -215,16 +215,16 @@ uint32_t Multistate_Input_Max_States(uint32_t object_instance)
|
||||
* @param state_index - state index number 1..N of the text requested
|
||||
* @return C string retrieved
|
||||
*/
|
||||
char *Multistate_Input_State_Text(
|
||||
const char *Multistate_Input_State_Text(
|
||||
uint32_t object_instance, uint32_t state_index)
|
||||
{
|
||||
char *pName = NULL; /* return value */
|
||||
struct object_data *pObject;
|
||||
const char *pName = NULL; /* return value */
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (state_index > 0) {
|
||||
pName = (char *)state_name_by_index(pObject->State_Text,
|
||||
pName = state_name_by_index(pObject->State_Text,
|
||||
state_index);
|
||||
}
|
||||
}
|
||||
@@ -246,7 +246,7 @@ static int Multistate_Input_State_Text_Encode(
|
||||
uint32_t object_instance, BACNET_ARRAY_INDEX index, uint8_t *apdu)
|
||||
{
|
||||
int apdu_len = BACNET_STATUS_ERROR;
|
||||
char *pName = NULL; /* return value */
|
||||
const char *pName = NULL; /* return value */
|
||||
BACNET_CHARACTER_STRING char_string = { 0 };
|
||||
uint32_t state_index = 1;
|
||||
|
||||
@@ -482,7 +482,7 @@ bool Multistate_Input_Object_Name(
|
||||
* @param new_name - holds the object-name to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Multistate_Input_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Multistate_Input_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -537,7 +537,7 @@ BACNET_RELIABILITY Multistate_Input_Reliability(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return true the status flag is in Fault
|
||||
*/
|
||||
static bool Multistate_Input_Object_Fault(struct object_data *pObject)
|
||||
static bool Multistate_Input_Object_Fault(const struct object_data *pObject)
|
||||
{
|
||||
bool fault = false;
|
||||
|
||||
@@ -597,14 +597,14 @@ static bool Multistate_Input_Fault(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Multistate_Input_Description(uint32_t object_instance)
|
||||
const char *Multistate_Input_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Input_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
}
|
||||
|
||||
return name;
|
||||
@@ -616,7 +616,8 @@ char *Multistate_Input_Description(uint32_t object_instance)
|
||||
* @param new_name - holds the description to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Multistate_Input_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Multistate_Input_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -70,7 +70,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Input_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
@@ -106,12 +106,12 @@ extern "C" {
|
||||
bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Multistate_Input_Description(
|
||||
const char *Multistate_Input_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Input_Description_Set(
|
||||
uint32_t object_instance,
|
||||
char *text_string);
|
||||
const char *text_string);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Multistate_Input_Reliability(
|
||||
@@ -138,7 +138,7 @@ extern "C" {
|
||||
uint32_t Multistate_Input_Max_States(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Multistate_Input_State_Text(
|
||||
const char *Multistate_Input_State_Text(
|
||||
uint32_t object_instance,
|
||||
uint32_t state_index);
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ uint32_t Multistate_Output_Max_States(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return present-value of the object
|
||||
*/
|
||||
static uint32_t Object_Present_Value(struct object_data *pObject)
|
||||
static uint32_t Object_Present_Value(const struct object_data *pObject)
|
||||
{
|
||||
uint32_t value = 1;
|
||||
uint8_t priority = 0; /* loop counter */
|
||||
@@ -599,7 +599,7 @@ bool Multistate_Output_Object_Name(
|
||||
* @param new_name - holds the object-name to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Multistate_Output_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Multistate_Output_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -638,16 +638,16 @@ const char *Multistate_Output_Name_ASCII(uint32_t object_instance)
|
||||
* @param state_index - state index number 1..N of the text requested
|
||||
* @return C string retrieved
|
||||
*/
|
||||
char *Multistate_Output_State_Text(
|
||||
const char *Multistate_Output_State_Text(
|
||||
uint32_t object_instance, uint32_t state_index)
|
||||
{
|
||||
char *pName = NULL; /* return value */
|
||||
struct object_data *pObject;
|
||||
const char *pName = NULL; /* return value */
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (state_index > 0) {
|
||||
pName = (char *)state_name_by_index(pObject->State_Text,
|
||||
pName = state_name_by_index(pObject->State_Text,
|
||||
state_index);
|
||||
}
|
||||
}
|
||||
@@ -669,7 +669,7 @@ static int Multistate_Output_State_Text_Encode(
|
||||
uint32_t object_instance, BACNET_ARRAY_INDEX index, uint8_t *apdu)
|
||||
{
|
||||
int apdu_len = BACNET_STATUS_ERROR;
|
||||
char *pName = NULL; /* return value */
|
||||
const char *pName = NULL; /* return value */
|
||||
BACNET_CHARACTER_STRING char_string = { 0 };
|
||||
uint32_t state_index = 1;
|
||||
|
||||
@@ -741,7 +741,7 @@ BACNET_RELIABILITY Multistate_Output_Reliability(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return true the status flag is in Fault
|
||||
*/
|
||||
static bool Multistate_Output_Object_Fault(struct object_data *pObject)
|
||||
static bool Multistate_Output_Object_Fault(const struct object_data *pObject)
|
||||
{
|
||||
bool fault = false;
|
||||
|
||||
@@ -801,14 +801,14 @@ static bool Multistate_Output_Fault(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Multistate_Output_Description(uint32_t object_instance)
|
||||
const char *Multistate_Output_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
}
|
||||
|
||||
return name;
|
||||
@@ -820,7 +820,8 @@ char *Multistate_Output_Description(uint32_t object_instance)
|
||||
* @param new_name - holds the description to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Multistate_Output_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Multistate_Output_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -65,7 +65,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Output_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
@@ -109,12 +109,12 @@ extern "C" {
|
||||
bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Multistate_Output_Description(
|
||||
const char *Multistate_Output_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_Description_Set(
|
||||
uint32_t object_instance,
|
||||
char *text_string);
|
||||
const char *text_string);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Output_State_Text_List_Set(
|
||||
@@ -133,7 +133,7 @@ extern "C" {
|
||||
uint32_t Multistate_Output_Max_States(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Multistate_Output_State_Text(
|
||||
const char *Multistate_Output_State_Text(
|
||||
uint32_t object_instance,
|
||||
uint32_t state_index);
|
||||
|
||||
|
||||
@@ -217,17 +217,16 @@ uint32_t Multistate_Value_Max_States(uint32_t object_instance)
|
||||
* @param state_index - state index number 1..N of the text requested
|
||||
* @return C string retrieved
|
||||
*/
|
||||
char *Multistate_Value_State_Text(
|
||||
const char *Multistate_Value_State_Text(
|
||||
uint32_t object_instance, uint32_t state_index)
|
||||
{
|
||||
char *pName = NULL; /* return value */
|
||||
struct object_data *pObject;
|
||||
const char *pName = NULL; /* return value */
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (state_index > 0) {
|
||||
pName =
|
||||
(char *)state_name_by_index(pObject->State_Text, state_index);
|
||||
pName = state_name_by_index(pObject->State_Text, state_index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +247,7 @@ static int Multistate_Value_State_Text_Encode(
|
||||
uint32_t object_instance, BACNET_ARRAY_INDEX index, uint8_t *apdu)
|
||||
{
|
||||
int apdu_len = BACNET_STATUS_ERROR;
|
||||
char *pName = NULL; /* return value */
|
||||
const char *pName = NULL; /* return value */
|
||||
BACNET_CHARACTER_STRING char_string = { 0 };
|
||||
uint32_t state_index = 1;
|
||||
|
||||
@@ -482,7 +481,7 @@ bool Multistate_Value_Object_Name(
|
||||
* @param new_name - holds the object-name to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Multistate_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Multistate_Value_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -537,7 +536,7 @@ BACNET_RELIABILITY Multistate_Value_Reliability(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return true the status flag is in Fault
|
||||
*/
|
||||
static bool Multistate_Value_Object_Fault(struct object_data *pObject)
|
||||
static bool Multistate_Value_Object_Fault(const struct object_data *pObject)
|
||||
{
|
||||
bool fault = false;
|
||||
|
||||
@@ -597,14 +596,14 @@ static bool Multistate_Value_Fault(uint32_t object_instance)
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Multistate_Value_Description(uint32_t object_instance)
|
||||
const char *Multistate_Value_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Multistate_Value_Object(object_instance);
|
||||
if (pObject) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
}
|
||||
|
||||
return name;
|
||||
@@ -616,7 +615,8 @@ char *Multistate_Value_Description(uint32_t object_instance)
|
||||
* @param new_name - holds the description to be set
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Multistate_Value_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Multistate_Value_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -69,7 +69,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Multistate_Value_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
@@ -105,12 +105,12 @@ extern "C" {
|
||||
bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Multistate_Value_Description(
|
||||
const char *Multistate_Value_Description(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_Description_Set(
|
||||
uint32_t object_instance,
|
||||
char *text_string);
|
||||
const char *text_string);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Multistate_Value_State_Text_List_Set(
|
||||
@@ -129,7 +129,7 @@ extern "C" {
|
||||
uint32_t Multistate_Value_Max_States(
|
||||
uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
char *Multistate_Value_State_Text(
|
||||
const char *Multistate_Value_State_Text(
|
||||
uint32_t object_instance,
|
||||
uint32_t state_index);
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ struct mstp_port {
|
||||
|
||||
struct object_data {
|
||||
uint32_t Instance_Number;
|
||||
char *Object_Name;
|
||||
const char *Object_Name;
|
||||
BACNET_RELIABILITY Reliability;
|
||||
bool Out_Of_Service : 1;
|
||||
bool Changes_Pending : 1;
|
||||
@@ -314,7 +314,7 @@ bool Network_Port_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Network_Port_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Network_Port_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
unsigned index = 0; /* offset from instance lookup */
|
||||
bool status = false;
|
||||
@@ -746,7 +746,7 @@ bool Network_Port_MAC_Address(
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Network_Port_MAC_Address_Set(
|
||||
uint32_t object_instance, uint8_t *mac_src, uint8_t mac_len)
|
||||
uint32_t object_instance, const uint8_t *mac_src, uint8_t mac_len)
|
||||
{
|
||||
unsigned index = 0; /* offset from instance lookup */
|
||||
bool status = false;
|
||||
@@ -2109,7 +2109,7 @@ bool Network_Port_Remote_BBMD_IP6_Address(
|
||||
* @return true if ip-address was set
|
||||
*/
|
||||
bool Network_Port_Remote_BBMD_IP6_Address_Set(
|
||||
uint32_t object_instance, uint8_t *addr)
|
||||
uint32_t object_instance, const uint8_t *addr)
|
||||
{
|
||||
unsigned index = 0; /* offset from instance lookup */
|
||||
bool status = false;
|
||||
@@ -2326,7 +2326,7 @@ bool Network_Port_IPv6_Address(
|
||||
* @return true if ip-address was set
|
||||
*/
|
||||
bool Network_Port_IPv6_Address_Set(
|
||||
uint32_t object_instance, uint8_t *ip_address)
|
||||
uint32_t object_instance, const uint8_t *ip_address)
|
||||
{
|
||||
unsigned index = 0; /* offset from instance lookup */
|
||||
bool status = false;
|
||||
@@ -2437,7 +2437,7 @@ bool Network_Port_IPv6_Gateway(
|
||||
* @return true if ip-address was set
|
||||
*/
|
||||
bool Network_Port_IPv6_Gateway_Set(
|
||||
uint32_t object_instance, uint8_t *ip_address)
|
||||
uint32_t object_instance, const uint8_t *ip_address)
|
||||
{
|
||||
unsigned index = 0; /* offset from instance lookup */
|
||||
bool status = false;
|
||||
@@ -2529,7 +2529,7 @@ static int Network_Port_IPv6_DNS_Server_Encode(
|
||||
* @return true if ip-address was set
|
||||
*/
|
||||
bool Network_Port_IPv6_DNS_Server_Set(
|
||||
uint32_t object_instance, unsigned dns_index, uint8_t *ip_address)
|
||||
uint32_t object_instance, unsigned dns_index, const uint8_t *ip_address)
|
||||
{
|
||||
unsigned index = 0; /* offset from instance lookup */
|
||||
bool status = false;
|
||||
@@ -2588,7 +2588,7 @@ bool Network_Port_IPv6_Multicast_Address(
|
||||
* @return true if ip-address was set
|
||||
*/
|
||||
bool Network_Port_IPv6_Multicast_Address_Set(
|
||||
uint32_t object_instance, uint8_t *ip_address)
|
||||
uint32_t object_instance, const uint8_t *ip_address)
|
||||
{
|
||||
unsigned index = 0; /* offset from instance lookup */
|
||||
bool status = false;
|
||||
@@ -2646,7 +2646,7 @@ bool Network_Port_IPv6_DHCP_Server(
|
||||
* @return true if ip-address was set
|
||||
*/
|
||||
bool Network_Port_IPv6_DHCP_Server_Set(
|
||||
uint32_t object_instance, uint8_t *ip_address)
|
||||
uint32_t object_instance, const uint8_t *ip_address)
|
||||
{
|
||||
unsigned index = 0; /* offset from instance lookup */
|
||||
bool status = false;
|
||||
@@ -2837,7 +2837,7 @@ bool Network_Port_IPv6_Gateway_Zone_Index_Set(
|
||||
*/
|
||||
static bool Network_Port_FD_BBMD_Address_Write(
|
||||
uint32_t object_instance,
|
||||
BACNET_HOST_N_PORT *value,
|
||||
const BACNET_HOST_N_PORT *value,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Name_Set(
|
||||
uint32_t object_instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Network_Port_Object_Name_ASCII(
|
||||
uint32_t object_instance);
|
||||
@@ -51,7 +51,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Description_Set(
|
||||
uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Network_Port_Reliability(
|
||||
@@ -105,7 +105,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_MAC_Address_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t *mac_src,
|
||||
const uint8_t *mac_src,
|
||||
uint8_t mac_len);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -308,7 +308,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_Remote_BBMD_IP6_Address_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t *addr);
|
||||
const uint8_t *addr);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Network_Port_Remote_BBMD_BIP6_Port(
|
||||
uint32_t object_instance);
|
||||
@@ -340,7 +340,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Address_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t *ip_address);
|
||||
const uint8_t *ip_address);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Multicast_Address(
|
||||
@@ -349,7 +349,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Multicast_Address_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t *ip_address);
|
||||
const uint8_t *ip_address);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Network_Port_IPv6_Subnet_Prefix(
|
||||
@@ -366,7 +366,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Gateway_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t *ip_address);
|
||||
const uint8_t *ip_address);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_DNS_Server(
|
||||
@@ -377,7 +377,7 @@ extern "C" {
|
||||
bool Network_Port_IPv6_DNS_Server_Set(
|
||||
uint32_t object_instance,
|
||||
unsigned dns_index,
|
||||
uint8_t *ip_address);
|
||||
const uint8_t *ip_address);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_DHCP_Server(
|
||||
@@ -386,7 +386,7 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_DHCP_Server_Set(
|
||||
uint32_t object_instance,
|
||||
uint8_t *ip_address);
|
||||
const uint8_t *ip_address);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Network_Port_IPv6_Zone_Index(
|
||||
|
||||
@@ -114,7 +114,9 @@ unsigned OctetString_Value_Instance_To_Index(uint32_t object_instance)
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
bool OctetString_Value_Present_Value_Set(
|
||||
uint32_t object_instance, BACNET_OCTET_STRING *value, uint8_t priority)
|
||||
uint32_t object_instance,
|
||||
const BACNET_OCTET_STRING *value,
|
||||
uint8_t priority)
|
||||
{
|
||||
unsigned index = 0;
|
||||
bool status = false;
|
||||
|
||||
@@ -53,7 +53,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Present_Value_Set(uint32_t object_instance,
|
||||
BACNET_OCTET_STRING * value,
|
||||
const BACNET_OCTET_STRING * value,
|
||||
uint8_t priority);
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_OCTET_STRING *OctetString_Value_Present_Value(uint32_t
|
||||
@@ -71,7 +71,7 @@ extern "C" {
|
||||
char *OctetString_Value_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Description_Set(uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool OctetString_Value_Out_Of_Service(uint32_t instance);
|
||||
|
||||
@@ -70,7 +70,7 @@ extern "C" {
|
||||
char *PositiveInteger_Value_Description(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Description_Set(uint32_t instance,
|
||||
char *new_name);
|
||||
const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool PositiveInteger_Value_Out_Of_Service(uint32_t instance);
|
||||
|
||||
@@ -459,7 +459,8 @@ bool Schedule_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
|
||||
* @param date - date to check
|
||||
* @return true if the calendar entry is within the effective period
|
||||
*/
|
||||
bool Schedule_In_Effective_Period(SCHEDULE_DESCR *desc, BACNET_DATE *date)
|
||||
bool Schedule_In_Effective_Period(
|
||||
const SCHEDULE_DESCR *desc, const BACNET_DATE *date)
|
||||
{
|
||||
bool res = false;
|
||||
|
||||
@@ -480,7 +481,7 @@ bool Schedule_In_Effective_Period(SCHEDULE_DESCR *desc, BACNET_DATE *date)
|
||||
* @param time - time of the day
|
||||
*/
|
||||
void Schedule_Recalculate_PV(
|
||||
SCHEDULE_DESCR *desc, BACNET_WEEKDAY wday, BACNET_TIME *time)
|
||||
SCHEDULE_DESCR *desc, BACNET_WEEKDAY wday, const BACNET_TIME *time)
|
||||
{
|
||||
int i;
|
||||
desc->Present_Value.tag = BACNET_APPLICATION_TAG_NULL;
|
||||
|
||||
@@ -107,12 +107,12 @@ extern "C" {
|
||||
/* utility functions for calculating current Present Value
|
||||
* if Exception Schedule is to be added, these functions must take that into account */
|
||||
BACNET_STACK_EXPORT
|
||||
bool Schedule_In_Effective_Period(SCHEDULE_DESCR * desc,
|
||||
BACNET_DATE * date);
|
||||
bool Schedule_In_Effective_Period(const SCHEDULE_DESCR * desc,
|
||||
const BACNET_DATE * date);
|
||||
BACNET_STACK_EXPORT
|
||||
void Schedule_Recalculate_PV(SCHEDULE_DESCR * desc,
|
||||
BACNET_WEEKDAY wday,
|
||||
BACNET_TIME * time);
|
||||
const BACNET_TIME * time);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ bool Structured_View_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Structured_View_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Structured_View_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -234,15 +234,15 @@ const char *Structured_View_Name_ASCII(uint32_t object_instance)
|
||||
*
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Structured_View_Description(uint32_t object_instance)
|
||||
const char *Structured_View_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
} else {
|
||||
name = "";
|
||||
}
|
||||
@@ -259,7 +259,8 @@ char *Structured_View_Description(uint32_t object_instance)
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Structured_View_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Structured_View_Description_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -317,15 +318,15 @@ bool Structured_View_Node_Type_Set(
|
||||
* @param object_instance - object-instance number of the object
|
||||
* @return Node_Subtype text or NULL if not found
|
||||
*/
|
||||
char *Structured_View_Node_Subtype(uint32_t object_instance)
|
||||
const char *Structured_View_Node_Subtype(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description) {
|
||||
name = (char *)pObject->Node_Subtype;
|
||||
name = pObject->Node_Subtype;
|
||||
} else {
|
||||
name = "";
|
||||
}
|
||||
@@ -340,7 +341,8 @@ char *Structured_View_Node_Subtype(uint32_t object_instance)
|
||||
* @param new_name - holds the Node_Subtype to be set
|
||||
* @return true if Node_Subtype was set
|
||||
*/
|
||||
bool Structured_View_Node_Subtype_Set(uint32_t object_instance, char *new_name)
|
||||
bool Structured_View_Node_Subtype_Set(
|
||||
uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -460,7 +462,7 @@ Structured_View_Represents(uint32_t object_instance)
|
||||
* @return true if Represents was set
|
||||
*/
|
||||
bool Structured_View_Represents_Set(
|
||||
uint32_t object_instance, BACNET_DEVICE_OBJECT_REFERENCE *represents)
|
||||
uint32_t object_instance, const BACNET_DEVICE_OBJECT_REFERENCE *represents)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -49,7 +49,7 @@ BACNET_STACK_EXPORT
|
||||
bool Structured_View_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Structured_View_Name_Set(uint32_t object_instance, char *new_name);
|
||||
bool Structured_View_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Structured_View_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
@@ -57,9 +57,9 @@ BACNET_STACK_EXPORT
|
||||
int Structured_View_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Structured_View_Description(uint32_t object_instance);
|
||||
const char *Structured_View_Description(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Structured_View_Description_Set(uint32_t object_instance, char *new_name);
|
||||
bool Structured_View_Description_Set(uint32_t object_instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_NODE_TYPE Structured_View_Node_Type(uint32_t object_instance);
|
||||
@@ -68,9 +68,9 @@ bool Structured_View_Node_Type_Set(
|
||||
uint32_t object_instance, BACNET_NODE_TYPE node_type);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Structured_View_Node_Subtype(uint32_t object_instance);
|
||||
const char *Structured_View_Node_Subtype(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Structured_View_Node_Subtype_Set(uint32_t object_instance, char *new_name);
|
||||
bool Structured_View_Node_Subtype_Set(uint32_t object_instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_SUBORDINATE_DATA *
|
||||
@@ -110,7 +110,8 @@ BACNET_DEVICE_OBJECT_REFERENCE *
|
||||
Structured_View_Represents(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Structured_View_Represents_Set(
|
||||
uint32_t object_instance, BACNET_DEVICE_OBJECT_REFERENCE *represents);
|
||||
uint32_t object_instance,
|
||||
const BACNET_DEVICE_OBJECT_REFERENCE *represents);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Structured_View_Create(uint32_t object_instance);
|
||||
|
||||
@@ -179,7 +179,7 @@ bool Time_Value_Present_Value(uint32_t object_instance, BACNET_TIME *value)
|
||||
* @param value - floating point analog value
|
||||
*/
|
||||
static void Time_Value_Present_Value_COV_Detect(
|
||||
struct object_data *pObject, BACNET_TIME *value)
|
||||
struct object_data *pObject, const BACNET_TIME *value)
|
||||
{
|
||||
if (pObject && value) {
|
||||
if (datetime_compare_time(&pObject->Present_Value, value) != 0) {
|
||||
@@ -196,7 +196,8 @@ static void Time_Value_Present_Value_COV_Detect(
|
||||
*
|
||||
* @return true if values are within range and present-value is set.
|
||||
*/
|
||||
bool Time_Value_Present_Value_Set(uint32_t object_instance, BACNET_TIME *value)
|
||||
bool Time_Value_Present_Value_Set(
|
||||
uint32_t object_instance, const BACNET_TIME *value)
|
||||
{
|
||||
bool status = false;
|
||||
struct object_data *pObject;
|
||||
@@ -342,7 +343,7 @@ bool Time_Value_Object_Name(
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Time_Value_Name_Set(uint32_t object_instance, char *new_name)
|
||||
bool Time_Value_Name_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
@@ -382,15 +383,15 @@ const char *Time_Value_Name_ASCII(uint32_t object_instance)
|
||||
*
|
||||
* @return description text or NULL if not found
|
||||
*/
|
||||
char *Time_Value_Description(uint32_t object_instance)
|
||||
const char *Time_Value_Description(uint32_t object_instance)
|
||||
{
|
||||
char *name = NULL;
|
||||
struct object_data *pObject;
|
||||
const char *name = NULL;
|
||||
const struct object_data *pObject;
|
||||
|
||||
pObject = Keylist_Data(Object_List, object_instance);
|
||||
if (pObject) {
|
||||
if (pObject->Description) {
|
||||
name = (char *)pObject->Description;
|
||||
name = pObject->Description;
|
||||
} else {
|
||||
name = "";
|
||||
}
|
||||
@@ -407,7 +408,7 @@ char *Time_Value_Description(uint32_t object_instance)
|
||||
*
|
||||
* @return true if object-name was set
|
||||
*/
|
||||
bool Time_Value_Description_Set(uint32_t object_instance, char *new_name)
|
||||
bool Time_Value_Description_Set(uint32_t object_instance, const char *new_name)
|
||||
{
|
||||
bool status = false; /* return value */
|
||||
struct object_data *pObject;
|
||||
|
||||
@@ -47,7 +47,7 @@ BACNET_STACK_EXPORT
|
||||
bool Time_Value_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Time_Value_Name_Set(uint32_t object_instance, char *new_name);
|
||||
bool Time_Value_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Time_Value_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
@@ -58,7 +58,8 @@ BACNET_STACK_EXPORT
|
||||
bool Time_Value_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Time_Value_Present_Value_Set(uint32_t object_instance, BACNET_TIME *value);
|
||||
bool Time_Value_Present_Value_Set(
|
||||
uint32_t object_instance, const BACNET_TIME *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Time_Value_Present_Value(uint32_t object_instance, BACNET_TIME *value);
|
||||
BACNET_STACK_EXPORT
|
||||
@@ -74,9 +75,9 @@ BACNET_STACK_EXPORT
|
||||
bool Time_Value_Out_Of_Service_Set(uint32_t object_instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
char *Time_Value_Description(uint32_t object_instance);
|
||||
const char *Time_Value_Value_Description(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Time_Value_Description_Set(uint32_t object_instance, char *new_name);
|
||||
bool Time_Value_Description_Set(uint32_t object_instance, const char *new_name);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Time_Value_Write_Enabled(uint32_t instance);
|
||||
|
||||
@@ -910,7 +910,7 @@ bool TL_Is_Enabled(int iLog)
|
||||
* Convert a BACnet time into a local time in seconds since the local epoch *
|
||||
*****************************************************************************/
|
||||
|
||||
bacnet_time_t TL_BAC_Time_To_Local(BACNET_DATE_TIME *bdatetime)
|
||||
bacnet_time_t TL_BAC_Time_To_Local(const BACNET_DATE_TIME *bdatetime)
|
||||
{
|
||||
return datetime_seconds_since_epoch(bdatetime);
|
||||
}
|
||||
@@ -1498,7 +1498,7 @@ int TL_encode_entry(uint8_t *apdu, int iLog, int iEntry)
|
||||
|
||||
static int local_read_property(uint8_t *value,
|
||||
uint8_t *status,
|
||||
BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *Source,
|
||||
const BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE *Source,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
{
|
||||
|
||||
@@ -158,7 +158,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bacnet_time_t TL_BAC_Time_To_Local(
|
||||
BACNET_DATE_TIME * SourceTime);
|
||||
const BACNET_DATE_TIME * SourceTime);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void TL_Local_Time_To_BAC(
|
||||
|
||||
@@ -121,7 +121,7 @@ static void cov_address_remove_unused(void)
|
||||
*
|
||||
* @return index number 0..N, or -1 if unable to add
|
||||
*/
|
||||
static int cov_address_add(BACNET_ADDRESS *dest)
|
||||
static int cov_address_add(const BACNET_ADDRESS *dest)
|
||||
{
|
||||
int index = -1;
|
||||
unsigned i = 0;
|
||||
@@ -187,7 +187,9 @@ COVIncrement [4] REAL OPTIONAL
|
||||
*/
|
||||
|
||||
static int cov_encode_subscription(
|
||||
uint8_t *apdu, int max_apdu, BACNET_COV_SUBSCRIPTION *cov_subscription)
|
||||
uint8_t *apdu,
|
||||
int max_apdu,
|
||||
const BACNET_COV_SUBSCRIPTION *cov_subscription)
|
||||
{
|
||||
int len = 0;
|
||||
int apdu_len = 0;
|
||||
@@ -323,8 +325,8 @@ void handler_cov_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
static bool cov_list_subscribe(BACNET_ADDRESS *src,
|
||||
BACNET_SUBSCRIBE_COV_DATA *cov_data,
|
||||
static bool cov_list_subscribe(const BACNET_ADDRESS *src,
|
||||
const BACNET_SUBSCRIBE_COV_DATA *cov_data,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
{
|
||||
@@ -333,7 +335,7 @@ static bool cov_list_subscribe(BACNET_ADDRESS *src,
|
||||
int first_invalid_index = -1;
|
||||
bool found = true;
|
||||
bool address_match = false;
|
||||
BACNET_ADDRESS *dest = NULL;
|
||||
const BACNET_ADDRESS *dest = NULL;
|
||||
|
||||
/* unable to subscribe - resources? */
|
||||
/* unable to cancel subscription - other? */
|
||||
@@ -717,8 +719,8 @@ void handler_cov_task(void)
|
||||
handler_cov_fsm();
|
||||
}
|
||||
|
||||
static bool cov_subscribe(BACNET_ADDRESS *src,
|
||||
BACNET_SUBSCRIBE_COV_DATA *cov_data,
|
||||
static bool cov_subscribe(const BACNET_ADDRESS *src,
|
||||
const BACNET_SUBSCRIBE_COV_DATA *cov_data,
|
||||
BACNET_ERROR_CLASS *error_class,
|
||||
BACNET_ERROR_CODE *error_code)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ static char My_Password[32] = "filister";
|
||||
/** Sets (non-volatile hold) the password to be used for DCC requests.
|
||||
* @param new_password [in] The new DCC password, of up to 31 characters.
|
||||
*/
|
||||
void handler_dcc_password_set(char *new_password)
|
||||
void handler_dcc_password_set(const char *new_password)
|
||||
{
|
||||
size_t i = 0; /* loop counter */
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ extern "C" {
|
||||
BACNET_CONFIRMED_SERVICE_DATA * service_data);
|
||||
BACNET_STACK_EXPORT
|
||||
void handler_dcc_password_set(
|
||||
char *new_password);
|
||||
const char *new_password);
|
||||
BACNET_STACK_EXPORT
|
||||
char *handler_dcc_password(void);
|
||||
|
||||
|
||||
@@ -39,7 +39,9 @@
|
||||
* @return The number of bytes decoded, or -1 on error
|
||||
*/
|
||||
int rpm_ack_decode_service_request(
|
||||
uint8_t *apdu, int apdu_len, BACNET_READ_ACCESS_DATA *read_access_data)
|
||||
const uint8_t *apdu,
|
||||
int apdu_len,
|
||||
BACNET_READ_ACCESS_DATA *read_access_data)
|
||||
{
|
||||
int decoded_len = 0; /* return value */
|
||||
uint32_t error_value = 0; /* decoded error value */
|
||||
|
||||
@@ -33,7 +33,7 @@ extern "C" {
|
||||
BACNET_CONFIRMED_SERVICE_ACK_DATA * service_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int rpm_ack_decode_service_request(
|
||||
uint8_t * apdu,
|
||||
const uint8_t * apdu,
|
||||
int apdu_len,
|
||||
BACNET_READ_ACCESS_DATA * read_access_data);
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
@@ -34,7 +34,7 @@ static BACNET_DATE_TIME Next_Sync_Time;
|
||||
#endif
|
||||
|
||||
#if PRINT_ENABLED
|
||||
static void show_bacnet_date_time(BACNET_DATE *bdate, BACNET_TIME *btime)
|
||||
static void show_bacnet_date_time(const BACNET_DATE *bdate, const BACNET_TIME *btime)
|
||||
{
|
||||
/* show the date received */
|
||||
fprintf(stderr, "%u", (unsigned)bdate->year);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* or object ID, if the Device has a match.
|
||||
* @param data [in] The decoded who-has payload from the request.
|
||||
*/
|
||||
static void match_name_or_object(BACNET_WHO_HAS_DATA *data)
|
||||
static void match_name_or_object(const BACNET_WHO_HAS_DATA *data)
|
||||
{
|
||||
BACNET_OBJECT_TYPE object_type = OBJECT_NONE;
|
||||
uint32_t object_instance = 0;
|
||||
|
||||
@@ -100,9 +100,9 @@ void handler_who_is_unicast(
|
||||
* back to the src, else False if should broadcast
|
||||
* response(s).
|
||||
*/
|
||||
static void check_who_is_for_routing(uint8_t *service_request,
|
||||
static void check_who_is_for_routing(const uint8_t *service_request,
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS *src,
|
||||
const BACNET_ADDRESS *src,
|
||||
bool is_unicast)
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
@@ -146,7 +146,7 @@ void handler_write_property(uint8_t *service_request,
|
||||
*
|
||||
* @return True on success, false otherwise.
|
||||
*/
|
||||
bool WPValidateString(BACNET_APPLICATION_DATA_VALUE *pValue,
|
||||
bool WPValidateString(const BACNET_APPLICATION_DATA_VALUE *pValue,
|
||||
int iMaxLen,
|
||||
bool bEmptyAllowed,
|
||||
BACNET_ERROR_CLASS *pErrorClass,
|
||||
@@ -193,7 +193,7 @@ bool WPValidateString(BACNET_APPLICATION_DATA_VALUE *pValue,
|
||||
* validation fails. Cuts out reams of repeated code in the object code.
|
||||
*/
|
||||
|
||||
bool WPValidateArgType(BACNET_APPLICATION_DATA_VALUE *pValue,
|
||||
bool WPValidateArgType(const BACNET_APPLICATION_DATA_VALUE *pValue,
|
||||
uint8_t ucExpectedTag,
|
||||
BACNET_ERROR_CLASS *pErrorClass,
|
||||
BACNET_ERROR_CODE *pErrorCode)
|
||||
|
||||
@@ -34,7 +34,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool WPValidateString(
|
||||
BACNET_APPLICATION_DATA_VALUE * pValue,
|
||||
const BACNET_APPLICATION_DATA_VALUE * pValue,
|
||||
int iMaxLen,
|
||||
bool bEmptyAllowed,
|
||||
BACNET_ERROR_CLASS * pErrorClass,
|
||||
@@ -42,7 +42,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool WPValidateArgType(
|
||||
BACNET_APPLICATION_DATA_VALUE * pValue,
|
||||
const BACNET_APPLICATION_DATA_VALUE * pValue,
|
||||
uint8_t ucExpectedType,
|
||||
BACNET_ERROR_CLASS * pErrorClass,
|
||||
BACNET_ERROR_CODE * pErrorCode);
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
* @return number of bytes decoded, or BACNET_STATUS_REJECT,
|
||||
* or BACNET_STATUS_ERROR
|
||||
*/
|
||||
static int write_property_multiple_decode(uint8_t *apdu,
|
||||
static int write_property_multiple_decode(const uint8_t *apdu,
|
||||
uint16_t apdu_len,
|
||||
BACNET_WRITE_PROPERTY_DATA *wp_data,
|
||||
write_property_function device_write_property)
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
*/
|
||||
uint8_t Send_Alarm_Acknowledgement_Address(uint8_t *pdu,
|
||||
uint16_t pdu_size,
|
||||
BACNET_ALARM_ACK_DATA *data,
|
||||
const BACNET_ALARM_ACK_DATA *data,
|
||||
BACNET_ADDRESS *dest)
|
||||
{
|
||||
int len = 0;
|
||||
@@ -100,7 +100,7 @@ uint8_t Send_Alarm_Acknowledgement_Address(uint8_t *pdu,
|
||||
* or no tsm slot is available.
|
||||
*/
|
||||
uint8_t Send_Alarm_Acknowledgement(
|
||||
uint32_t device_id, BACNET_ALARM_ACK_DATA *data)
|
||||
uint32_t device_id, const BACNET_ALARM_ACK_DATA *data)
|
||||
{
|
||||
BACNET_ADDRESS dest = { 0 };
|
||||
unsigned max_apdu = 0;
|
||||
|
||||
@@ -28,11 +28,11 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Send_Alarm_Acknowledgement_Address(uint8_t *pdu, uint16_t pdu_size,
|
||||
BACNET_ALARM_ACK_DATA *data, BACNET_ADDRESS *dest);
|
||||
const BACNET_ALARM_ACK_DATA *data, BACNET_ADDRESS *dest);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Send_Alarm_Acknowledgement(uint32_t device_id,
|
||||
BACNET_ALARM_ACK_DATA* data);
|
||||
const BACNET_ALARM_ACK_DATA* data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
uint8_t Send_Atomic_Write_File_Stream(uint32_t device_id,
|
||||
uint32_t file_instance,
|
||||
int fileStartPosition,
|
||||
BACNET_OCTET_STRING *fileData)
|
||||
const BACNET_OCTET_STRING *fileData)
|
||||
{
|
||||
BACNET_ADDRESS dest;
|
||||
BACNET_ADDRESS my_address;
|
||||
|
||||
@@ -29,7 +29,7 @@ BACNET_STACK_EXPORT
|
||||
uint8_t Send_Atomic_Write_File_Stream(uint32_t device_id,
|
||||
uint32_t file_instance,
|
||||
int fileStartPosition,
|
||||
BACNET_OCTET_STRING* fileData);
|
||||
const BACNET_OCTET_STRING* fileData);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
*/
|
||||
uint8_t Send_CEvent_Notify_Address(uint8_t *pdu,
|
||||
uint16_t pdu_size,
|
||||
BACNET_EVENT_NOTIFICATION_DATA *data,
|
||||
const BACNET_EVENT_NOTIFICATION_DATA *data,
|
||||
BACNET_ADDRESS *dest)
|
||||
{
|
||||
int len = 0;
|
||||
@@ -102,7 +102,7 @@ uint8_t Send_CEvent_Notify_Address(uint8_t *pdu,
|
||||
* or no tsm slot is available.
|
||||
*/
|
||||
uint8_t Send_CEvent_Notify(
|
||||
uint32_t device_id, BACNET_EVENT_NOTIFICATION_DATA *data)
|
||||
uint32_t device_id, const BACNET_EVENT_NOTIFICATION_DATA *data)
|
||||
{
|
||||
BACNET_ADDRESS dest = { 0 };
|
||||
unsigned max_apdu = 0;
|
||||
|
||||
@@ -28,10 +28,10 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Send_CEvent_Notify(uint32_t device_id,
|
||||
BACNET_EVENT_NOTIFICATION_DATA* data);
|
||||
const BACNET_EVENT_NOTIFICATION_DATA* data);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Send_CEvent_Notify_Address(uint8_t *pdu, uint16_t pdu_size,
|
||||
BACNET_EVENT_NOTIFICATION_DATA *data, BACNET_ADDRESS *dest);
|
||||
const BACNET_EVENT_NOTIFICATION_DATA *data, BACNET_ADDRESS *dest);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ int ucov_notify_encode_pdu(uint8_t *buffer,
|
||||
unsigned buffer_len,
|
||||
BACNET_ADDRESS *dest,
|
||||
BACNET_NPDU_DATA *npdu_data,
|
||||
BACNET_COV_DATA *cov_data)
|
||||
const BACNET_COV_DATA *cov_data)
|
||||
{
|
||||
int len = 0;
|
||||
int pdu_len = 0;
|
||||
@@ -75,7 +75,7 @@ int ucov_notify_encode_pdu(uint8_t *buffer,
|
||||
* @return Size of the message sent (bytes), or a negative value on error.
|
||||
*/
|
||||
int Send_UCOV_Notify(
|
||||
uint8_t *buffer, unsigned buffer_len, BACNET_COV_DATA *cov_data)
|
||||
uint8_t *buffer, unsigned buffer_len, const BACNET_COV_DATA *cov_data)
|
||||
{
|
||||
int pdu_len = 0;
|
||||
BACNET_ADDRESS dest;
|
||||
@@ -98,7 +98,7 @@ int Send_UCOV_Notify(
|
||||
* no slot is available from the tsm for sending.
|
||||
*/
|
||||
uint8_t Send_COV_Subscribe(
|
||||
uint32_t device_id, BACNET_SUBSCRIBE_COV_DATA *cov_data)
|
||||
uint32_t device_id, const BACNET_SUBSCRIBE_COV_DATA *cov_data)
|
||||
{
|
||||
BACNET_ADDRESS dest;
|
||||
BACNET_ADDRESS my_address;
|
||||
|
||||
@@ -32,18 +32,18 @@ extern "C" {
|
||||
int Send_UCOV_Notify(
|
||||
uint8_t * buffer,
|
||||
unsigned buffer_len,
|
||||
BACNET_COV_DATA * cov_data);
|
||||
const BACNET_COV_DATA * cov_data);
|
||||
BACNET_STACK_EXPORT
|
||||
int ucov_notify_encode_pdu(
|
||||
uint8_t * buffer,
|
||||
unsigned buffer_len,
|
||||
BACNET_ADDRESS * dest,
|
||||
BACNET_NPDU_DATA * npdu_data,
|
||||
BACNET_COV_DATA * cov_data);
|
||||
const BACNET_COV_DATA * cov_data);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Send_COV_Subscribe(
|
||||
uint32_t device_id,
|
||||
BACNET_SUBSCRIBE_COV_DATA * cov_data);
|
||||
const BACNET_SUBSCRIBE_COV_DATA * cov_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
uint8_t Send_Device_Communication_Control_Request(uint32_t device_id,
|
||||
uint16_t timeDuration, /* 0=optional */
|
||||
BACNET_COMMUNICATION_ENABLE_DISABLE state,
|
||||
char *password)
|
||||
const char *password)
|
||||
{ /* NULL=optional */
|
||||
BACNET_ADDRESS dest;
|
||||
BACNET_ADDRESS my_address;
|
||||
|
||||
@@ -28,7 +28,8 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Send_Device_Communication_Control_Request(
|
||||
uint32_t device_id, uint16_t timeDuration,
|
||||
BACNET_COMMUNICATION_ENABLE_DISABLE state, char *password);
|
||||
BACNET_COMMUNICATION_ENABLE_DISABLE state,
|
||||
const char *password);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
uint8_t Send_Get_Event_Information_Address(BACNET_ADDRESS *dest,
|
||||
uint16_t max_apdu,
|
||||
BACNET_OBJECT_ID *lastReceivedObjectIdentifier)
|
||||
const BACNET_OBJECT_ID *lastReceivedObjectIdentifier)
|
||||
{
|
||||
int len = 0;
|
||||
int pdu_len = 0;
|
||||
@@ -92,7 +92,7 @@ uint8_t Send_Get_Event_Information_Address(BACNET_ADDRESS *dest,
|
||||
}
|
||||
|
||||
uint8_t Send_Get_Event_Information(
|
||||
uint32_t device_id, BACNET_OBJECT_ID *lastReceivedObjectIdentifier)
|
||||
uint32_t device_id, const BACNET_OBJECT_ID *lastReceivedObjectIdentifier)
|
||||
{
|
||||
BACNET_ADDRESS dest = { 0 };
|
||||
unsigned max_apdu = 0;
|
||||
|
||||
@@ -28,10 +28,10 @@ extern "C" {
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Send_Get_Event_Information_Address(
|
||||
BACNET_ADDRESS *dest, uint16_t max_apdu,
|
||||
BACNET_OBJECT_ID *lastReceivedObjectIdentifier);
|
||||
const BACNET_OBJECT_ID *lastReceivedObjectIdentifier);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Send_Get_Event_Information(
|
||||
uint32_t device_id, BACNET_OBJECT_ID *lastReceivedObjectIdentifier);
|
||||
uint32_t device_id, const BACNET_OBJECT_ID *lastReceivedObjectIdentifier);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
* @param target_address [in] BACnet address of target or broadcast
|
||||
*/
|
||||
uint8_t Send_GetEvent(BACNET_ADDRESS *target_address,
|
||||
BACNET_OBJECT_ID *lastReceivedObjectIdentifier)
|
||||
const BACNET_OBJECT_ID *lastReceivedObjectIdentifier)
|
||||
{
|
||||
int len = 0;
|
||||
int pdu_len = 0;
|
||||
|
||||
@@ -27,7 +27,7 @@ extern "C" {
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Send_GetEvent(BACNET_ADDRESS* target_address,
|
||||
BACNET_OBJECT_ID* lastReceivedObjectIdentifier);
|
||||
const BACNET_OBJECT_ID* lastReceivedObjectIdentifier);
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Send_GetEvent_Global(void);
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ void Send_I_Am(uint8_t *buffer)
|
||||
* @return The length of the message in buffer[].
|
||||
*/
|
||||
int iam_unicast_encode_pdu(uint8_t *buffer,
|
||||
BACNET_ADDRESS *src,
|
||||
const BACNET_ADDRESS *src,
|
||||
BACNET_ADDRESS *dest,
|
||||
BACNET_NPDU_DATA *npdu_data)
|
||||
{
|
||||
@@ -174,7 +174,7 @@ int iam_unicast_encode_pdu(uint8_t *buffer,
|
||||
* @param buffer [in] The buffer to use for building and sending the message.
|
||||
* @param src [in] The source address information from service handler.
|
||||
*/
|
||||
void Send_I_Am_Unicast(uint8_t *buffer, BACNET_ADDRESS *src)
|
||||
void Send_I_Am_Unicast(uint8_t *buffer, const BACNET_ADDRESS *src)
|
||||
{
|
||||
int pdu_len = 0;
|
||||
BACNET_ADDRESS dest;
|
||||
|
||||
@@ -36,10 +36,10 @@ int iam_encode_pdu(uint8_t* buffer, BACNET_ADDRESS* dest,
|
||||
BACNET_STACK_EXPORT
|
||||
void Send_I_Am(uint8_t* buffer);
|
||||
BACNET_STACK_EXPORT
|
||||
int iam_unicast_encode_pdu(uint8_t* buffer, BACNET_ADDRESS* src,
|
||||
int iam_unicast_encode_pdu(uint8_t* buffer, const BACNET_ADDRESS* src,
|
||||
BACNET_ADDRESS* dest, BACNET_NPDU_DATA* npdu_data);
|
||||
BACNET_STACK_EXPORT
|
||||
void Send_I_Am_Unicast(uint8_t* buffer, BACNET_ADDRESS* src);
|
||||
void Send_I_Am_Unicast(uint8_t* buffer, const BACNET_ADDRESS* src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user