setAdvertisting serviceData data length max? #5923
Replies: 1 comment
-
Posted at 2018-05-21 by Enclavet So actually I figured it out that I was running int he max_size of a single advertistment packet. I instead tried to split it up into 2 advertistment packets but it was not working right. Is the below code something that should work?
Posted at 2018-05-21 by @gfwilliams the code you have should work, but you're supplying an array with one element, so it'll only be sending one byte (0..255) worth of data. You can do:
which will transmit 4 bytes that can be reconstructed into a 32 bit int. Normally you'd have If you want something that looks a bit nicer you can use DataView instead of all the bit shifting too. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2018-05-20 by Enclavet
Trying to advertise last button press epoch time. Whenever I do something like the following:
Seems like the serviceData is only 2 bytes. Is this a known limitation of using advertising for data?
I am able to put large integers into the manufacturing data but i'm using that now and dont have enough room.
Beta Was this translation helpful? Give feedback.
All reactions