This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

device name

hi

I use  nrf52 sdk17.  i want to change device name .

1. if device name is less 19, more 18 ,it is ok. for example 

#define DEVICE_NAME                         "123456789123456789" .  it is OK

2 if device name is 19 or more , it is fail

  "12345678912345678912" .  it is only 18. 

I want device name is more 18 . how to do, please!

Parents
  • Hello,

    2 if device name is 19 or more , it is fail

      "12345678912345678912" .  it is only 18. 

    I want device name is more 18 . how to do, please!

    What else does your advertising data packet contain? Please keep the 31 advertising data byte limit in mind when building the advertising packet. Please also keep in mind that every advertising data field will require 2 bytes of overhead, so if you have a 18 byte name, it will take up 20 bytes out of the 31 available advertising data bytes.

    If you exceed the 31 byte limit, the SoftDevice will truncate the device name field.

    Best regards,
    Karl

  • HI

    Thanks, I try mark some advdata,it is ok。

    i am not sure  : which data can be mark, does not effect host link

    now advdata data include:

    Encode LE Bluetooth Device Address,Encode appearance.,Encode Flags,Encode TX power level.Encode 'more available' uuid list.,Encode 'complete' uuid list.Encode 'solicited service' uuid list.,Encode Slave Connection Interval Range.Encode Manufacturer Specific Data.Encode Service Data.Encode name

  • bear_xiong said:

    Thanks, I try mark some advdata,it is ok。

    i am not sure  : which data can be mark, does not effect host link

    I am sorry, but I do not understand what you mean by this. Could you clarify?

    bear_xiong said:
    now advdata data include:

    This will certainly exceed the 31 byte limit of a legacy advertising packet.
    Are you dividing this into a scan response packet as well? If so, which of these fields is placed in the scan response, and which of them is in the advertising packet?
    How many bytes is the entire data payload you plan to advertise?
    Have you looked into the possibility to use the Extended Advertising feature of BLE 5.0?

    Best regards,
    Karl

  • hi

    I mean 

    if  advdata reduce, device name more 18 is ok. but i am not sure if reduce advdata , adv is ok?

    if use extended advertising ,have some example ,please ?

  • Hello again,

    bear_xiong said:
    if  advdata reduce, device name more 18 is ok. but i am not sure if reduce advdata , adv is ok?

    Sorry, I am still having trouble understanding exactly what you are asking me here.
    Are you telling me that if you reduce your advdata, you are able to have a device name longer than 18 bytes? If so, I concur that this would be the case, since you then have more space left in your advertising packet to use for the device name.
    I do not understand the last part, but as long as you include the flags field (if you are advertising as connectable) then the rest of the contents of your advertising packet is up to you, to see if you are ok with it.

    bear_xiong said:
    if use extended advertising ,have some example ,please ?

    Unfortunately, we do not have any examples using extended advertising available right now.

    Best regards,
    Karl

  • thank, I know。

    second,your mean is

    if  include   init.advdata.flags                   = adv_flags;

    other contents of advertising packet, include is ok, or do not inlude is ok too?

     

  • bear_xiong said:

    if  include   init.advdata.flags                   = adv_flags;

    other contents of advertising packet, include is ok, or do not inlude is ok too?

    The flags field is required if you are advertising as connectable. If you are advertising as non-connectable you can choose to leave out the flags field, since the flags field is only used to see how you can connect to the device.
    Are you advertising as connectable? If so, you will need to have the flags field in the advertisement.

    Best regards,
    Karl

Reply
  • bear_xiong said:

    if  include   init.advdata.flags                   = adv_flags;

    other contents of advertising packet, include is ok, or do not inlude is ok too?

    The flags field is required if you are advertising as connectable. If you are advertising as non-connectable you can choose to leave out the flags field, since the flags field is only used to see how you can connect to the device.
    Are you advertising as connectable? If so, you will need to have the flags field in the advertisement.

    Best regards,
    Karl

Children
Related