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

Scan only one nrf52832 peripheral

HI

I am using nrf52832 modules with SDK 11.0.0, s132.

I am able to advertise and scan the devices and display RSSI and peer address.

For my project i want to display the RSSI of the advertising nrf module , but the central device is scanning all the surrounding peripheral devices.So how do i implement to scan only one particular peripheral device and there by display that device address and RSSI only??

central: ble_app_uart_c example

peripheral: ble_beacon example

Thanks,

Uma

Parents
  • Hi Uma,

    You have a few options in this case:

    1. Scan with whitelisting provided that you know the MAC address or IRK (if the peripheral uses privacy). If you are not bonded with the device, you can do something similar to this.
    2. Just filter in the handling of the BLE_GAP_EVT_ADV_REPORT event. Then you can filter on anything you want (MAC address, name or whatever), and only print the RSSI of the device(s) you are interested in.
  • Hi

    I was able to successfully  filter required device by name, MAC address.

    I do not understand whitelisting??

    I want to do with UUID, i couldnt get past though is_uuid_present function.

    the peripheral  and central configurations are kept as default. What should i change?How can i filter using uuid??

    The default TX power level of the module is 0dBm right??

    according to the documentation Radio transmit power in dBm (accepted values are -40, -30, -20, -16, -12, -8, -4, 0, 3, and 4 dBm), my device is nrf52832.When i have set to 3dbm im unable to advertise why?

    Thanks

  • Hi,

    guma said:
    I do not understand whitelisting??

    Whitelisting is simply a method that lets the scanner (in this case) ignore advertising packets form non-whitelisted devices. You can whitelist the MAC address (or IRK if the peer is using privacy - random resolvable address - and you have exchanged the IRK when bonding).

    guma said:

    I want to do with UUID, i couldnt get past though is_uuid_present function.

    the peripheral  and central configurations are kept as default. What should i change?How can i filter using uuid??

    Filtering on UUID is essentially similar to any other filtering. Instead of filtering on the Name which is part of the advertising packet, you filter on UUID instead. Note that both name and UUID are optional, so unless you know that it is part of the advertising packet you are not guaranteed to find anything. (That means that a device can support a BLE service without advertising the service UUID. So, in that case, you have to connect and do service discovery to know that the service is supported).

    The is_uuid_present function in the NUS central example in SDK 11 demonstrates how you can search for a specific UUID in the advertising data. If it doe snot find the UUID you are searching for it indicates that it is not part of the advertising packet.

    guma said:
    The default TX power level of the module is 0dBm right??

    Yes, the Tx power is 0 dBm unless you explicitly set it to something else.

    guma said:
    according to the documentation Radio transmit power in dBm (accepted values are -40, -30, -20, -16, -12, -8, -4, 0, 3, and 4 dBm), my device is nrf52832.When i have set to 3dbm im unable to advertise why?

    Unable to advertise? In what way? How do you set the Tx power? It should be just to call sd_ble_gap_tx_power_set() after enabling the SoftDevice. Do you get an error returned?

Reply
  • Hi,

    guma said:
    I do not understand whitelisting??

    Whitelisting is simply a method that lets the scanner (in this case) ignore advertising packets form non-whitelisted devices. You can whitelist the MAC address (or IRK if the peer is using privacy - random resolvable address - and you have exchanged the IRK when bonding).

    guma said:

    I want to do with UUID, i couldnt get past though is_uuid_present function.

    the peripheral  and central configurations are kept as default. What should i change?How can i filter using uuid??

    Filtering on UUID is essentially similar to any other filtering. Instead of filtering on the Name which is part of the advertising packet, you filter on UUID instead. Note that both name and UUID are optional, so unless you know that it is part of the advertising packet you are not guaranteed to find anything. (That means that a device can support a BLE service without advertising the service UUID. So, in that case, you have to connect and do service discovery to know that the service is supported).

    The is_uuid_present function in the NUS central example in SDK 11 demonstrates how you can search for a specific UUID in the advertising data. If it doe snot find the UUID you are searching for it indicates that it is not part of the advertising packet.

    guma said:
    The default TX power level of the module is 0dBm right??

    Yes, the Tx power is 0 dBm unless you explicitly set it to something else.

    guma said:
    according to the documentation Radio transmit power in dBm (accepted values are -40, -30, -20, -16, -12, -8, -4, 0, 3, and 4 dBm), my device is nrf52832.When i have set to 3dbm im unable to advertise why?

    Unable to advertise? In what way? How do you set the Tx power? It should be just to call sd_ble_gap_tx_power_set() after enabling the SoftDevice. Do you get an error returned?

Children
No Data
Related