error 1: the advertisement packet length exceds the max length of...

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JoLo_1693126
Level 3
Level 3
First like received First like given

Hi all,

   

I have Cy8CKIT-042-BLE.

   

I have been following video 3 on http://www.cypress.com/training/how-make-ios-app-control-robot-using-bluetooth-low-energy-ble

   

When I configure my BLE GAP settings Peripheral role, advertisement packet, it give me the error, error 1: the advertisement packet length exceeds the max length of 31 bytes.

   

 

   

thanks,

   

J

0 Likes
1 Solution
Anonymous
Not applicable

Hi,

   

Advertisement packet size is 31 bytes max. Out of which only 22 bytes are in your hand, which includes service UUID and device name.

   

if 2 byte / 16-bit service UUID then max size of device name is 20 bytes

   

if 4 bytes / 32-bit service UUID then max size of device name is 18 bytes

   

if 16 bytes / 128-bit of service UUID then max size of device name is 6 bytes.

   

If you want to use 128-bit characteristics and also want to advertise with a longer name, use a 16-bit service only for advertisement purpose. By doing so you can use 128-bit Services, characteristics etc and can also advertise with al onger name i.e. 20 Characters.

View solution in original post

0 Likes
2 Replies
JoLo_1693126
Level 3
Level 3
First like received First like given

Solution: Shorten device name.

0 Likes
Anonymous
Not applicable

Hi,

   

Advertisement packet size is 31 bytes max. Out of which only 22 bytes are in your hand, which includes service UUID and device name.

   

if 2 byte / 16-bit service UUID then max size of device name is 20 bytes

   

if 4 bytes / 32-bit service UUID then max size of device name is 18 bytes

   

if 16 bytes / 128-bit of service UUID then max size of device name is 6 bytes.

   

If you want to use 128-bit characteristics and also want to advertise with a longer name, use a 16-bit service only for advertisement purpose. By doing so you can use 128-bit Services, characteristics etc and can also advertise with al onger name i.e. 20 Characters.

0 Likes