Forums - QCLI Usage Example for BLE-SmartPhone usecase

4 posts / 0 new
Last post
QCLI Usage Example for BLE-SmartPhone usecase
naufal.shidqi
Join Date: 27 Sep 18
Posts: 3
Posted: Tue, 2019-09-24 05:16

Hi,

I am Naufal. Now, i am trying to test a simple usecase using QCLI Demo where i need to Discover-Connect-Pair My Smartphone to a QCA402x using SPP.

In QCLI Demo, there is an usage example but for a QCA to another QCA.

Is there any suggestion on how to setup this usecase using QCLI demo?

Any feedbacks would help.

Thanks & Regards,

Naufal

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Tue, 2019-09-24 16:25

Kindly use below commands to connect QCA4020 to smartphone.

> ble InitializeBluetooth
> ble spple RegisterSPPLE
> ble AdvertiseLE 1

You should see "lpw-spple-demo" as QCA4020 device name on you smart phone.

  • Up0
  • Down0
naufal.shidqi
Join Date: 27 Sep 18
Posts: 3
Posted: Tue, 2019-09-24 21:51

Hi, 

Thank you for your reply! 
Yes, I can see lpw-spple-demo and paired the QCA402x.
Here is the log :

> ble InitializeBluetooth
 
 
BLE: OpenStack().
BLE: Bluetooth Stack ID: 1.
BLE: Device Chipset: 5.0.
BLE: Number ACL Buffers: 16, ACL Buffer Size: 81
BLE: HCI Event Registration Successful.
BLE: ACL Data Callback Registration Successful.
BLE: BD_ADDR: 0x1305567F0300
BLE: Connection Tx Power: 4.
BLE: Initialized 6LoWPAN layer for BLE.
 
> ble spple RegisterSPPLE
 
BLE\SPPLE: Successfully registered SPPLE Service, ServiceID = 5.
 
> ble AdvertiseLE 1
 
BLE: Advertising Channel Tx Power: 4.
BLE:    The 128-bit SPPLE Service UUID CANNOT fit in the scan response data.
BLE:    GAP_LE_Advertising_Enable success, Advertising Interval Range: 100 - 200.
 
>
BLE: etLE_Connection_Complete with size 24.
BLE:    Status:              0x00.
BLE:    Role:                Slave.
BLE:    Address Type:        QAPI_BLE_LAT_RANDOM_E.
BLE:    BD_ADDR:             0x72F0121D5992.
BLE:    Connection Interval: 49.
BLE:    Slave Latency:       0.
 
>
BLE: etGATT_Connection_Device_Connection with size 16:
BLE:    Connection ID:   1.
BLE:    Connection Type: LE.
BLE:    Remote Device:   0x72F0121D5992.
BLE:    Connection MTU:  23.
 
BLE: Selected Remote Device:
BLE:    Address:       0x72F0121D5992
BLE:    ID:            1
 
>
BLE: etLE_Channel_Selection_Algorithm_Update with size 16.
BLE:   Channel Selection Algorithm:        CSA #1.
BLE:   Connection Address Type:            QAPI_BLE_LAT_RANDOM_E.
BLE:   Connection Address:                 0x72F0121D5992.
 
>
BLE: etLE_Authentication with size 96.
BLE: Extended Pairing Request: 0x72F0121D5992.
BLE:    IO Capability:       Keyboard/Display.
BLE:    Bonding Type:        Bonding.
BLE:    MITM:                TRUE.
BLE:    Secure Connections:  TRUE.
BLE:    OOB:                 OOB Not Present.
BLE:    Encryption Key Size: 16.
BLE:    Sending Keys:
BLE:       LTK:              YES.
BLE:       IRK:              YES.
BLE:       CSRK:             YES.
BLE:       Link Key:         YES.
BLE:    Receiving Keys:
BLE:       LTK:              YES.
BLE:       IRK:              YES.
BLE:       CSRK:             YES.
BLE:       Link Key:         YES.
BLE: Sending Pairing Response to 0x72F0121D5992.
BLE: GAP_LE_Authentication_Response returned 0.
 
>
BLE\GAPS: Exchange MTU Response.
BLE\GAPS: Connection ID:   1.
BLE\GAPS: Transaction ID:  1.
BLE\GAPS: Connection Type: LE.
BLE\GAPS: BD_ADDR:         0x72F0121D5992.
BLE\GAPS: MTU:             517.
 
>
BLE: etLE_Connection_Parameter_Update_Request with size 14.
BLE:    BD_ADDR:                     0x72F0121D5992
BLE:    Connection Interval Minimum: 8
BLE:    Connection Interval Maximum: 8
BLE:    Slave Latency:               0
BLE:    Supervision Timeout:         20000
 
>
BLE: etLE_Authentication with size 96.
BLE: latExtendedConfirmationRequest.
BLE:    Secure Connections:     YES.
BLE:    Just Works Pairing:     YES.
BLE:    Keypress Notifications: NO.
BLE: Invoking Just Works.
 
>
BLE: etLE_Connection_Parameter_Updated with size 14.
BLE:    BD_ADDR:             0x72F0121D5992
BLE:    Status:              0
BLE:    Connection Interval: 8
BLE:    Slave Latency:       0
BLE:    Supervision Timeout: 20000
 
>
BLE: etLE_Encryption_Change with size 12.
 
>
BLE: etLE_Authentication with size 96.
BLE:  Encryption Information from RemoteDevice: 0x72F0121D5992.
BLE:                              Key Size: 16.
 
>
BLE: etLE_Authentication with size 96.
BLE: Identity Information Request 0x72F0121D5992.
BLE:    qapi_BLE_GAP_LE_Authentication_Response (larEncryptionInformation) success.
 
>
BLE: etLE_Authentication with size 96.
BLE:  Identity Information from RemoteDevice: 0x72F0121D5992.
 
>
BLE: etLE_Authentication with size 96.
BLE: Pairing Status: 0x72F0121D5992.
BLE:         Status: 0x00.
BLE:         Key Size: 16.
 
>
BLE: etLE_Connection_Parameter_Update_Request with size 14.
BLE:    BD_ADDR:                     0x72F0121D5992
BLE:    Connection Interval Minimum: 49
BLE:    Connection Interval Maximum: 49
BLE:    Slave Latency:               0
BLE:    Supervision Timeout:         20000
 
>
BLE: etLE_Connection_Parameter_Updated with size 14.
BLE:    BD_ADDR:             0x72F0121D5992
BLE:    Status:              0
BLE:    Connection Interval: 49
BLE:    Slave Latency:       0
BLE:    Supervision Timeout: 20000
 
>
BLE: etGATT_Connection_Device_Disconnection with size 16:
BLE:    Connection ID:   1.
BLE:    Connection Type: LE.
BLE:    Remote Device:   0x72F0121D5992.
 
>
BLE: etLE_Disconnection_Complete with size 16.
BLE:    Status: 0x00.
BLE:    Reason: 0x13.
BLE:    BD_ADDR: 0x72F0121D5992.

I have several questions:
1. Why is my smartphone Bluetooth Address randomized? is it set by default to QAPI_BLE_LAT_RANDOM_E?
2. At the end of the log (after pairing), it disconnects automatically with the remote, is it normal?
 
Please advise.
 
Thanks & Regards,
Naufal
 
  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Mon, 2019-09-30 15:18
BLE: etLE_Disconnection_Complete with size 16.
BLE:    Status: 0x00.
BLE:    Reason: 0x13.
BLE:    BD_ADDR: 0x72F0121D5992.

> QCLI_demo will try to print the peer remote address received during connection, hence it depends on the smart phone to provide DEFAULT/RAMDOM address.

 > From the log, the disconnection  Reason: 0x13. (REMOTE device smart phone initiated disconnection).
  • 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.