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

nRF52840 specific i/o functionality

Would it be possible at all to add a preset text string to the current advertising data, in an advertising-only module configuration, by changing the logical input of one of its 32 i/o available pins, and remove later on this additional string, when the logical level changes back to its original value? Thanks

Parents
  • Hi

    Advertising packets consist of a number of fields, each of which has a length and a type, and is limited to 31 bytes in total. You can change this dynamically quite easily, and if you want to change it based on the input of a GPIO pin this is definitely doable.

    Adding a text string can be done in a couple of ways. The most common is to use the local name field, which will set the name that is shown by most host devices (phones, PC's etc) when scanning for devices. 

    You can also use a field called "manufacturer specific data", which allows you to define your own field that can be decoded by apps looking specifically for your kind of devices. 

    Best regards
    Torbjørn

Reply
  • Hi

    Advertising packets consist of a number of fields, each of which has a length and a type, and is limited to 31 bytes in total. You can change this dynamically quite easily, and if you want to change it based on the input of a GPIO pin this is definitely doable.

    Adding a text string can be done in a couple of ways. The most common is to use the local name field, which will set the name that is shown by most host devices (phones, PC's etc) when scanning for devices. 

    You can also use a field called "manufacturer specific data", which allows you to define your own field that can be decoded by apps looking specifically for your kind of devices. 

    Best regards
    Torbjørn

Children
  • Hi Ovrebekk.

    Maybe I didn't adequately explain myself. I know already what type of advertising PDUs you have and what is primary and secondary or extended advertising. Thanks

    What I would like to know is how you can change, for instance, the preset Device Name of your module just by changing the logical level on one GPIO pin.

    For instance, changing a Device Name like "ORBIT" which is already being transmitted by, for example, "ORBIT- PLUS", as soon as the default logical value in Pin XX changes, and remains this value till pinXX returns back to its original value. When this happens, the Device name should change back to "ORBIT".

    Now, my question is. Is this feasible at all?
    If yes, which literature could I use to understand how to proceed?

    Thanks

  • Hi

    This is definitely possible. 

    Using the BSP library for instance it is possible to get a callback every time the state of a pin changes, and then you can use this to change the advertising name. 

    I modified the blinky example in the nRF5 SDK v17 to do this. Every time you press Button 2 on the DK it will change the advertising name, and then when you release it the name will change back. 

    Please have a look at the project here:
    255927_ble_app_blinky.zip

    To compile it, just extract the folder to \nRF5_SDK_17.0.0_9d13099\examples\ble_peripheral\

    Best regards
    Torbjørn

  • Hi Torbjorn.

    Always dazzled by the Nordic's Support excellence. Thanks very much.

    By the way. May I understand that the best Nordic´s document available to know and being able to implement all the nRF52840 functionalities would be the nRF52840_PS_v1.1.pdf  product specifications, or there is something else?

    Thanks again ovrebekk and,

    Best Regards

  • Hi Juan

    Thanks a lot for the kind words, I am happy to help ;)

    The infocenter is the main repository for documentation related to our hardware and software deliveries. 

    The nRF52840 itself is documented here, where you can find the PS, the errata, hardware design files and more. 

    Here you can also find the documentation for our SoftDevice stacks, including the S140 which you will probably use on the nRF52840. 

    And then we also share documentation for the SDK containing all the software examples, drivers etc here

    Best regards
    Torbjørn

Related