Skip to main content

DSPS Connect to one of 4 specific Clients

DA14580

4 years ago

Posted by gert186 0 points 6 replies
0 upvotes

Short Description,

I have one Host and 4 Clients of Bluetooth PAN1740.

I would like to connect only to one specific Client and the other should go to sleep. I would like to program which one I would like to connect. (Fix coded like UUID?)
The other ones should go to sleep.

Can somebody help me with this application? Please.

Thanks

Or send me example code for that.

Thank you so much.

4 years ago

MT_dialog -30 points

Hi gert186,

You wont be able to instruct the other peripherals to go to sleep from the central (if that is your goal), but what you can do in order to connect to a specific peripheral from the central, is either use a specific UUID or in general a specific magic number that the central will check when receiving the advertising event and issue a connection request, The DSPS has this check, if you have a look at the user_on_adv_report_ind() function you can see that there is a memcmp() function that compares the data on the advertising string with a fixed UUID, if the advertising data and the UUID matches, then the device issues a app_easy_gap_start_connection_to_set() in order to start the connection sequence with that specific device.

Thanks MT_dialog

3 years ago

gert186 0 points

I found it but in which position of the DSPS HOST could I change the UUID fix string.
In the device it was very easy :-)

accepted answer!

3 years ago

PM_Dialog

Hi gert186,

The user_on_adv_report_ind() function is called when an advertising report (GAPM_ADV_REPORT_IND) is received. When the advertising peripheral device supports the DSPS profile (by containing the DSPS profile UUID in the advertise data) it sets connection parameters and cancels scan operation. So, both host and device should have same USER_ADVERTISE_DATA. If the advertising data and the UUID matches, then the device issues a app_easy_gap_start_connection_to_set() in order to start the connection sequence with that specific device.

Thanks, PM_Dialog

3 years ago

gert186 0 points

Thanks I understand now !

3 years ago

ANDREY PRONIN 0 points

Is it possible to connect to the device at this stage based on the device name? I mean that USER_ADVERTISE_DATA for slave devices is the same.

3 years ago

PM_Dialog

Hi ANDREY PRONIN,

Could you please try to describe what you are trying to accomplish? Are you using the DSPS project and if I am able to understand you want to advertise from the central the same USER_ADVERTISE_DATA with the peripherals?  Please try to clarify your question in order to provide you the proper guidelines.

Thanks, PM_Dialog