Added DeviceCommunicationControl in the demos and into the stack.
This commit is contained in:
@@ -31,25 +31,26 @@
|
||||
#include "bacdef.h"
|
||||
#include "apdu.h"
|
||||
#include "bacapp.h"
|
||||
#include "bacenum.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* FIXME: probably should return the invoke ID for confirmed request */
|
||||
bool Send_Read_Property_Request(
|
||||
void Send_WhoIs(
|
||||
int32_t low_limit,
|
||||
int32_t high_limit);
|
||||
|
||||
/* returns the invoke ID for confirmed request, or 0 if failed */
|
||||
uint8_t Send_Read_Property_Request(
|
||||
uint32_t device_id, /* destination device */
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
BACNET_PROPERTY_ID object_property,
|
||||
int32_t array_index);
|
||||
|
||||
void Send_WhoIs(
|
||||
int32_t low_limit,
|
||||
int32_t high_limit);
|
||||
|
||||
/* FIXME: probably should return the invoke ID for confirmed request */
|
||||
bool Send_Write_Property_Request(
|
||||
/* returns the invoke ID for confirmed request, or 0 if failed */
|
||||
uint8_t Send_Write_Property_Request(
|
||||
uint32_t device_id, // destination device
|
||||
BACNET_OBJECT_TYPE object_type,
|
||||
uint32_t object_instance,
|
||||
@@ -58,6 +59,19 @@ bool Send_Write_Property_Request(
|
||||
uint8_t priority,
|
||||
int32_t array_index);
|
||||
|
||||
/* returns the invoke ID for confirmed request, or 0 if failed */
|
||||
uint8_t Send_Reinitialize_Device_Request(
|
||||
uint32_t device_id,
|
||||
BACNET_REINITIALIZED_STATE state,
|
||||
char *password);
|
||||
|
||||
/* returns the invoke ID for confirmed request, or 0 if failed */
|
||||
uint8_t Send_Device_Communication_Control_Request(
|
||||
uint32_t device_id,
|
||||
uint16_t timeDuration, /* 0=optional */
|
||||
BACNET_COMMUNICATION_ENABLE_DISABLE state,
|
||||
char *password); /* NULL=optional */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -112,6 +112,8 @@ void handler_reinitialize_device(
|
||||
fprintf(stderr,"ReinitializeDevice: Sending Simple Ack!\n");
|
||||
/* FIXME: now you can reboot, restart, quit, or something clever */
|
||||
/* Note: you can use a mix of state and password to do specific stuff */
|
||||
/* Note: if you don't do something clever like actually restart,
|
||||
you probably should clear any DCC status and timeouts */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -96,6 +96,12 @@ void handler_reinitialize_device(
|
||||
BACNET_ADDRESS *src,
|
||||
BACNET_CONFIRMED_SERVICE_DATA *service_data);
|
||||
|
||||
void handler_device_communication_control(
|
||||
uint8_t *service_request,
|
||||
uint16_t service_len,
|
||||
BACNET_ADDRESS *src,
|
||||
BACNET_CONFIRMED_SERVICE_DATA *service_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "apdu.h"
|
||||
#include "device.h"
|
||||
#include "datalink.h"
|
||||
#include "dcc.h"
|
||||
#include "rp.h"
|
||||
/* some demo stuff needed */
|
||||
#include "handlers.h"
|
||||
@@ -58,6 +59,9 @@ uint8_t Send_Read_Property_Request(
|
||||
int bytes_sent = 0;
|
||||
BACNET_READ_PROPERTY_DATA data;
|
||||
|
||||
if (!dcc_communication_enabled())
|
||||
return 0;
|
||||
|
||||
/* is the device bound? */
|
||||
status = address_get_by_device(device_id, &max_apdu, &dest);
|
||||
/* is there a tsm available? */
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "apdu.h"
|
||||
#include "device.h"
|
||||
#include "datalink.h"
|
||||
#include "dcc.h"
|
||||
#include "whois.h"
|
||||
/* some demo stuff needed */
|
||||
#include "handlers.h"
|
||||
@@ -50,6 +51,9 @@ void Send_WhoIs(
|
||||
BACNET_ADDRESS dest;
|
||||
int bytes_sent = 0;
|
||||
|
||||
if (!dcc_communication_enabled())
|
||||
return;
|
||||
|
||||
// Who-Is is a global broadcast
|
||||
datalink_get_broadcast_address(&dest);
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "apdu.h"
|
||||
#include "device.h"
|
||||
#include "datalink.h"
|
||||
#include "dcc.h"
|
||||
#include "whois.h"
|
||||
/* some demo stuff needed */
|
||||
#include "handlers.h"
|
||||
@@ -60,6 +61,9 @@ uint8_t Send_Write_Property_Request(
|
||||
int bytes_sent = 0;
|
||||
BACNET_WRITE_PROPERTY_DATA data;
|
||||
|
||||
if (!dcc_communication_enabled())
|
||||
return 0;
|
||||
|
||||
/* is the device bound? */
|
||||
status = address_get_by_device(device_id, &max_apdu, &dest);
|
||||
/* is there a tsm available? */
|
||||
|
||||
Reference in New Issue
Block a user