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

Getting scanned device names:adv_report_parse() device names are printed repeatedly?

I am using adv_report_parse to try and return the device names the scanner picks up. However device names are being printed repeatedly.

I have 4 to 5 devices around me and all the device names are being keep on printing and how can i stop and print unique device names only once.

I am using ble_app_hrs_c_pca10056_s140.

I would appreciate any help, Thanks

  • Well "printing" is probably just consequence of your internal state machine in the scanner. E.g. if you scan continuously then obviously Adv. report events keep coming to your BLE event handler from stack (Soft Device) and if you parse and print each of them then there are as many print-out as many events you get. If you want to stop receiving something then you need to do that inside your application logic... If this is not the case or I've misunderstood of what you don't like then please make screenshot and comment on how often these print-outs appear in the terminal.

  • ya you got it right,if the same device keeps on advertising my scanner Adv. report event is being called repeatedly and printing the device name again and again.i want to get into scanner mode only when new device is found i.e other than already printed device.will it be possible.

    I would appreciate any help, Thanks

  • Everything is possible, just write it into your FW;)

  • @endnode has explained why you get continuous printouts. To make sure every device is only printed once (or to make any action happen when a new device appears within range) you will have to store pieces of information identifying each advertiser. It can e.g. be the address of the device or the name (if they all have different names). Then, when you get adv reports, just compare the report to your "database".

  • How to get Device Information details when connected to particular device.For example i have connected to one device and in its GATT profile it has Device information service with UUID:0x180A and model number with UUID:0x2A24 and many other services i need to get details of those when connected. I am unable to find where to do necessary changes,right now i am using ble_app_hrs_c_pca10056_s140 when connected i am getting battery status. please Help me how to do it. Thank you.

Related