QN9090 BLE Connection Service Discovery Failure

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QN9090 BLE Connection Service Discovery Failure

66 Views
Mohamed_Layouni
Contributor I

Hi, 

I'm using code from the qn9090dk6_private_profile_client_freertos SDK example. 

The code is running on the QN9090, and the goal is to build a Central device that connects to a peripheral with a specific service uuid. 

More specifically, the goal is for the central to start by scanning for other devices, then once it finds something it verifies that the scanned device has the specific UUID we're looking for. If so, it connects to that device, and then discover its services, characteristics, etc. Then it should go into a series of back and forth messages with that peripheral device.

Right now here's how the code I have behaves. It starts scanning, detect and finds the device with the specific UUID I'm looking for. The code then calls Gap_Connect() with the target remote address and the other connection parameters. Gap_Connect() returns, but I'm 100% sure, that it was successful. How do you check for sure that Gap_Connect() was successful?

The code then exchanges the MTU with the peripheral, and then starts discovering services on the peripheral using BleServDisc_Start(deviceId_t peerDeviceId).

 

The problem is that BleServDisc_Start() returns 0 services (although the Central has detected the UUID we're looking for at the scanning phase). So I wonder if this behavior is due to failure of Gap_Connect() or to something else that I'm missing.

 

Any thoughts on how to solve this? 

Thanks.

Labels (1)
Tags (1)
0 Kudos
Reply
3 Replies

40 Views
sofiaurueta
NXP Employee
NXP Employee

Hello,

 

Hope you're doing well.

 

What modifications did you implement in the code?

 

To confirm that Gap_Connect() was successful, you could check for the event gConnEvtConnected_c.

 

A connection has been established. Data in gapConnectionEvent_t.eventData.connectedEvent.

 

The connection callback is the same as the callback used by the Central when calling the Gap_Connect function.

If a Central initiates a connection to this Peripheral, the gConnEvtConnected_c connection event is triggered.

 

 

Best Regards,

Ana Sofia.

0 Kudos
Reply

26 Views
Mohamed_Layouni
Contributor I

Hi,

Thank you for the feedback. 

I'm integrating this program with a bigger codebase, but the the main changes to the SDK example are the following:

// In app_preinclude.h

/*! Enable/disable use of bonding capability */
#define gAppUseBonding_d 1

/*! Enable/disable use of pairing procedure */
#define gAppUsePairing_d 1

 

I run the code again, and I do see a gConnEvtConnected_c event on the Central following the call to Gap_Connect(). I looked at the eventdata and I see 

pConnectionEvent->eventData->failReason = 0x10

 

which, according to ble_general.h, corresponds to: 

gSmInvalidSmpPacketLength_c = gSmStatusBase_c | 0x10U, /*!< An SMP packet with an invalid length for the SMP packet type has been received. */

 

Any thought on what might be causing this?

 

Thanks.

 

0 Kudos
Reply

10 Views
sofiaurueta
NXP Employee
NXP Employee

Hello,

 

By any chance, could this be reproduced with the SDK example? If so, could you share the steps to replicate it?

 

Best Regards,

Ana Sofia.

0 Kudos
Reply