Hi guys,
I have a PAN1740 USB DevBoard and I would like to detect advertising devices (e.g. BLE temperature sensor) and display the manufacturing data from these adv. devices in a terminal program like "hterm". So as far as I understood I need to boot my device as "central device" or "observer". But how do I do this?
So far no example project helped me and I am not sure what I am doing wrong. I thought the proximity monitor example (prox_monitor_ext.uvprojx) would fit my needs, but after connecting "hterm" to the correct COM port I still don't see any receiving data. I tried the same with the DSPS example (sps_host.uvprojx) but no success.
Do I need to change something in code? Obviously the way I want to apply the PAN1740 doesn't work out of the box.
Any suggestions?
Thanks in advance.
Hi carndt,
You will have to configure your device in order to operate as a central from the user_gapm_conf structure, you should change the .role into into either an GAP_CENTRAL_MST or into a GAP_OBSERVER_SCA, after doing that you will have to issue a scan commands towards that stack in order for the device to start advertising. The example that will help you on this is the DSPS host side. As soon as the device is configured for every advertising string is found the device will notify your application by triggering the .app_on_adv_report_ind function, in that function you will be able to proccess the advertising string found and print it over the UART. You can take the DSPS host as a reference, apply the same configuration and implement a scan function as the one that the DSPS uses. After that enable the UART and print the advertising string that your central has scanned.
Thanks MT_dialog
First of all thank you very much for your reply and help!
I will try it out and hope I can make this setup run.
Kind regards
...finally I got some time to try out your suggestions. Still I am a little confused with your explanations:
1) "You will have to configure your device in order to operate as a central from the user_gapm_conf structure, ...." --> The sps_host.uvproj example already sets the role GAP_CENTRAL_MST as default, so no change required here.
2) "you will have to issue a scan commands towards that stack" --> How do I issue scan commands? Isn't it somehow done autmatically after I download the SW to the PAN1740?
3) "in order for the device to start advertising" --> I do not realy understand the relation as I have a BLE temperature beacon, which advertises without issueing any scan command
4) "As soon as the device is configured" --> So far I do not know which configuration to change, everything seems preconfigured.
5)“在这个功能你可以过程the advertising string found and print it over the UART" --> But how? :) I expect some data to appear when I open the specific COM port with my terminal program hterm. But in fact nothing appears. Do I need to trigger something?
6) "implement a scan function as the one that the DSPS uses" --> It is already implemented in code in sps_host.uvproj project, right? So as far as I understand I do not need to change anything.
7) "After that enable the UART" --> I can see two option for enabling UART - either I define CFG_PRINTF which enables UART2 or I leave it undefined which enables UART. I tried both but still no data in my terminal program.
As you can see I do not know how to configure the device in order to receive advertising data on COM port. I do not have anything connected right now to any GPIO - just plugged the dev board into my laptop..
Thanks,
carndt
Hi carndt,
1) Yes in the DSPS example no change is required regarding the role of the device.
2) No, the device wont scan unless you instruct it to scan, the command for scanning is the GAPM_START_SCAN_CMD, you will be able to find a function allocating and sending this kind of command in the DSPS host example, in the user_sps_host.c file the function's name is user_scan_start().
3) For the advertising a wrote above, sorry, i meant scanning. After your issue the scan command towards the stack for scanning (GAPM_START_SCAN_CMD) then the device will start to scan for advertising events.
4) By configured, i mean that the device is configured a a central (depends on the role that you have applied on question 1) and that the device is scanning.
5)When the device starts the scanning as soon as it gets the first advertising string, the .app_on_adv_report_ind will be triggered (therefore the callback that you have matched to that pointer holder). If you have applied the above and you dont see anything on your UART that means that you 've missed something, on which example you were based and builded you application, the DSPS, any of the examples of the SDK5.0.4 ? Are the pins properly configured (the the proper ports and pins) ? Additionally in order to enable the printing of the DSPS you need a small patch on the SDK code of the DSPS explained on this posthttps://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...in order to be able to print through the arch_ apis.
6) Ok, so you are scanning, you can verify that via the power profiler if you have a pro dev kit.
7) Check my comments on 5.
Thanks MT_dialog