From b40c8028b166c0bc1bec464b932e6dfd3950ccbc Mon Sep 17 00:00:00 2001 From: Edward Wall Date: Mon, 8 Sep 2025 14:11:24 +0200 Subject: [PATCH] corrects array of strings serialised representation --- device/strayfield.cxx | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/device/strayfield.cxx b/device/strayfield.cxx index 602ea5e..4168d09 100644 --- a/device/strayfield.cxx +++ b/device/strayfield.cxx @@ -30,18 +30,13 @@ typedef struct { INT err_timeout; //!< error report interval in sec } STRAYFIELD_SETTINGS; -// TODO seems like the ODB code is broken. It doesn't seem to correctly parse -// the strings in an array... Seem below where I even try extracting via their -// logic the string, and it matches this format, but doesn't work again when -// importing. -// So you need to still specify the input names manually in the odb #define STRAYFIELD_SETTINGS_STR \ "\ Input Name = STRING[4] : \n\ -[32] Cobra Current\n\ -[32] Cobra Comp Coil\n\ -[32] Comet 1\n\ -[32] Comet 2\n\ +[32][0] Cobra Current\n\ +[32][1] Cobra Comp Coil\n\ +[32][2] Comet 1\n\ +[32][3] Comet 2\n\ Output Name = STRING : [32] Output\n\ MCAST_GROUP_COBRA = STRING : [32] 239.208.0.1\n\ MCAST_GROUP_COMET = STRING : [32] 239.208.0.2\n\ @@ -122,11 +117,6 @@ INT strayfield_in_init(HNDLE hKey, STRAYFIELD_INFO **pinfo, info->hKey = hKey; - char bufferstr[10000]; - size = sizeof(bufferstr); - db_copy(hDB, hKey, bufferstr, &size, "DD"); - printf(bufferstr); - // create settings record status = db_create_record(hDB, hKey, "DD", STRAYFIELD_SETTINGS_STR); if (status != DB_SUCCESS) {