+
+ int ibuf = 0;
+ uint8_t buf[256] = {0};
+ int res = CLIParamStrToBuf(argstr, buf, maxdatalen * 2, &ibuf); // *2 because here HEX
+ if (res || !ibuf)
+ return res;
+
+ switch(param_gethex_to_eol((char *)buf, 0, data, maxdatalen, datalen)) {
+ case 1:
+ printf("Parameter error: Invalid HEX value.\n");
+ return 1;
+ case 2:
+ printf("Parameter error: parameter too large.\n");
+ return 2;
+ case 3:
+ printf("Parameter error: Hex string must have even number of digits.\n");
+ return 3;
+ }
+
+ return 0;
+}
+
+int CLIParamStrToBuf(struct arg_str *argstr, uint8_t *data, int maxdatalen, int *datalen) {
+ *datalen = 0;