Display of advertising devices in hterm

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
5个帖子/ 0新
Last post
carndt
Offline
最后一次露面:3 years 9 months ago
Joined:2017-07-04 14:49
Display of advertising devices in hterm

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.

Device:
mt_dialog.
Offline
最后一次露面:3个月4天前
Staff
Joined:2015-06-08 11:34
Hi carndt,

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.

谢谢mt_dialog.

carndt
Offline
最后一次露面:3 years 9 months ago
Joined:2017-07-04 14:49
首先谢谢你

首先谢谢你much for your reply and help!
I will try it out and hope I can make this setup run.

Kind regards

carndt
Offline
最后一次露面:3 years 9 months ago
Joined:2017-07-04 14:49
...finally I got some time to

...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)“您必须向该堆栈发出扫描命令” - >如何发出扫描命令?在我下载到Pan1740之后,它是否以某种方式自动完成?

3)“为了让设备启动广告” - >我没有真实地了解关系,因为我有一个BLE温度标识,它在不发布任何扫描命令的情况下宣传

4)“一旦设备配置” - >到目前为止,我不知道要改变哪种配置,一切都似乎是预配置的。

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)“启用UART之后” - >我可以看到两个选项来启用UART - 我定义CFG_Printf,它可以启用UART2或者我将其保留未定义,以启用UART。我尝试过,但终端程序仍然没有数据。

正如您所看到的,我不知道如何配置设备以便在COM端口上接收广告数据。我现在没有任何连接到任何GPIO的东西 - 只需将DEV板插入我的笔记本电脑..

谢谢,
carndt

mt_dialog.
Offline
最后一次露面:3个月4天前
Staff
Joined:2015-06-08 11:34
Hi 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)对于广告的写作写道,对不起,我的意思是扫描。在发出扫描命令后向堆栈命令进行扫描(Gapm_start_scan_cmd),那么设备将开始扫描广告事件。

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-semicondiondiondum/forums/post/dialog-smartbond-bl ...in order to be able to print through the arch_ apis.

6)确定,所以您正在扫描,如果您有Pro Dev套件,可以通过电源分布器验证。

7)检查我的评论5。

谢谢mt_dialog.