Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

CAN I Customize my adv packet Absolutely?

I think this is a very weird requirement

Normally , I use manufacturer data to do this like picture below

it's easy and quick

but it contains len and type occupying 2 bytes

I'm wondering if there is a way to make my packet have no len and type

I know that Texas's chip can do this like picture below

it will shows malformed packet

Thanks

  • Hello,

    but it contains len and type occupying 2 bytes

    I'm wondering if there is a way to make my packet have no len and type

    Yes, and no. Type and Len is requires for each new datafield as per the BLE specification. Leaving out these two fields violated the specification, and as such the SoftDevice has checks to ensure this does not happen. If you would like to do this, you may use the Radio peripheral directly, to communicate using your own proprietary protocol. You may implement this prorprietary protocol by using timeslots to combine with using the SoftDevice. This way, the SoftDevice will release the control of the radio peripheral, so that you may do whatever you want in the time that the SoftDevice does not require the radio for BLE.
    If you want to look into implementing your own radio protocol there are many posts on the forum about this already, and I highly recommend scrolling through these to get a better understanding of what this would entail.

    I know that Texas's chip can do this like picture below

    Any chip with access to a 2.4 GHz radio peripheral can do this - but this is not BLE - which is why the sniffer displays the packet as malformed.
    Non-sniffer devices will discard any malformed packets, so unless you control both sides of the link this is not a possibility.

    Please do not hesitate to ask if anything should be unclear.

    Best regards,
    Karl

  • Hi Karl,

    thanks for reply

    I've tried timeslot according to this tutorial with nrf52832DK ,SDK_15.3

    and i successfully made the led blink by the timeslot

    So now i would want to know how to use radio peripheral to make a malformed packet or proprietary protocol

    Is there any example or document or keyword to search?

    thanks

  • Hello Aku,

    Aku said:

    thanks for reply

    I've tried timeslot according to this tutorial with nrf52832DK ,SDK_15.3

    and i successfully made the led blink by the timeslot

    No problem at all, I am happy to help! Great to hear that you found the tutorial useful, and that you have succeeded in setting up a timeslot.

    Aku said:
    Is there any example or document or keyword to search?

    Just to make sure, could you describe to me why you would want to or need to make use of a proprietary protocol? I assume it is because you are unable to fit all your data into an advertising packet's 31 Byte limit, is this correct?
    As mentioned, it is a lot more work to implement a proprietary radio protocol, so if you tell me more about your application and its requirements, perhaps we are able to find a easier method to achieve the same functionality.
    The most central question is; How many bytes do you need to advertise each advertisement?
    For example, have you exhausted the option of using the scan response data to increase the effective number of advertising bytes? Perhaps this could save you a lot of work.

    Best regards,
    Karl

  • HI Karl

    the reason is

    My boss bought a Bluetooth Gateway system that only accept it's own protocal

    And I have to make a device to send data through by broadcast

     

    Actually,I have tried Srdata and Extend ADV already but the gateway didn't accept

    because of the len and type

    it only accepts packets that start with 0x24C3 like i circle in the picture below

    so i think proprietary protocol it's the only way

    or if there is an easier way to do that?

  • Hello Aku,

    Aku said:

    the reason is

    My boss bought a Bluetooth Gateway system that only accept it's own protocal

    And I have to make a device to send data through by broadcast

    Thank you for clarifying, this makes it much easier to understand you intentions and sought-after functionality.

    Aku said:
    Actually,I have tried Srdata and Extend ADV already but the gateway didn't accept

    I am happy to hear that you have already looked into these options!
    If it requires a non-BLE protocol then this is likely documented in the gateway's datasheet if they intend for others to create customer devices that can interact with it.

    Aku said:

    so i think proprietary protocol it's the only way

    or if there is an easier way to do that?

    Yes, if it is the case that the gateway only accepts packets that does not start with a type and length byte, this is proprietary(no longer BLE protocol), and thus you would have to use this protocol to communicate with the device. Since the SoftDevice is strictly BLE, it wont transmit / process packets that violate the BLE specification, and therefore you will have to implement this proprietary protocol yourself.

    In order to do this, you will need to setup a timeslot (like you have done already), and then use the radio peripheral directly during this time - like you would do with any other peripheral. While we do not provide any tutorials on how to do this, you could take a look at the Thingy52's source code for its eddystone advertising.
    Particularly, if you look at the functions m_get_adv_packet and m_configure_radio, in the former the non-BLE packet is setup, and in the latter the radio is configured to broadcast it. You could use this code as a starting point - substituting out the payload with that of your own.

    Best regards,
    Karl

Related