DSPS主机项目扫描设备

⚠️
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.
22帖子/ 0新
Last post
marios
Offline
Last seen:5个月2周前
加入:2017-05-09 20:27
DSPS主机项目扫描设备

Hello Dialog !

We trying to implement a project based on DSPS. We have flashed the (Da14580 DK Basic board) with the DSPS Host example (Version v_5.150.2) and we want to get the scand device's names through UART (TX/RX)

We have implement a custom board with Da 14580 that is boots from Spi flash and uses HW flow controll for low battery consumption

It has the DSPS Device example that's working fine. It's advertising his device name everything ok.

1) How I can see the scand device's?

是否有可能使用TERA术语来看待与DSPS主机示例中附近的附近广告设备扫描?

2)DSPS主机示例是否也是广告他的设备名称?因为我使用了对话DSPS Android应用程序,并且在按下扫描按钮时无法检测到任何内容。

Thanks in advance.

Marios

Device:
PM_Dialog
Offline
Last seen:3 days 15 hours ago
Staff
加入:2018-02-08 11:03
嗨玛丽奥斯,

嗨玛丽奥斯,

非常感谢您在线的问题。SPS_HOST项目将DA14580配置为中心,因此设备不会通告。请检查user_callback_config.h,您将在sps_host项目中看到.default_operation_adv = null。在SPS_DEVICE项目中,在同一标题文件中,您将看到.default_operation_Adv = default_advertise_operation。

为此,如果您想与DSPS Android应用程序连接,则应使用DA14580中的SPS_DEVICE项目。请记住,移动应用程序将是中央,并且运行SPS_Device的DA14580将是外设。

Regarding your first question, can you please clarify it? The application on the central device (sps_host) automatically starts scanning and connects to the first discovered peripheral device(sps_device) supporting the serial port service. The Central device also handles situations of connection loss by stopping the flow of data and automatically trying to re-establish a connection.

谢谢,PM_DIALOG.

marios
Offline
Last seen:5个月2周前
加入:2017-05-09 20:27
Hello PM_Dialog !

Hello PM_Dialog !

感谢您的快速回复 !!

我已经检查了DSP主机和DSPS设备项目上的user_callback_config.h,并且您有右转。

We need to set the central to scan continues FOREVER scanning for peripherals but we dont want to connect with any of them.

only scan for advertising devices.

can we get that continues scanning device list thought UART ?

如果我使用TERA术语我可以看到终端扫描吗?

Thanks in advance,

Marios

PM_Dialog
Offline
Last seen:3 days 15 hours ago
Staff
加入:2018-02-08 11:03
嗨玛丽奥斯,

嗨玛丽奥斯,

The Scanning procedure has a timeout that is about 8 to 10 seconds, so in order to keep on scanning you will have to send a new scan command when the scan_complete callback is invoked. Every time that you get an indication that you have an advertising message you can just print the data. The DSPS application implements the arch_prinf() function in the user_on_adv_report_ind() as long as you have defined the CFG_PRINTF definition in the da1458x_config_basic.h

谢谢,PM_DIALOG.

marios
Offline
Last seen:5个月2周前
加入:2017-05-09 20:27
你好pm_dialogue!

你好pm_dialogue!

谢谢你的回复!

We have one mobile phone and two da 14580 divices.

移动电话连接到第一个DA14580发送数据,然后在第二个DA14580上过传输,并在外部处理器中进行流程。

Which program have to use to achieve that ?

The second device is already running the DSPS (SPS_device) project.

Which program have to use on the first device ?

Thanks in advance,

Marios

PM_Dialog
Offline
Last seen:3 days 15 hours ago
Staff
加入:2018-02-08 11:03
嗨玛丽奥斯,

嗨玛丽奥斯,

The BLE connection is always initiated by the Central device ( mobile phone in your case). The first device could run the DSPS application too. So, the mobile phone will connect to the first device running the DSPS (GAP peripheral) and sends the data over the SPS profile. Then, you should disconnect from the first and connect to the second one. Keep in mind that since both are running the DSPS you might change the BD Address and the Device name.

谢谢,PM_DIALOG.

marios
Offline
Last seen:5个月2周前
加入:2017-05-09 20:27
你好pm_dialogue.

你好pm_dialogue.

We need after the data has been transferred through mobile phone to the first device. The first device must be connect to the second device and transmit the data.

Both devices runs the (sps device) with different Bluetooth address and names

How to implement that ?

Thanks in advance,

Marios

PM_Dialog
Offline
Last seen:3 days 15 hours ago
Staff
加入:2018-02-08 11:03
嗨玛丽奥斯,

嗨玛丽奥斯,

Since it is connected to the mobile (GAP Central), the Device_1 should run the sps_device firmware, so it is configured a GAP Peripheral.

因此,在Device_1完成数据转换后,应与移动电话断开连接。您可以使用手机断开连接也是如此。

Now, the requirement is to Device_1 with the Device_2. To do so, the Device_2, should be configured as GAP Central. The DSPS includes a project namely sps_host, which configures the DSPS to GAP Central.

According to the user manual, the application on the central device automatically starts scanning and connects to the first discovered peripheral device supporting the serial port service. The Central device also handles situations of connection loss by stopping the flow of data and automatically trying to re-establish a connection

谢谢,PM_DIALOG.

marios
Offline
Last seen:5个月2周前
加入:2017-05-09 20:27
你好PM_DIALOG!

你好PM_DIALOG!

感谢您的快速回复 !

I have just flashed the Device_1 with (sps_device) and Device_2 with (sps_host).

来自移动电话的数据成功发送到DEVIED_1和移动设备在数据传输后断开连接,但它看起来并不能够与DEVICE_1连接以获取数据。

I have send you both Device_1 and Device_2 configuration settings for better understanding.

我会等你的回复

Thanks in Advance,

Marios

PM_Dialog
Offline
Last seen:3 days 15 hours ago
Staff
加入:2018-02-08 11:03
嗨玛丽奥斯,Can you please

嗨玛丽奥斯,Can you please check if the Device_1 starts advertising after the disconnection? The Device_2 starts the scanning procedure? You could use the power profiler of SS Tollbox to verify it.

请快速测试:在Device_1中运行SPS_DEVICE和DEVICE_2运行对话框提供的SPS_HOST。这项工作吗?Device_2可以连接到Device_1吗?谢谢,PM_DIALOG.

marios
Offline
Last seen:5个月2周前
加入:2017-05-09 20:27
你好PM_DIALOG!

你好PM_DIALOG!

Thanks for your quick reply!

Yes Device_1 Starts again to advertise after disconection.

您是否有广告SPS_HOST的波形?

与我们的波形进行比较。

The sps_Host seems to start scanning but how I can figure out

If it's connects with Device_1 ?

非常感谢你的帮助

Thanks in advance,

Marios

PM_Dialog
Offline
Last seen:3 days 15 hours ago
Staff
加入:2018-02-08 11:03
嗨玛丽奥斯,

嗨玛丽奥斯,

The sps_host configures the device to GAP Central role, so it will start scanning.

My apologies that I am not able to replicate this.

I am using DSPS without any modification and as provided by Dialog.

The Device_1 that is running the sps_device starts advertising – see sps_device_adv.PNG.

运行sps_host的设备_2开始扫描 - 请参阅sps_host_scan.png。

As mentioned in my previous reply, the application on the central device (sps_host) automatically starts scanning and connects to the first discovered peripheral device supporting the serial port service (sps_device). So, the Device_2 automatically connects to the Device_2. Please see sps_device_connected.PNG and sps_host_connected.PNG.

我建议使用sps_host和年代ps_device without any modification, so that you can verify the same functionality.

谢谢,PM_DIALOG.

Attachment:
marios
Offline
Last seen:5个月2周前
加入:2017-05-09 20:27
你好PM_DIALOG!

你好PM_DIALOG!

Yes I have the same waveform with you on Device_2 (Sps_Host) but seems that it's can't connect with any sps device that I have.

I have the Device_2 (sps_host) on extended sleep mode with Hardware flow control because I want it to run with batteries.

with CTS and RTS controled by external microcontroller and communicates with uart.

设备1(SPS_DEVISE)位于SW流量控制和正常电池配置文件以及微控制器和UART通信。

Thanks in advance,

Marios

PM_Dialog
Offline
Last seen:3 days 15 hours ago
Staff
加入:2018-02-08 11:03
嗨玛丽奥斯,

嗨玛丽奥斯,

Are you using the DSPS project as provided by Dialog? Have you done any modification either to sps_host or sps_device application code? Would it be possible to provide a sniffer log so that I can understand what is happing over the air?

Can you please check if you are getting advertising reports in the sps_hose side - user_on_adv_report_ind() ?

谢谢,PM_DIALOG.

marios
Offline
Last seen:5个月2周前
加入:2017-05-09 20:27
PM_Dialog!

PM_Dialog!

感谢您的快速回复 !

After the mobile device has make the data transfer to the

Device_1微控制器处理缓冲区中的数据,然后通过UART将DA14580上的此数据发送到DEBOR_2

We read the process of the below instruction manual:

AN-B-026_DA14580_EXTERNAL_WAKE-UP_MECHASISMS_V1_0

1)DEVER_1如何使用特定的DEVICE_2连接DA14580两种设备运行DSPS项目

Thanks in advance,

Marios

marios
Offline
Last seen:5个月2周前
加入:2017-05-09 20:27
你好PM_DIALOG!

你好PM_DIALOG!

我们已经设置了Device_1运行(DSPS_HOST),我们的外部微控制器通过UART向DA14580发送数据

设备1(SPS_HOST)成功连接到设备2(SPS设备),但它不会将任何数据传输到另一侧。

Which mode have to set up on Host side to transfer data ?

汽车 ?

Direct connection ?

Give us some directions how to do it successfully

Please help us we have spend thousands of euros to develop on Dialog DA14580 platform.

我们是希腊最大的制造商,拥有完整的自动化生产线。

Thanks in advance,

Marios

PM_Dialog
Offline
Last seen:3 days 15 hours ago
Staff
加入:2018-02-08 11:03
嗨玛丽奥斯,

嗨玛丽奥斯,

The connection is not a problem as the Device_1 running the sps_host sends a connection request to the Device_2 running the sps_device and the connection can be set up successfully.

你能探讨UART信号吗?

If the DA14580 is configured in any of the sleep modes, then you should used Hardware Flow control. Once the data are on the UART, then the sps_host should transmit them to the peer device.

So, please also check the UART signal and the UART configuration in user_periph_setup.c / .h files.

应用程序代码和自定义板中的UART信号是什么?

谢谢,PM_DIALOG.

marios
Offline
Last seen:5个月2周前
加入:2017-05-09 20:27
Hello PM_Dialog !

Hello PM_Dialog !

感谢您的快速回复 !

We have successfully transmitted data on the other side !

1) We want the (Sps_Host) to start connection mode only when we have data on the flow control ?

Which settings have to be made to achieve this ?

2) we want also (sps_Host) to advertise and be conectable after it's receives data then have to make a connection to (Sps_Device) and transmit data.

Thanks in advance,

Marios

PM_Dialog
Offline
Last seen:3 days 15 hours ago
Staff
加入:2018-02-08 11:03
嗨玛丽奥斯,

嗨玛丽奥斯,

Could you please clarify your questions?

As mentioned in my previous comments, the sps_host configures the DA14580 as GAP role central. A Central device can advertise – it can only start scanning.

Thanks, PM_Dialof

marios
Offline
Last seen:5个月2周前
加入:2017-05-09 20:27
Hello PM_Dialog !

Hello PM_Dialog !

Thanks for your quick reply!

1)我们希望(sp_Host)开始扫描只有当我t's receives data on its UART port from our external microcontroller. After data ends have to desconect from sps_device.

2)SPS_HOST仅需要与预定义的SPS_DEVICE扫描并与第一个发现的设备配对,因为我们有数千个DA14580,在同一时间和地点进行广告。

Thanks in advance,

Marios

PM_Dialog
Offline
Last seen:3 days 15 hours ago
Staff
加入:2018-02-08 11:03
嗨玛丽奥斯,

嗨玛丽奥斯,

Both requirements are not support by the DSPS application. The DSPS is supported as provided by Dialog. So, in you case you will have to modify the DSPS application code – there is not any specific configuration.

  1. Please check user_on_set_dev_config_complete() callback function – it triggers the user_scan_start() which is the appropriate function for the scanning procedure. In you case, a possible solution might be to put the DA14580 into extended sleep mode and wake it up how you have data on the UART. Of course, you will need to have Hardware Flow control. You could use the wake-up controller to wake-up via a GPIO (RTS) once the external MCU has triggered it. When the device wakes-up, then the application should start scanning.
  2. A possible solution might be to modify the user_on_adv_report_ind() callback function so that the Central to send a connection request to a predefined device. The app_easy_gap_start_connection_to_set() API starts a direct connection to known peer/

谢谢,PM_DIALOG.

marios
Offline
Last seen:5个月2周前
加入:2017-05-09 20:27
你好PM_DIALOG!

你好PM_DIALOG!

Thanks you for your quick reply !

I have just seen that on user_confing.h

/// Scan response data
#define user_advertise_scan_response_data“”

我没有设置任何定义的东西

if i set the sps_device advertising name the sps_Host is going to conect with that specific device only ?

如果我做错了,请把我搞定,

1) On user_confing.h

/// Device name to be placed in advertising or scan response data
#define user_device_name“dialog-sps”//在此设置sps_host通告名称。

static const结构gapm_configuration user_gapm_conf = {
///设备角色:中央,外设,观察者或广播公司
.role = GAP_CENTRAL_MST,

/ **************************************************************************************
*对等设备信息,仅用于:
*
* - GAPM_CONNECTION_AUTO.
* - GAPM_CONNECTION_SELECTIVE
*
*具有对等地址的白色列表和相应的对等地址类型
**************************************************************************************
* /

///设备的BD地址
.peer_addr_0 = {0 x00 0 x00 0 x00, 0 xca 0 xea, 0 x23}, // Here we set the Bluetooth adress of the Sps_Device that we want SPS_Host to conect with it.

/// Address type of the device 0=public/1=private random
.peer_addr_0_type = 0,

config_advanced.h.

#define cfg_nvds_tag_bd_address {0x00,0x00,0x00,0xca,0xea,0x80} // sps_host蓝牙地址

user_sps_host.h

/ **

****************************************************************************************

* @brief Handles advertise reports

* @param [in]断开消息的Param参数

* @return void.

****************************************************************************************

* /

void user_on_adv_report_ind(struct gapm_adv_report_ind const * param)

{

// if(!memcmp(¶m->report.data[3], USER_ADVERTISE_DATA, USER_ADVERTISE_DATA_LEN))

{

ARCH_PRINTF(“连接%02x%02x%02x%02x%02x%02x”,

param->report.adv_addr.addr[5],

param->report.adv_addr.addr[4],

param->report.adv_addr.addr[3],

param->report.adv_addr.addr[2],

param-> eport.addr.addr [1],

param->report.adv_addr.addr[0]);

app_easy_gap_start_connection_to_set(param-> rapth.adv_addr_type,(uint8_t *)&param-> report.adv_ddr.addr,ms_to_doubledlot(user_con_intv));

user_gapm_cancel();

}

}

Thanks in advance,

Marios