Can we increase the packet size in Nrf52 Beacon example ? I want to send UUID=16 Bytes + Major=4 Bytes, Minor= 4 Bytes + RSSI= 1 Byte i.e Total =25 Bytes. I am using SDK13.
Can we increase the packet size in Nrf52 Beacon example ? I want to send UUID=16 Bytes + Major=4 Bytes, Minor= 4 Bytes + RSSI= 1 Byte i.e Total =25 Bytes. I am using SDK13.
Hello,
You may not increase the advertising packet size over its 31 byte limit. You should also keep in mind that there are 2 byte overhead with each bitfield, that you must also send.
Please see this previous ticket on the subject - it is old, but still relevant.
Or, could it be that you are asking about Advertising extension?
Best regards,
Karl
What are all included in those 31 bytes ?
What are all included in those 31 bytes ?
I am not sure I understand what you are asking here.
The contents of the advertising packets must be defined by yourself, and may not exceed 31 bytes - which is my answer to your original question of "can we increase the packet size".
Each bit field must have both a type and length byte, in addition to their contents - this is what makes up their "2 byte overhead".
As an example, a 16-bit UUID will require 4 bytes of advertising packet space, since there is 1 type byte, 1 length byte and 2 UUID content bytes.
You might find the discussion in this ticket useful to have a look at.
Could you share the code snippet where you generate your advertising data, and perhaps also any errors you are encountering?
I highly recommend this tutorial by my colleague, for familiarizing with BLE advertising.
Best regards,
Karl
I know that the packet size should not exceed 31 bytes. But my question is can we remove few fields liked flags and increase the major and minor size ?
I made these changes #define
APP_BEACON_INFO_LENGTH 0x1D
#define APP_ADV_DATA_LENGTH 0x1B
after this its not working.
I think I don't have repeated question for you not to respond.
Hello,
Manoj Hiwarkar said:I think I don't have repeated question for you not to respond.
I will attempt to answer the questions you have raised.
Manoj Hiwarkar said:I made these changes
Are you working out of one of the Beacon example?
If so, please share all the changes you have made to the example.
The example already sends a 16 byte UUID, 2 byte Major, 2 byte Minor and measured RSSI. Could I ask why you are looking to increase the major and minor length?
The major and minor fields are just used to differentiate between different beacons, which 4 bytes should suffice to do, unless you are planning to have an enormous amount of beacons.
Manoj Hiwarkar said:I made these changes #define
APP_BEACON_INFO_LENGTH 0x1D
#define APP_ADV_DATA_LENGTH 0x1Bafter this its not working.
This does not give me anything to work with, since you make no mention of where or how you are using these defines. Furthermore, it would be beneficial if you were more specific regarding how it does not work - does it not compile or does it behave unexpectedly? If so, what is the unexpected behavior?
Manoj Hiwarkar said:But my question is can we remove few fields liked flags and increase the major and minor size ?
I think you will need at least 1 byte of flags, for your advertising packets - but you are free to attempt to remove it all together and see if it works, but I doubt it will.
Best regards,
Karl