DSPS_CENTRAL connection with DSPS_DEVICE(multible pheripheral)

12 posts / 0 new
Last post
prasanth.velliy...
Offline
Last seen:1 year 10 months ago
加入:2016-02-18 12:18
DSPS_CENTRAL connection with DSPS_DEVICE(multible pheripheral)

Hi Dialog
I am using the DSPS project , (1- central and 6 - DSPS_DEVICE )

Q1 : while DSPS_CENTRAL connected with DSPS_DEVICE-1, in order to make the connection (with out disconnecting the connection with device 1 )with DSPS_DEVICE-2 do i have to do the scanning again else DSPS_CENTRAL can connect to the device directly using the previous scan report ?? how to do this ??

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

Hi prasanth.velliyangiri,

If you have the public bd address of the second device that would like to connect to you can start the connection procedure immidiatelly without scanning just by using the app_easy_gap_start_connection_to_set() function and set the address, the address type and the connection interval. If you dont have the address and you need to scan you should issue a scan command to the stack obtain the address and then issue the same connection command with the obtained address from the scanning procedure.

Thanks MT_dialog

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

Hi Dialog
Thank you for your reply ,
Q1 : initially my scan report consists one device , after some time it consists all the available device, why ??
is this because of delay in printing in uart ?? or do i need to introduce some delay to scan all the available devices ??
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,

扫描仪扫描一个频道和回购rts 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
Thank you for your reply.
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 : In which function i have to add the scan_start for connecting to device 2?? (is it inside => gapm_cmp_evt_handler ???)
Q3 : i want to connect to list of known ble devices(6) , how to store the BLE address , so i can use it while connection ???
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
Thank you for you reply..

Q2 : connection complete call back ?? in dsps i am seeing 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, &known_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