Forums - Connect to device by name

6 posts / 0 new
Last post
Connect to device by name
oskar.jazdowski
Join Date: 3 Aug 18
Posts: 4
Posted: Wed, 2018-08-29 08:20

Hello there.

Is it possible to connect to a client device by it's name rather than mac address?

With the QCLI utility I can:

Enter BLE (3)

Initialsise BLE (4)

Configure Advertising Report as Verbose (44 1 )

Scan for devices ( 17 1 )

Stop scan (17 0 )

 

From here I can see my devices MAC address.

I have also extended the QCLI Demo source files to parse the client device name inside the "Raw_Report_Data" vai "GAP_LE_Event_Callback" [ spple_demo.c ]

 

Using QCLI Utility I could connect to my client device using the MAC address:

Connect To Client ( 18 0 XXXXXXXXXXXX 0 )

Does the QCA4020 Support a method to connect to the client directly from the Device Name?

 

Thanks for your time

Oskar

  • Up0
  • Down0
jaydenk
Join Date: 21 Jun 18
Posts: 64
Posted: Wed, 2018-08-29 13:53

Hi Oskar,

I think we can investigate Advertising Data if it includes "complete local name" as AD type 0x09.

When you review DisplayAdvertisingData() in quartz/demo/qcli_power_demo/src/ble/ble_demo.c,

we can print out the struct values like AD_Type, AD_Data_Lengh, and AD_Data.

When AD_Type is 0x09 as complete local name, we can print Advertising_Data->Data_Entries[Index].AD_Data_Buffer as string type by %s.

We can match known device name with the found complete local name in Advertising Data.

Thanks
BR,
Jayden

  • Up0
  • Down0
oskar.jazdowski
Join Date: 3 Aug 18
Posts: 4
Posted: Thu, 2018-08-30 01:09

Hi Jayden,

Thank you very much for your support.

Yes, I was hoping to communicate that I have extracted the Device Name from the Advertising Packet and from there can resolve the MAC address and connect using the MAC address. I was wondering if I could connect to the device using the device name rather than the MAC address? In other words " connect to 'myDevice'" or in QCLI terms " 18 0 myDevice 0 ".

 

/* advertising packet data length */
int advData_length = (int)DeviceEntryPtr->Raw_Report_Data[0];
 
/* advertising packet data type */
int advData_type = (int)DeviceEntryPtr->Raw_Report_Data[1];
  
/* capture the device name */
char advData_name[32];
 memset(advData_name, 0, sizeof(advData_name));
 snprintf(advData_name, advData_length, "%s", (uint8_t*)&DeviceEntryPtr->Raw_Report_Data[2]);

 

[...]

[...]

Program logic would continue in that if the name matched your device then grab the MAC address and connect to it.

 

  • Up0
  • Down0
jaydenk
Join Date: 21 Jun 18
Posts: 64
Posted: Thu, 2018-08-30 12:11

Hi Oscar,

Yes, we need to implement that kind of parsing logic for remote device name.

There is exact API to make BLE connectio according to device name.

Thanks
BR,
Jayden

  • Up0
  • Down0
gecloudtest
Join Date: 29 May 18
Posts: 9
Posted: Wed, 2018-10-24 00:22

Hi,

 

We are trying to implement same thing mentioned in above comments.

Can anyone help which API to use to connect BLE device using Device name

 

Thanks in advance,

sushmita

  • Up0
  • Down0
jaydenk
Join Date: 21 Jun 18
Posts: 64
Posted: Thu, 2018-10-25 15:35

Hi Sushmita,

We don't have exact a API to connect remote device by name.

As we discussed here, we can investigate Advertising Data if it includes "complete local name" as AD type 0x09.

When you review DisplayAdvertisingData() in quartz/demo/qcli_power_demo/src/ble/ble_demo.c,

we can print out the struct values like AD_Type, AD_Data_Lengh, and AD_Data.

When AD_Type is 0x09 as complete local name, we can print Advertising_Data->Data_Entries[Index].AD_Data_Buffer as string type by %s.

We can match known device name with the found complete local name in Advertising Data.

Thanks
BR,
Jayden

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.