Moved APDU Timeout and Retries to apdu module.
This commit is contained in:
@@ -274,7 +274,7 @@ int main(int argc, char *argv[]) {
|
|||||||
/* configure the timeout values */
|
/* configure the timeout values */
|
||||||
last_seconds = time(NULL);
|
last_seconds = time(NULL);
|
||||||
timeout_seconds =
|
timeout_seconds =
|
||||||
(Device_APDU_Timeout() / 1000) * Device_Number_Of_APDU_Retries();
|
(apdu_timeout() / 1000) * apdu_retries();
|
||||||
/* try to bind with the device */
|
/* try to bind with the device */
|
||||||
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance);
|
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance);
|
||||||
/* loop forever */
|
/* loop forever */
|
||||||
|
|||||||
@@ -432,7 +432,7 @@ int main(int argc, char *argv[]) {
|
|||||||
/* configure the timeout values */
|
/* configure the timeout values */
|
||||||
last_seconds = time(NULL);
|
last_seconds = time(NULL);
|
||||||
timeout_seconds =
|
timeout_seconds =
|
||||||
(Device_APDU_Timeout() / 1000) * Device_Number_Of_APDU_Retries();
|
(apdu_timeout() / 1000) * apdu_retries();
|
||||||
/* try to bind with the device */
|
/* try to bind with the device */
|
||||||
found =
|
found =
|
||||||
address_bind_request(Target_Device_Object_Instance, &max_apdu,
|
address_bind_request(Target_Device_Object_Instance, &max_apdu,
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ static char Description[16] = "server";
|
|||||||
/* Protocol_Services_Supported - dynamically generated */
|
/* Protocol_Services_Supported - dynamically generated */
|
||||||
/* Protocol_Object_Types_Supported - in RP encoding */
|
/* Protocol_Object_Types_Supported - in RP encoding */
|
||||||
/* Object_List - dynamically generated */
|
/* Object_List - dynamically generated */
|
||||||
/* static uint16_t Max_APDU_Length_Accepted = MAX_APDU; - constant */
|
|
||||||
/* static BACNET_SEGMENTATION Segmentation_Supported = SEGMENTATION_NONE; */
|
/* static BACNET_SEGMENTATION Segmentation_Supported = SEGMENTATION_NONE; */
|
||||||
/* static uint8_t Max_Segments_Accepted = 0; */
|
/* static uint8_t Max_Segments_Accepted = 0; */
|
||||||
/* VT_Classes_Supported */
|
/* VT_Classes_Supported */
|
||||||
@@ -137,9 +136,6 @@ BACNET_DATE Local_Date; /* rely on OS, if there is one */
|
|||||||
/* BACnet UTC is inverse of standard offset - i.e. relative to local */
|
/* BACnet UTC is inverse of standard offset - i.e. relative to local */
|
||||||
static int UTC_Offset = 5;
|
static int UTC_Offset = 5;
|
||||||
static bool Daylight_Savings_Status = false; /* rely on OS */
|
static bool Daylight_Savings_Status = false; /* rely on OS */
|
||||||
/* APDU_Segment_Timeout */
|
|
||||||
static uint16_t APDU_Timeout = 3000;
|
|
||||||
static uint8_t Number_Of_APDU_Retries = 3;
|
|
||||||
/* List_Of_Session_Keys */
|
/* List_Of_Session_Keys */
|
||||||
/* Time_Synchronization_Recipients */
|
/* Time_Synchronization_Recipients */
|
||||||
/* Max_Master - rely on MS/TP subsystem, if there is one */
|
/* Max_Master - rely on MS/TP subsystem, if there is one */
|
||||||
@@ -341,43 +337,12 @@ uint8_t Device_Protocol_Revision(
|
|||||||
return BACNET_PROTOCOL_REVISION;
|
return BACNET_PROTOCOL_REVISION;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t Device_Max_APDU_Length_Accepted(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return MAX_APDU;
|
|
||||||
}
|
|
||||||
|
|
||||||
BACNET_SEGMENTATION Device_Segmentation_Supported(
|
BACNET_SEGMENTATION Device_Segmentation_Supported(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
return SEGMENTATION_NONE;
|
return SEGMENTATION_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t Device_APDU_Timeout(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return APDU_Timeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* in milliseconds */
|
|
||||||
void Device_Set_APDU_Timeout(
|
|
||||||
uint16_t timeout)
|
|
||||||
{
|
|
||||||
APDU_Timeout = timeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t Device_Number_Of_APDU_Retries(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return Number_Of_APDU_Retries;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Device_Set_Number_Of_APDU_Retries(
|
|
||||||
uint8_t retries)
|
|
||||||
{
|
|
||||||
Number_Of_APDU_Retries = retries;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t Device_Database_Revision(
|
uint8_t Device_Database_Revision(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
@@ -842,8 +807,7 @@ int Device_Encode_Property_APDU(
|
|||||||
break;
|
break;
|
||||||
case PROP_MAX_APDU_LENGTH_ACCEPTED:
|
case PROP_MAX_APDU_LENGTH_ACCEPTED:
|
||||||
apdu_len =
|
apdu_len =
|
||||||
encode_application_unsigned(&apdu[0],
|
encode_application_unsigned(&apdu[0],MAX_APDU);
|
||||||
Device_Max_APDU_Length_Accepted());
|
|
||||||
break;
|
break;
|
||||||
case PROP_SEGMENTATION_SUPPORTED:
|
case PROP_SEGMENTATION_SUPPORTED:
|
||||||
apdu_len =
|
apdu_len =
|
||||||
@@ -851,11 +815,11 @@ int Device_Encode_Property_APDU(
|
|||||||
Device_Segmentation_Supported());
|
Device_Segmentation_Supported());
|
||||||
break;
|
break;
|
||||||
case PROP_APDU_TIMEOUT:
|
case PROP_APDU_TIMEOUT:
|
||||||
apdu_len = encode_application_unsigned(&apdu[0], APDU_Timeout);
|
apdu_len = encode_application_unsigned(&apdu[0], apdu_timeout());
|
||||||
break;
|
break;
|
||||||
case PROP_NUMBER_OF_APDU_RETRIES:
|
case PROP_NUMBER_OF_APDU_RETRIES:
|
||||||
apdu_len =
|
apdu_len =
|
||||||
encode_application_unsigned(&apdu[0], Number_Of_APDU_Retries);
|
encode_application_unsigned(&apdu[0], apdu_retries());
|
||||||
break;
|
break;
|
||||||
case PROP_DEVICE_ADDRESS_BINDING:
|
case PROP_DEVICE_ADDRESS_BINDING:
|
||||||
/* FIXME: encode the list here, if it exists */
|
/* FIXME: encode the list here, if it exists */
|
||||||
@@ -930,7 +894,7 @@ bool Device_Write_Property(
|
|||||||
case PROP_NUMBER_OF_APDU_RETRIES:
|
case PROP_NUMBER_OF_APDU_RETRIES:
|
||||||
if (value.tag == BACNET_APPLICATION_TAG_UNSIGNED_INT) {
|
if (value.tag == BACNET_APPLICATION_TAG_UNSIGNED_INT) {
|
||||||
/* FIXME: bounds check? */
|
/* FIXME: bounds check? */
|
||||||
Device_Set_Number_Of_APDU_Retries((uint8_t) value.type.
|
apdu_retries_set((uint8_t) value.type.
|
||||||
Unsigned_Int);
|
Unsigned_Int);
|
||||||
status = true;
|
status = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -941,7 +905,7 @@ bool Device_Write_Property(
|
|||||||
case PROP_APDU_TIMEOUT:
|
case PROP_APDU_TIMEOUT:
|
||||||
if (value.tag == BACNET_APPLICATION_TAG_UNSIGNED_INT) {
|
if (value.tag == BACNET_APPLICATION_TAG_UNSIGNED_INT) {
|
||||||
/* FIXME: bounds check? */
|
/* FIXME: bounds check? */
|
||||||
Device_Set_APDU_Timeout((uint16_t) value.type.Unsigned_Int);
|
apdu_timeout_set((uint16_t) value.type.Unsigned_Int);
|
||||||
status = true;
|
status = true;
|
||||||
} else {
|
} else {
|
||||||
*error_class = ERROR_CLASS_PROPERTY;
|
*error_class = ERROR_CLASS_PROPERTY;
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ int main(int argc, char *argv[]) {
|
|||||||
/* configure the timeout values */
|
/* configure the timeout values */
|
||||||
last_seconds = time(NULL);
|
last_seconds = time(NULL);
|
||||||
timeout_seconds =
|
timeout_seconds =
|
||||||
(Device_APDU_Timeout() / 1000) * Device_Number_Of_APDU_Retries();
|
(apdu_timeout() / 1000) * apdu_retries();
|
||||||
/* try to bind with the device */
|
/* try to bind with the device */
|
||||||
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance);
|
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance);
|
||||||
/* loop forever */
|
/* loop forever */
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ int main(int argc, char *argv[]) {
|
|||||||
/* configure the timeout values */
|
/* configure the timeout values */
|
||||||
last_seconds = time(NULL);
|
last_seconds = time(NULL);
|
||||||
timeout_seconds =
|
timeout_seconds =
|
||||||
(Device_APDU_Timeout() / 1000) * Device_Number_Of_APDU_Retries();
|
(apdu_timeout() / 1000) * apdu_retries();
|
||||||
/* try to bind with the device */
|
/* try to bind with the device */
|
||||||
found =
|
found =
|
||||||
address_bind_request(Target_Device_Object_Instance, &max_apdu,
|
address_bind_request(Target_Device_Object_Instance, &max_apdu,
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ int main(int argc, char *argv[]) {
|
|||||||
/* configure the timeout values */
|
/* configure the timeout values */
|
||||||
last_seconds = time(NULL);
|
last_seconds = time(NULL);
|
||||||
timeout_seconds =
|
timeout_seconds =
|
||||||
(Device_APDU_Timeout() / 1000) * Device_Number_Of_APDU_Retries();
|
(apdu_timeout() / 1000) * apdu_retries();
|
||||||
/* try to bind with the device */
|
/* try to bind with the device */
|
||||||
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance);
|
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance);
|
||||||
/* loop forever */
|
/* loop forever */
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ int main(int argc, char *argv[]) {
|
|||||||
Init_DataLink();
|
Init_DataLink();
|
||||||
/* configure the timeout values */
|
/* configure the timeout values */
|
||||||
last_seconds = time(NULL);
|
last_seconds = time(NULL);
|
||||||
timeout_seconds = Device_APDU_Timeout() / 1000;
|
timeout_seconds = apdu_timeout() / 1000;
|
||||||
/* send the request */
|
/* send the request */
|
||||||
time(&rawtime);
|
time(&rawtime);
|
||||||
my_time = localtime(&rawtime);
|
my_time = localtime(&rawtime);
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ int main(int argc, char *argv[]) {
|
|||||||
Init_DataLink();
|
Init_DataLink();
|
||||||
/* configure the timeout values */
|
/* configure the timeout values */
|
||||||
last_seconds = time(NULL);
|
last_seconds = time(NULL);
|
||||||
timeout_seconds = Device_APDU_Timeout() / 1000;
|
timeout_seconds = apdu_timeout() / 1000;
|
||||||
/* send the request */
|
/* send the request */
|
||||||
if (argc < 3)
|
if (argc < 3)
|
||||||
Send_WhoHas_Name(-1, -1, Target_Object_Name);
|
Send_WhoHas_Name(-1, -1, Target_Object_Name);
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ int main(int argc, char *argv[]) {
|
|||||||
Init_DataLink();
|
Init_DataLink();
|
||||||
/* configure the timeout values */
|
/* configure the timeout values */
|
||||||
last_seconds = time(NULL);
|
last_seconds = time(NULL);
|
||||||
timeout_seconds = Device_APDU_Timeout() / 1000;
|
timeout_seconds = apdu_timeout() / 1000;
|
||||||
/* send the request */
|
/* send the request */
|
||||||
Send_WhoIs(Target_Object_Instance_Min, Target_Object_Instance_Max);
|
Send_WhoIs(Target_Object_Instance_Min, Target_Object_Instance_Max);
|
||||||
/* loop forever */
|
/* loop forever */
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ int main(int argc, char *argv[]) {
|
|||||||
/* configure the timeout values */
|
/* configure the timeout values */
|
||||||
last_seconds = time(NULL);
|
last_seconds = time(NULL);
|
||||||
timeout_seconds =
|
timeout_seconds =
|
||||||
(Device_APDU_Timeout() / 1000) * Device_Number_Of_APDU_Retries();
|
(apdu_timeout() / 1000) * apdu_retries();
|
||||||
/* try to bind with the device */
|
/* try to bind with the device */
|
||||||
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance);
|
Send_WhoIs(Target_Device_Object_Instance, Target_Device_Object_Instance);
|
||||||
/* loop forever */
|
/* loop forever */
|
||||||
|
|||||||
@@ -403,7 +403,7 @@ int main(int argc, char *argv[]) {
|
|||||||
/* configure the timeout values */
|
/* configure the timeout values */
|
||||||
last_seconds = time(NULL);
|
last_seconds = time(NULL);
|
||||||
timeout_seconds =
|
timeout_seconds =
|
||||||
(Device_APDU_Timeout() / 1000) * Device_Number_Of_APDU_Retries();
|
(apdu_timeout() / 1000) * apdu_retries();
|
||||||
/* try to bind with the device */
|
/* try to bind with the device */
|
||||||
found =
|
found =
|
||||||
address_bind_request(Target_Device_Object_Instance, &max_apdu,
|
address_bind_request(Target_Device_Object_Instance, &max_apdu,
|
||||||
|
|||||||
@@ -176,6 +176,11 @@ extern "C" {
|
|||||||
uint8_t ** service_request,
|
uint8_t ** service_request,
|
||||||
uint16_t * service_request_len);
|
uint16_t * service_request_len);
|
||||||
|
|
||||||
|
uint16_t apdu_timeout(void);
|
||||||
|
void apdu_timeout_set(uint16_t value);
|
||||||
|
uint8_t apdu_retries(void);
|
||||||
|
void apdu_retries_set(uint8_t value);
|
||||||
|
|
||||||
void apdu_handler(
|
void apdu_handler(
|
||||||
BACNET_ADDRESS * src, /* source address */
|
BACNET_ADDRESS * src, /* source address */
|
||||||
uint8_t * apdu, /* APDU data */
|
uint8_t * apdu, /* APDU data */
|
||||||
|
|||||||
@@ -105,21 +105,9 @@ extern "C" {
|
|||||||
void);
|
void);
|
||||||
uint8_t Device_Protocol_Revision(
|
uint8_t Device_Protocol_Revision(
|
||||||
void);
|
void);
|
||||||
uint16_t Device_Max_APDU_Length_Accepted(
|
|
||||||
void);
|
|
||||||
BACNET_SEGMENTATION Device_Segmentation_Supported(
|
BACNET_SEGMENTATION Device_Segmentation_Supported(
|
||||||
void);
|
void);
|
||||||
|
|
||||||
uint16_t Device_APDU_Timeout(
|
|
||||||
void);
|
|
||||||
void Device_Set_APDU_Timeout(
|
|
||||||
uint16_t timeout);
|
|
||||||
|
|
||||||
uint8_t Device_Number_Of_APDU_Retries(
|
|
||||||
void);
|
|
||||||
void Device_Set_Number_Of_APDU_Retries(
|
|
||||||
uint8_t retries);
|
|
||||||
|
|
||||||
uint8_t Device_Database_Revision(
|
uint8_t Device_Database_Revision(
|
||||||
void);
|
void);
|
||||||
void Device_Set_Database_Revision(
|
void Device_Set_Database_Revision(
|
||||||
|
|||||||
@@ -137,32 +137,12 @@ uint8_t Device_Protocol_Revision(
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: MAX_APDU is defined in config.ini - set it! */
|
|
||||||
uint16_t Device_Max_APDU_Length_Accepted(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return MAX_APDU;
|
|
||||||
}
|
|
||||||
|
|
||||||
BACNET_SEGMENTATION Device_Segmentation_Supported(
|
BACNET_SEGMENTATION Device_Segmentation_Supported(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
return SEGMENTATION_NONE;
|
return SEGMENTATION_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t Device_APDU_Timeout(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return 60000;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
uint8_t Device_Number_Of_APDU_Retries(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t Device_Database_Revision(
|
uint8_t Device_Database_Revision(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
@@ -418,8 +398,7 @@ int Device_Encode_Property_APDU(
|
|||||||
break;
|
break;
|
||||||
case PROP_MAX_APDU_LENGTH_ACCEPTED:
|
case PROP_MAX_APDU_LENGTH_ACCEPTED:
|
||||||
apdu_len =
|
apdu_len =
|
||||||
encode_application_unsigned(&apdu[0],
|
encode_application_unsigned(&apdu[0], MAX_APDU);
|
||||||
Device_Max_APDU_Length_Accepted());
|
|
||||||
break;
|
break;
|
||||||
case PROP_SEGMENTATION_SUPPORTED:
|
case PROP_SEGMENTATION_SUPPORTED:
|
||||||
apdu_len =
|
apdu_len =
|
||||||
@@ -428,12 +407,12 @@ int Device_Encode_Property_APDU(
|
|||||||
break;
|
break;
|
||||||
case PROP_APDU_TIMEOUT:
|
case PROP_APDU_TIMEOUT:
|
||||||
apdu_len =
|
apdu_len =
|
||||||
encode_application_unsigned(&apdu[0], Device_APDU_Timeout());
|
encode_application_unsigned(&apdu[0], apdu_timeout());
|
||||||
break;
|
break;
|
||||||
case PROP_NUMBER_OF_APDU_RETRIES:
|
case PROP_NUMBER_OF_APDU_RETRIES:
|
||||||
apdu_len =
|
apdu_len =
|
||||||
encode_application_unsigned(&apdu[0],
|
encode_application_unsigned(&apdu[0],
|
||||||
Device_Number_Of_APDU_Retries());
|
apdu_retries());
|
||||||
break;
|
break;
|
||||||
case PROP_DEVICE_ADDRESS_BINDING:
|
case PROP_DEVICE_ADDRESS_BINDING:
|
||||||
/* FIXME: encode the list here, if it exists */
|
/* FIXME: encode the list here, if it exists */
|
||||||
|
|||||||
@@ -137,32 +137,12 @@ uint8_t Device_Protocol_Revision(
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: MAX_APDU is defined in config.ini - set it! */
|
|
||||||
uint16_t Device_Max_APDU_Length_Accepted(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return MAX_APDU;
|
|
||||||
}
|
|
||||||
|
|
||||||
BACNET_SEGMENTATION Device_Segmentation_Supported(
|
BACNET_SEGMENTATION Device_Segmentation_Supported(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
return SEGMENTATION_NONE;
|
return SEGMENTATION_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t Device_APDU_Timeout(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return 60000;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
uint8_t Device_Number_Of_APDU_Retries(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t Device_Database_Revision(
|
uint8_t Device_Database_Revision(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
@@ -430,8 +410,7 @@ int Device_Encode_Property_APDU(
|
|||||||
break;
|
break;
|
||||||
case PROP_MAX_APDU_LENGTH_ACCEPTED:
|
case PROP_MAX_APDU_LENGTH_ACCEPTED:
|
||||||
apdu_len =
|
apdu_len =
|
||||||
encode_application_unsigned(&apdu[0],
|
encode_application_unsigned(&apdu[0], MAX_APDU);
|
||||||
Device_Max_APDU_Length_Accepted());
|
|
||||||
break;
|
break;
|
||||||
case PROP_SEGMENTATION_SUPPORTED:
|
case PROP_SEGMENTATION_SUPPORTED:
|
||||||
apdu_len =
|
apdu_len =
|
||||||
@@ -440,12 +419,12 @@ int Device_Encode_Property_APDU(
|
|||||||
break;
|
break;
|
||||||
case PROP_APDU_TIMEOUT:
|
case PROP_APDU_TIMEOUT:
|
||||||
apdu_len =
|
apdu_len =
|
||||||
encode_application_unsigned(&apdu[0], Device_APDU_Timeout());
|
encode_application_unsigned(&apdu[0], apdu_timeout());
|
||||||
break;
|
break;
|
||||||
case PROP_NUMBER_OF_APDU_RETRIES:
|
case PROP_NUMBER_OF_APDU_RETRIES:
|
||||||
apdu_len =
|
apdu_len =
|
||||||
encode_application_unsigned(&apdu[0],
|
encode_application_unsigned(&apdu[0],
|
||||||
Device_Number_Of_APDU_Retries());
|
apdu_retries());
|
||||||
break;
|
break;
|
||||||
case PROP_DEVICE_ADDRESS_BINDING:
|
case PROP_DEVICE_ADDRESS_BINDING:
|
||||||
/* FIXME: encode the list here, if it exists */
|
/* FIXME: encode the list here, if it exists */
|
||||||
|
|||||||
@@ -43,6 +43,11 @@
|
|||||||
#include "dcc.h"
|
#include "dcc.h"
|
||||||
#include "iam.h"
|
#include "iam.h"
|
||||||
|
|
||||||
|
/* APDU Timeout in Milliseconds */
|
||||||
|
static uint16_t Timeout_Milliseconds = 3000;
|
||||||
|
/* Number of APDU Retries */
|
||||||
|
static uint8_t Number_Of_Retries = 3;
|
||||||
|
|
||||||
/* a simple table for crossing the services supported */
|
/* a simple table for crossing the services supported */
|
||||||
static BACNET_SERVICES_SUPPORTED
|
static BACNET_SERVICES_SUPPORTED
|
||||||
confirmed_service_supported[MAX_BACNET_CONFIRMED_SERVICE] = {
|
confirmed_service_supported[MAX_BACNET_CONFIRMED_SERVICE] = {
|
||||||
@@ -280,6 +285,26 @@ uint16_t apdu_decode_confirmed_service_request(
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t apdu_timeout(void)
|
||||||
|
{
|
||||||
|
return Timeout_Milliseconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
void apdu_timeout_set(uint16_t milliseconds)
|
||||||
|
{
|
||||||
|
Timeout_Milliseconds = milliseconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t apdu_retries(void)
|
||||||
|
{
|
||||||
|
return Number_Of_Retries;
|
||||||
|
}
|
||||||
|
|
||||||
|
void apdu_retries_set(uint8_t value)
|
||||||
|
{
|
||||||
|
Number_Of_Retries = value;
|
||||||
|
}
|
||||||
|
|
||||||
void apdu_handler(
|
void apdu_handler(
|
||||||
BACNET_ADDRESS * src,
|
BACNET_ADDRESS * src,
|
||||||
uint8_t * apdu, /* APDU data */
|
uint8_t * apdu, /* APDU data */
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
#include "bacenum.h"
|
#include "bacenum.h"
|
||||||
#include "bacdcode.h"
|
#include "bacdcode.h"
|
||||||
#include "bacdef.h"
|
#include "bacdef.h"
|
||||||
#include "device.h"
|
|
||||||
#include "arf.h"
|
#include "arf.h"
|
||||||
|
|
||||||
/* Atomic Read File */
|
/* Atomic Read File */
|
||||||
@@ -51,7 +50,7 @@ int arf_encode_apdu(
|
|||||||
if (apdu) {
|
if (apdu) {
|
||||||
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
|
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
|
||||||
apdu[1] =
|
apdu[1] =
|
||||||
encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted());
|
encode_max_segs_max_apdu(0, MAX_APDU);
|
||||||
apdu[2] = invoke_id;
|
apdu[2] = invoke_id;
|
||||||
apdu[3] = SERVICE_CONFIRMED_ATOMIC_READ_FILE; /* service choice */
|
apdu[3] = SERVICE_CONFIRMED_ATOMIC_READ_FILE; /* service choice */
|
||||||
apdu_len = 4;
|
apdu_len = 4;
|
||||||
@@ -185,7 +184,7 @@ int arf_decode_apdu(
|
|||||||
/* optional checking - most likely was already done prior to this call */
|
/* optional checking - most likely was already done prior to this call */
|
||||||
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
||||||
return -1;
|
return -1;
|
||||||
/* apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted()); */
|
/* apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU); */
|
||||||
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
||||||
if (apdu[3] != SERVICE_CONFIRMED_ATOMIC_READ_FILE)
|
if (apdu[3] != SERVICE_CONFIRMED_ATOMIC_READ_FILE)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -497,12 +496,6 @@ void testAtomicReadFile(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TEST_ATOMIC_READ_FILE
|
#ifdef TEST_ATOMIC_READ_FILE
|
||||||
uint16_t Device_Max_APDU_Length_Accepted(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return MAX_APDU;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(
|
int main(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-10
@@ -35,7 +35,6 @@
|
|||||||
#include "bacenum.h"
|
#include "bacenum.h"
|
||||||
#include "bacdcode.h"
|
#include "bacdcode.h"
|
||||||
#include "bacdef.h"
|
#include "bacdef.h"
|
||||||
#include "device.h"
|
|
||||||
#include "awf.h"
|
#include "awf.h"
|
||||||
|
|
||||||
/* Atomic Write File */
|
/* Atomic Write File */
|
||||||
@@ -50,8 +49,7 @@ int awf_encode_apdu(
|
|||||||
|
|
||||||
if (apdu) {
|
if (apdu) {
|
||||||
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
|
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
|
||||||
apdu[1] =
|
apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU);
|
||||||
encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted());
|
|
||||||
apdu[2] = invoke_id;
|
apdu[2] = invoke_id;
|
||||||
apdu[3] = SERVICE_CONFIRMED_ATOMIC_WRITE_FILE; /* service choice */
|
apdu[3] = SERVICE_CONFIRMED_ATOMIC_WRITE_FILE; /* service choice */
|
||||||
apdu_len = 4;
|
apdu_len = 4;
|
||||||
@@ -198,7 +196,7 @@ int awf_decode_apdu(
|
|||||||
/* optional checking - most likely was already done prior to this call */
|
/* optional checking - most likely was already done prior to this call */
|
||||||
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
||||||
return -1;
|
return -1;
|
||||||
/* apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted()); */
|
/* apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU); */
|
||||||
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
||||||
if (apdu[3] != SERVICE_CONFIRMED_ATOMIC_WRITE_FILE)
|
if (apdu[3] != SERVICE_CONFIRMED_ATOMIC_WRITE_FILE)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -419,12 +417,6 @@ void testAtomicWriteFileAck(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TEST_ATOMIC_WRITE_FILE
|
#ifdef TEST_ATOMIC_WRITE_FILE
|
||||||
uint16_t Device_Max_APDU_Length_Accepted(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return MAX_APDU;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(
|
int main(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
|
|||||||
+6
-16
@@ -37,7 +37,6 @@
|
|||||||
#include "bacdef.h"
|
#include "bacdef.h"
|
||||||
#include "bacapp.h"
|
#include "bacapp.h"
|
||||||
#include "cov.h"
|
#include "cov.h"
|
||||||
#include "device.h"
|
|
||||||
#include "datalink.h"
|
#include "datalink.h"
|
||||||
#include "npdu.h"
|
#include "npdu.h"
|
||||||
|
|
||||||
@@ -132,11 +131,10 @@ int ccov_notify_encode_apdu(
|
|||||||
{
|
{
|
||||||
int len = 0; /* length of each encoding */
|
int len = 0; /* length of each encoding */
|
||||||
int apdu_len = 0; /* total length of the apdu, return value */
|
int apdu_len = 0; /* total length of the apdu, return value */
|
||||||
uint16_t max_apdu = Device_Max_APDU_Length_Accepted();
|
|
||||||
|
|
||||||
if (apdu) {
|
if (apdu) {
|
||||||
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
|
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
|
||||||
apdu[1] = encode_max_segs_max_apdu(0, max_apdu);
|
apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU);
|
||||||
apdu[2] = invoke_id;
|
apdu[2] = invoke_id;
|
||||||
apdu[3] = SERVICE_CONFIRMED_COV_NOTIFICATION;
|
apdu[3] = SERVICE_CONFIRMED_COV_NOTIFICATION;
|
||||||
apdu_len = 4;
|
apdu_len = 4;
|
||||||
@@ -314,11 +312,10 @@ int cov_subscribe_encode_adpu(
|
|||||||
{
|
{
|
||||||
int len = 0; /* length of each encoding */
|
int len = 0; /* length of each encoding */
|
||||||
int apdu_len = 0; /* total length of the apdu, return value */
|
int apdu_len = 0; /* total length of the apdu, return value */
|
||||||
uint16_t max_apdu = Device_Max_APDU_Length_Accepted();
|
|
||||||
|
|
||||||
if (apdu && data) {
|
if (apdu && data) {
|
||||||
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
|
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
|
||||||
apdu[1] = encode_max_segs_max_apdu(0, max_apdu);
|
apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU);
|
||||||
apdu[2] = invoke_id;
|
apdu[2] = invoke_id;
|
||||||
apdu[3] = SERVICE_CONFIRMED_SUBSCRIBE_COV;
|
apdu[3] = SERVICE_CONFIRMED_SUBSCRIBE_COV;
|
||||||
apdu_len = 4;
|
apdu_len = 4;
|
||||||
@@ -444,11 +441,10 @@ int cov_subscribe_property_encode_adpu(
|
|||||||
{
|
{
|
||||||
int len = 0; /* length of each encoding */
|
int len = 0; /* length of each encoding */
|
||||||
int apdu_len = 0; /* total length of the apdu, return value */
|
int apdu_len = 0; /* total length of the apdu, return value */
|
||||||
uint16_t max_apdu = Device_Max_APDU_Length_Accepted();
|
|
||||||
|
|
||||||
if (apdu && data) {
|
if (apdu && data) {
|
||||||
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
|
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
|
||||||
apdu[1] = encode_max_segs_max_apdu(0, max_apdu);
|
apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU);
|
||||||
apdu[2] = invoke_id;
|
apdu[2] = invoke_id;
|
||||||
apdu[3] = SERVICE_CONFIRMED_SUBSCRIBE_COV_PROPERTY;
|
apdu[3] = SERVICE_CONFIRMED_SUBSCRIBE_COV_PROPERTY;
|
||||||
apdu_len = 4;
|
apdu_len = 4;
|
||||||
@@ -641,7 +637,7 @@ int ccov_notify_decode_apdu(
|
|||||||
/* optional checking - most likely was already done prior to this call */
|
/* optional checking - most likely was already done prior to this call */
|
||||||
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
||||||
return -2;
|
return -2;
|
||||||
/* apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted()); */
|
/* apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU); */
|
||||||
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
||||||
if (apdu[3] != SERVICE_CONFIRMED_COV_NOTIFICATION)
|
if (apdu[3] != SERVICE_CONFIRMED_COV_NOTIFICATION)
|
||||||
return -3;
|
return -3;
|
||||||
@@ -697,7 +693,7 @@ int cov_subscribe_decode_apdu(
|
|||||||
/* optional checking - most likely was already done prior to this call */
|
/* optional checking - most likely was already done prior to this call */
|
||||||
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
||||||
return -2;
|
return -2;
|
||||||
/* apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted()); */
|
/* apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU); */
|
||||||
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
||||||
if (apdu[3] != SERVICE_CONFIRMED_SUBSCRIBE_COV)
|
if (apdu[3] != SERVICE_CONFIRMED_SUBSCRIBE_COV)
|
||||||
return -3;
|
return -3;
|
||||||
@@ -727,7 +723,7 @@ int cov_subscribe_property_decode_apdu(
|
|||||||
/* optional checking - most likely was already done prior to this call */
|
/* optional checking - most likely was already done prior to this call */
|
||||||
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
||||||
return -2;
|
return -2;
|
||||||
/* apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted()); */
|
/* apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU); */
|
||||||
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
||||||
if (apdu[3] != SERVICE_CONFIRMED_SUBSCRIBE_COV_PROPERTY)
|
if (apdu[3] != SERVICE_CONFIRMED_SUBSCRIBE_COV_PROPERTY)
|
||||||
return -3;
|
return -3;
|
||||||
@@ -784,12 +780,6 @@ void datalink_get_broadcast_address(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* dummy function stubs */
|
/* dummy function stubs */
|
||||||
uint16_t Device_Max_APDU_Length_Accepted(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return MAX_APDU;
|
|
||||||
}
|
|
||||||
|
|
||||||
void testCOVNotifyData(
|
void testCOVNotifyData(
|
||||||
Test * pTest,
|
Test * pTest,
|
||||||
BACNET_COV_DATA * data,
|
BACNET_COV_DATA * data,
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ int dcc_decode_apdu(
|
|||||||
/* optional checking - most likely was already done prior to this call */
|
/* optional checking - most likely was already done prior to this call */
|
||||||
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
||||||
return -1;
|
return -1;
|
||||||
/* apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted()); */
|
/* apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU); */
|
||||||
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
||||||
if (apdu[3] != SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL)
|
if (apdu[3] != SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ int rd_decode_apdu(
|
|||||||
/* optional checking - most likely was already done prior to this call */
|
/* optional checking - most likely was already done prior to this call */
|
||||||
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
||||||
return -1;
|
return -1;
|
||||||
/* apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted()); */
|
/* apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU); */
|
||||||
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
||||||
if (apdu[3] != SERVICE_CONFIRMED_REINITIALIZE_DEVICE)
|
if (apdu[3] != SERVICE_CONFIRMED_REINITIALIZE_DEVICE)
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ int rp_decode_apdu(
|
|||||||
/* optional checking - most likely was already done prior to this call */
|
/* optional checking - most likely was already done prior to this call */
|
||||||
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
||||||
return -1;
|
return -1;
|
||||||
/* apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted()); */
|
/* apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU); */
|
||||||
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
||||||
if (apdu[3] != SERVICE_CONFIRMED_READ_PROPERTY)
|
if (apdu[3] != SERVICE_CONFIRMED_READ_PROPERTY)
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ int rpm_decode_apdu(
|
|||||||
/* optional checking - most likely was already done prior to this call */
|
/* optional checking - most likely was already done prior to this call */
|
||||||
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
||||||
return -1;
|
return -1;
|
||||||
/* apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted()); */
|
/* apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU); */
|
||||||
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
||||||
if (apdu[3] != SERVICE_CONFIRMED_READ_PROP_MULTIPLE)
|
if (apdu[3] != SERVICE_CONFIRMED_READ_PROP_MULTIPLE)
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -42,7 +42,6 @@
|
|||||||
#include "bacenum.h"
|
#include "bacenum.h"
|
||||||
#include "tsm.h"
|
#include "tsm.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "device.h"
|
|
||||||
#include "datalink.h"
|
#include "datalink.h"
|
||||||
#include "handlers.h"
|
#include "handlers.h"
|
||||||
#include "address.h"
|
#include "address.h"
|
||||||
@@ -151,7 +150,7 @@ uint8_t tsm_next_free_invokeID(
|
|||||||
if (index != MAX_TSM_TRANSACTIONS) {
|
if (index != MAX_TSM_TRANSACTIONS) {
|
||||||
TSM_List[index].InvokeID = invokeID = current_invokeID;
|
TSM_List[index].InvokeID = invokeID = current_invokeID;
|
||||||
TSM_List[index].state = TSM_STATE_IDLE;
|
TSM_List[index].state = TSM_STATE_IDLE;
|
||||||
TSM_List[index].RequestTimer = Device_APDU_Timeout();
|
TSM_List[index].RequestTimer = apdu_timeout();
|
||||||
/* update for the next call or check */
|
/* update for the next call or check */
|
||||||
current_invokeID++;
|
current_invokeID++;
|
||||||
/* skip zero - we treat that internally as invalid or no free */
|
/* skip zero - we treat that internally as invalid or no free */
|
||||||
@@ -189,9 +188,9 @@ void tsm_set_confirmed_unsegmented_transaction(
|
|||||||
if (index < MAX_TSM_TRANSACTIONS) {
|
if (index < MAX_TSM_TRANSACTIONS) {
|
||||||
/* assign the transaction */
|
/* assign the transaction */
|
||||||
TSM_List[index].state = TSM_STATE_AWAIT_CONFIRMATION;
|
TSM_List[index].state = TSM_STATE_AWAIT_CONFIRMATION;
|
||||||
TSM_List[index].RetryCount = Device_Number_Of_APDU_Retries();
|
TSM_List[index].RetryCount = apdu_retries();
|
||||||
/* start the timer */
|
/* start the timer */
|
||||||
TSM_List[index].RequestTimer = Device_APDU_Timeout();
|
TSM_List[index].RequestTimer = apdu_timeout();
|
||||||
/* copy the data */
|
/* copy the data */
|
||||||
for (j = 0; j < apdu_len; j++) {
|
for (j = 0; j < apdu_len; j++) {
|
||||||
TSM_List[index].apdu[j] = apdu[j];
|
TSM_List[index].apdu[j] = apdu[j];
|
||||||
@@ -254,7 +253,7 @@ void tsm_timer_milliseconds(
|
|||||||
/* timeout. retry? */
|
/* timeout. retry? */
|
||||||
if (TSM_List[i].RequestTimer == 0) {
|
if (TSM_List[i].RequestTimer == 0) {
|
||||||
TSM_List[i].RetryCount--;
|
TSM_List[i].RetryCount--;
|
||||||
TSM_List[i].RequestTimer = Device_APDU_Timeout();
|
TSM_List[i].RequestTimer = apdu_timeout();
|
||||||
if (TSM_List[i].RetryCount) {
|
if (TSM_List[i].RetryCount) {
|
||||||
bytes_sent =
|
bytes_sent =
|
||||||
datalink_send_pdu(&TSM_List[i].dest,
|
datalink_send_pdu(&TSM_List[i].dest,
|
||||||
|
|||||||
+2
-10
@@ -35,7 +35,6 @@
|
|||||||
#include "bacenum.h"
|
#include "bacenum.h"
|
||||||
#include "bacdcode.h"
|
#include "bacdcode.h"
|
||||||
#include "bacdef.h"
|
#include "bacdef.h"
|
||||||
#include "device.h"
|
|
||||||
#include "wp.h"
|
#include "wp.h"
|
||||||
|
|
||||||
/* encode service */
|
/* encode service */
|
||||||
@@ -49,8 +48,7 @@ int wp_encode_apdu(
|
|||||||
|
|
||||||
if (apdu) {
|
if (apdu) {
|
||||||
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
|
apdu[0] = PDU_TYPE_CONFIRMED_SERVICE_REQUEST;
|
||||||
apdu[1] =
|
apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU);
|
||||||
encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted());
|
|
||||||
apdu[2] = invoke_id;
|
apdu[2] = invoke_id;
|
||||||
apdu[3] = SERVICE_CONFIRMED_WRITE_PROPERTY; /* service choice */
|
apdu[3] = SERVICE_CONFIRMED_WRITE_PROPERTY; /* service choice */
|
||||||
apdu_len = 4;
|
apdu_len = 4;
|
||||||
@@ -194,7 +192,7 @@ int wp_decode_apdu(
|
|||||||
/* optional checking - most likely was already done prior to this call */
|
/* optional checking - most likely was already done prior to this call */
|
||||||
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
if (apdu[0] != PDU_TYPE_CONFIRMED_SERVICE_REQUEST)
|
||||||
return -1;
|
return -1;
|
||||||
/* apdu[1] = encode_max_segs_max_apdu(0, Device_Max_APDU_Length_Accepted()); */
|
/* apdu[1] = encode_max_segs_max_apdu(0, MAX_APDU); */
|
||||||
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
*invoke_id = apdu[2]; /* invoke id - filled in by net layer */
|
||||||
if (apdu[3] != SERVICE_CONFIRMED_WRITE_PROPERTY)
|
if (apdu[3] != SERVICE_CONFIRMED_WRITE_PROPERTY)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -365,12 +363,6 @@ void testWriteProperty(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TEST_WRITE_PROPERTY
|
#ifdef TEST_WRITE_PROPERTY
|
||||||
uint16_t Device_Max_APDU_Length_Accepted(
|
|
||||||
void)
|
|
||||||
{
|
|
||||||
return MAX_APDU;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(
|
int main(
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user