DSPS_Central与DSPS_DEVICE(ComperipherWirectal)连接

12 posts / 0 new
Last post
prasanth.velliy ...
Offline
Last seen:1 year 10 months ago
加入:2016-02-18 12:18
DSPS_Central与DSPS_DEVICE(ComperipherWirectal)连接

Hi Dialog
我正在使用DSPS项目(1------6 - DSPS_DEVICE)

Q1:虽然DSPS_Central与DSPS_DEVICE-1连接,但是通过DSPS_DEVICE-2与DSPS_DEVICE-2进行连接(用设备1断开连接),但我必须再次执行扫描,否则DSPS_Central可以使用先前的扫描直接连接到设备。报告 ??这该怎么做 ??

设备:
MT_dialog
Offline
Last seen:2 months 1 week ago
工作人员
加入:2015-06-08 11:34
Hi prasanth.velliyangiri,

Hi prasanth.velliyangiri,

如果您拥有第二个设备的公共BD地址,希望连接到您可以在使用App_easy_gap_start_connection_to_set()函数的情况下,可以在不扫描的情况下启动连接过程,并设置地址,地址类型和连接间隔。如果您没有地址并且需要扫描您应该向堆栈发出扫描命令获取地址,然后使用从扫描过程中获得的地址发出相同的连接命令。

Thanks MT_dialog

prasanth.velliy ...
Offline
Last seen:1 year 10 months ago
加入:2016-02-18 12:18
Hi Dialog

Hi Dialog
感谢你的回复 ,
Q1:最初我的扫描报告由一个设备组成,经过一段时间,它包括所有可用设备,为什么??
这是因为uart打印延迟?或者我需要介绍一些延迟扫描所有可用设备吗?
i used this format to print whole scan report lyk proximity monitor
for (i=0; i

MT_dialog
Offline
Last seen:2 months 1 week ago
工作人员
加入:2015-06-08 11:34
Hi prasanth.velliyangiri,

Hi prasanth.velliyangiri,

The scanner scans one channel at the time and reports back the devices one by one and prints them as well in the user_on_adv_report_ind if this is what you mean, you wont get two devices on one user_on_adv_report_ind invocation.

Thanks MT_dialog

prasanth.velliy ...
Offline
Last seen:1 year 10 months ago
加入:2016-02-18 12:18
Hi

Hi
感谢你的回复。
Now my scan report consists multible device address (6), but how to make connection with all the six device.
In proximity_monitor project the connection is based on the index value that user selects in console app => void app_connect(unsigned char indx) .

MT_dialog
Offline
Last seen:2 months 1 week ago
工作人员
加入:2015-06-08 11:34
Hi prasanth.velliyangiri,

Hi prasanth.velliyangiri,

You should modify the code and after the first connection is made you should restart the scanning procedure. At the advertising indication you can decide on which device you are willing to connect to, either check the bd address or the advertising string and if it matches a predefined string you will issue a connection command.

Thanks MT_dialog

prasanth.velliy ...
Offline
Last seen:1 year 10 months ago
加入:2016-02-18 12:18
Hi Dialog

Hi Dialog

Q1 : What all are the functions executed after device 1 gets connected , (gapc_connection_req=>app_on_connection=>prf_enable => ???),
Q2:在哪个函数中,我必须添加扫描_start以连接到设备2 ??(它是内部=> gapm_cmp_evt_handler ???)
Q3:我想连接到已知的BLE设备(6)列表,如何存储BLE地址,所以我可以在连接时使用它???
Thank you

MT_dialog
Offline
Last seen:2 months 1 week ago
工作人员
加入:2015-06-08 11:34
Hi prasanth.velliyangiri,

Hi prasanth.velliyangiri,

Q1: On the host side as soon as you get an advertising message the connection request is send and when the connection is established the gapc_connection_req_ind_handler() hits and the a confirmation message is sent to the the GAPC task. After that the connection callback is invoked and in that callback the connection timer is disabled, and the host starts the discovery procedure with the app_prf_enable() function (there are quite some functions invoked during the discovery procedure, when the user_sps_enable is invoked starting with the GATTC_DISC_CMD - the information about those messages can be found in the RW_BLE_GATT_IS). So while you are discovering you are allready connected and the discovery functions are being invoked in order to retrive the services of your peer device. Also the mtu exchange function is invoked. Also since the peer device is issuing an update request you should also see the gapc_param_update_req_ind_handler() executing as well.

Q2: You can restart scanning in the connection complete callback function.

Q3: You can have an array of all the available predefined addresses and loop through that array when you have an indication that you have received an advertising string.

Thanks MT_dialog

prasanth.velliy ...
Offline
Last seen:1 year 10 months ago
加入:2016-02-18 12:18
Hi Dialog

Hi Dialog
谢谢你回复..

Q2:连接完整回电?在DSP中,我看到了user_on_scanning_Completed
Q3 : struct known_devices
{
// known peer address
struct bd_addr peer_addr;
};

struct known_devices known_device[] = {
{"\xA1\xD2\x00\xCA\xEA\x80"},
{"\xA2\xD2\x00\xCA\xEA\x80"},
};
while comparing this known device address , i am getting error , where is the mistake..
if(bdaddr_compare(&app_env_vp.devices [i] .adv_addr.addr,&hypern_device [connect_to_device] .peer_addr))

Thank you...

MT_dialog
Offline
Last seen:2 months 1 week ago
工作人员
加入:2015-06-08 11:34
Hi prasanth.velliyangiri,

Hi prasanth.velliyangiri,

Q2: .app_on_connection = user_on_connection, your device has finished the connection with the first device and starts scanning for the second device.

Q3: I dont think that this is too much to debug, you will have to check what is the value in the parameters and check what might go wrong and the comparison fails, you can also use the memcmp() in order to compare the two bd addresses. The bdaddr_compare() doesn't do anything special, it just runs through the two arrays and checks the elements one by one. Perhaps the one of the two addresses is inversed.

Thanks MT_dialog

prasanth.velliy ...
Offline
Last seen:1 year 10 months ago
加入:2016-02-18 12:18
Hi dialog,

Hi dialog,

I am working on DSPS project. I am trying on connecting multiple slaves(2) with single master.

When ever i am starting the scan using , user_scan_start() function, i am getting advertisement report of the same device multiple times even though i have enabled the scan duplicate filtering policy. How to resolve this?

MT_dialog
Offline
Last seen:2 months 1 week ago
工作人员
加入:2015-06-08 11:34
Hi prasanth,

Hi prasanth,

The reason for this is that the DSPS when scanning, the mode that it used is GAP_GEN_DISCOVERY, when scanning is performed in that mode the procedure automatically expires and the DSPS sends a new scan command in order to restart scanning. So during the period of the scan command with the duplicate filter enabled you should not get additional advertising events from the same device, but when you restart scanning those advertising event will pop up again. You can either implement an additional buffer that will hold the devices during previous scans or you can change the GAP_GEN_DISCOVERY mode to GAP_OBSERVER_MODE. With the GAP_OBSERVER_MODE the scan never times out, so you dont have to start the scanning again by sending a new command therefore you wont get additional indications from allready reported devices but you will get all kind of advertising strings (undirected, non-connectable, limited etc).

Thanks MT_dialog