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

how to conform my Bluetooth channel is mask ya unmask.????

hi sir

i have start my project in NRF52-DK development kit  but some BLE card give me data in three channel and i have received all data and give me same like data pls find photo.  

and i have mask my other channel 38 and 39  and this give that type data pls find photo is only 37 number channel so this is mask my channel 38 and 39 ????

i have not conform so pls help me.

and i have send my code snip short i have wright code like this is right ya wrong pls told me.  

so pls help me

tanks & regard

nirav patel

+91 9662456003

  • Hello,

    I assume that it is advertising packets that you are scanning for, and measuring the RSSI on, is that right?

    I don't know what SDK you are using, so I will reference to SDK15.0.0, and I will use the SDK15.0.0\examples\ble_central\ble_app_uart_c example. (if you use SDK15.2.0, the advertising reports are moved into nrf_ble_scan.c)

    in on_adv_report() (SDK15.0.0) or nrf_ble_scan_on_adv_report() (SDK15.2.0) a pointer to ble_gap_evt_adv_report_t p_adv_report is passed into this function.

    If you check p_adv_report->ch_index this will give you the channel of the advertising packet that you are currently examinating. So you can use this to check whether your masking is working as intended.

    You can also skip the masking, and just use this information to check which channel the advertisement was picked up on.

    Best regards,

    Edvin

  • Thanks Edvin for the inforamation & Thanks Nirav for posting this query.

    Right now i am able to get the scanning channel index...

    but method  i am using for channel masking is may be wrong...becuse every time i got the data from all the channel...there is no effect of masking the channels.

    can you suggest me the proper method how to mask one or two scanning channels.

    currenlty i am using SDK 15.2.0  and softdevice is 6.1.0...

  • How do you set up your scanning? Where do you use your ble_gap_scan_params?

    BR,

    Edvin

  • There is Struture ble_gap_scan_params_t in ble_gap.h file  and that struture has member like interval, window timeout and channel_mask.

    In the main file i create a variable/instance or object (ble_gap_scan_params_t x; as shown in imgade send by nirav)and access the struture varible called channel_mask using       x.channel_mask[4]=0x80;

    and set this values before scan_init() function called in main function.

    but still scan result comming from all channel.

    is this correct method or wrong one.??

  • Have you set the channel mask of the m_scan_params you use in sd_ble_gap_scan_start(&m_scan_params, &m_scan_buffer)?

    BR,

    Edvin

Related