From 74d710b8b78e9555227e1f15346afb6cc0c80297 Mon Sep 17 00:00:00 2001 From: Lars Danielsson Date: Wed, 23 Sep 2020 13:24:11 +0200 Subject: [PATCH] Add more data types which may have flexible length Change-Id: Ia78d89adfb4017e970ace7fdf0b1bccffc8ac357 --- soes/esc_coe.c | 9 +++++++-- soes/esc_coe.h | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/soes/esc_coe.c b/soes/esc_coe.c index a3c4d01..58fe954 100644 --- a/soes/esc_coe.c +++ b/soes/esc_coe.c @@ -776,7 +776,8 @@ static void SDO_download (void) if (actsize != size) { /* entries with data types VISIBLE_STRING, OCTET_STRING, - * and UNICODE_STRING may have flexible length + * UNICODE_STRING, ARRAY_OF_INT, ARRAY_OF_SINT, + * ARRAY_OF_DINT, and ARRAY_OF_UDINT may have flexible length */ uint16_t type = (objd + nsub)->datatype; if (type == DTYPE_VISIBLE_STRING) @@ -785,7 +786,11 @@ static void SDO_download (void) memset((objd + nsub)->data + size, 0, actsize - size); } else if ((type != DTYPE_OCTET_STRING) && - (type != DTYPE_UNICODE_STRING)) + (type != DTYPE_UNICODE_STRING) && + (type != DTYPE_ARRAY_OF_INT) && + (type != DTYPE_ARRAY_OF_SINT) && + (type != DTYPE_ARRAY_OF_DINT) && + (type != DTYPE_ARRAY_OF_UDINT)) { set_state_idle (index, subindex, ABORT_TYPEMISMATCH); return; diff --git a/soes/esc_coe.h b/soes/esc_coe.h index 4d3af27..689750c 100644 --- a/soes/esc_coe.h +++ b/soes/esc_coe.h @@ -83,6 +83,10 @@ typedef struct #define DTYPE_BIT6 0x0035 #define DTYPE_BIT7 0x0036 #define DTYPE_BIT8 0x0037 +#define DTYPE_ARRAY_OF_INT 0x0260 +#define DTYPE_ARRAY_OF_SINT 0x0261 +#define DTYPE_ARRAY_OF_DINT 0x0262 +#define DTYPE_ARRAY_OF_UDINT 0x0263 #define ATYPE_Rpre 0x01 #define ATYPE_Rsafe 0x02