cAT icon indicating copy to clipboard operation
cAT copied to clipboard

CAT_VAR_BUF_HEX Doesn't allow for uneven hex values.

Open juser19201 opened this issue 2 years ago • 2 comments

Hello,

While using your library, i've been trying to send hex values into a buffer using CAT_VAR_BUF_HEX. Every hex value i send over has to be even, for example if i send 0x123 it will ERROR, this needs to be changed to 0x1230.

juser19201 avatar Sep 07 '23 09:09 juser19201

0x123 is rather 0x0123, not 0x1230. is this a serious limitation? hex arrays are parsed runtime without buffering. so we dont know the final size of the array. so starting parsing from 123 we dont know if it is 0x01 or 0x12 at the beginning until we reach the end of the array. but at the end we cannot simply add "0" because the 0x123 is the different value than 0x1230. Thats why it accepts only even hex values.

marcinbor85 avatar Sep 07 '23 09:09 marcinbor85

Yes i stand corrected, i meant to say 0x0123. I still think that while this isn't a major limitation, if it is something you'd rather not change then somewhere in the documentation this should be stated, to remove any potential confusion in the future for new people using your library.

juser19201 avatar Sep 07 '23 09:09 juser19201