How to extract GAP device name from the mesh advertisement

Hello,

I was wondering if there is a way to extract the "Device name" from the scanned advertisement data published by a model on a different node. I want to display the "Device name" of a node when it sends specific data(eg. when a Generic ON/OFF model on one of the client nodes sends an "ON" message). What would be the best way to do it? The only examples that I have come across are based on standard BLE and not Mesh.

I have configured the advertisement parameters of all nodes to include "BT_LE_ADV_OPT_USE_NAME". Am I going about it in the right way? or is there a another way?

I am using the NCS 1.9.1 on a nRF52480 DK. Thanks in advance.

  • If the advertiser is not doing extended advertising, then the device name should be put into the scan response data

    .Can you post some code snippets on how you are getting the scan response data from your scanner callbacks?

  • Hello Susheel, I apologize for the delay. I have moved to a different state and am finally back on my project.

    The bt_mesh_scan_cb() function in this code is the same I am using in my project. I have spent some time debugging the code but am still unable to find the device name in the advertisement packet. Please advice.

    we are using the standard advertisement for our development now, but will be moving to extended advertising using long range. Will that still be alright?

  • Hi,

    Are you using one of our mesh examples from the SDK or is this a custom application?

    If I understand you correctly you only want to extract the device name when the device is sending an ON/OFF message? 

    Susheel said:
    we are using the standard advertisement for our development now, but will be moving to extended advertising using long range. Will that still be alright?

    Bluetooth mesh is based on the Bluetooth 4.0 specification. Unfortunately, Bluetooth 5 features are not part of the mesh stack. This is by specification, as published from Bluetooth SIG.

  • Are you using one of our mesh examples from the SDK or is this a custom application?

    Yes, I am using a modified version of the Light(server/client) example from the SDK.

    As per my understanding, as long as my advertisements are configured to include the "Device Name" in it, it should not matter what models I have in my mesh composition. Please correct me if I am wrong. And yes, I want to extract the Device name from the messages and use them for filtering purposes inside the application. 

    Bluetooth mesh is based on the Bluetooth 4.0 specification. Unfortunately, Bluetooth 5 features are not part of the mesh stack. This is by specification, as published from Bluetooth SIG

    we are aware of this fact and are planning for a deviation with a proprietary license using the 1M Phy on the side. Does using an extended advertisement affect the Device name packed in the messages in any way? Thank you.

  • Hi,

    I think it might be a misunderstanding here regarding device name. The define you mentioned BT_LE_ADV_OPT_USE_NAME, will only work for BLE communication. Payload for mesh packets are used for mesh data, so it won't contain the device name.

    Susheel said:
    And yes, I want to extract the Device name from the messages and use them for filtering purposes inside the application. 

    Can you elaborate more on what you mean with filtering?

    If you like to filter which device the packets are coming from, then it is possible to use the source address(unicast address) that is included in the packet from sender.

Related