invalid numeric value
Hi, I want to thank you for this, even if I didn't manage to have it run so far.
I manage to pair to a Spark 3 watch but when I want to update the GPS with
./ttblue -d E4:04:39:82:7E:A0 --code=093203 --update-gps
I get the error
--code=093203: invalid numeric value
Ah… yeah… the issue is that the leading 0 gets interpreted as the prefix for an octal value. :man_facepalming:
Just don't include the leading zero and it should work fine.
Hmmm… actually I'm not sure if that's the case. I'm using scanf("%d%c", …) which should always interpret the argument as a decimal integer. https://stackoverflow.com/a/23123114/20789
Does excluding the leading 0 work?
What OS are you running?
Excluding the leading 0 worked!
Thank you very much for all this!
Thanks. Can you tell me what OS and libc you're using? This misinterpretation of %d as an octal integer shouldn't exist with a modern libc :frowning_face:
Ubuntu 18.04, libc6:amd64 2.27-3ubuntu1
Thanks. On closer review, I see that this is a problem with popt's parsing of integer option values, not with libc.
Leaving open while I think about this…
We can probably interpret the code as a string instead of int/uint32_t to make it work. I have something that seem to work over at https://github.com/Grimler91/ttblue/tree/dev3 but that branch is a bit messy. I'll split the changes up into 3 or 4 separate branches and open a couple of PRs tomorrow