BLE security pairing & bi-direction tx/rx

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

BLE security pairing & bi-direction tx/rx

321 Views
JungkyuHan1
Contributor I

==== Environment ======

1. frdmkw38 board

2. ble_shell_freertos [BLE central]

3. wireless_uart_freertos[BLE peripheral]

======================

I am going to make a bi-directional communication BLE system with a security pairing base.

The Central system is based on [ble_shell example code].

The Peripheral system is based on [wiereless_uart example code]. (you can recommend other simple example code).

 

I want to now how to set or control on central side. [shell commands base]

It I have to manipulate the code please tell me.

With the upper environment. I going to make a [Security Pairing Connection].

================

gatt_uuid128.h [make same]

gatt_db.h [all same except value_device_name]

 

== app_preinclude.h =========

#define gAppMaxConnections_c (1U)

#define gAppUseBonding_d    0

#define gAppUsePairing_d     1

#define gAppUsePrivacy_d    0

#define gPasskeyValue_c       999999

=======================

<adv param in peripheral>

JungkyuHan1_1-1725935292908.png

 

<gScanParams>

JungkyuHan1_0-1725935246735.png

 

<gConnReqParams & gPairingParameters>

JungkyuHan1_2-1725935335583.png

 

<smpkeys & security params>

JungkyuHan1_3-1725935381653.png

JungkyuHan1_4-1725935414168.png

JungkyuHan1_5-1725935429832.png

 

 

 

 

 

 

 

0 Kudos
Reply
3 Replies

176 Views
Itzel_UV
NXP Employee
NXP Employee

Hi,

 

There is the services that are already are implemented for the BLE Shell and given as example, are listed on the guide SDK>docs>wireless>Bluethooth>Bluetooth® Low Energy Demo Applications User’s Guide.pdf>chapter 5.19:

 

  • Heart Rate Service (UUID: 0x180D)
  • Battery Service (UUID: 0x180F)
  • Device Information Service (UUID: 0x180A)
  • Internet Support Profile Service (0x1820)

 

You would need to implement the service so it can work on the Wireless UART, this might also explain the reason that it might have trouble to have connection.

 

It will indeed have worked connection the ShellGap_ConnectionCallback (gConnEvtPairingComplete_c) until it has succeeded or failed the pairing procedure, on your case we do see the massage of failure for it working on the W_UART.

 

Hope the answer helps to approached other way to the BLE Shell Example, and if there's more question, come back.

Regards,

Itzel.

0 Kudos
Reply

277 Views
Itzel_UV
NXP Employee
NXP Employee

Hello,

 

To have a security on the moment that you're paring the peripheral you are supposed to have configured the GAP Secure Mode and Level as Mode 1 Level 3 to have asked the authenticated encryption.

 

In order to set it you could do it from the serial port terminal with the command

 

gap paircfg [-usebonding usebonding] [-seclevel seclevel] [-keyflags flags]

 

There are also the default configurations, you could change it from the file bluetooth>gap_types.h on the define with name gGapDefaultSecurityRequirements_d.

 

If I understood wrongly the question, could you let me know.

 

Regards,

Itzel.

231 Views
JungkyuHan1
Contributor I

Dear Itzel

I test again with your guide. but still fail to pair.

Please check my debug message again.

using wireless uart code both central/periperal, pairing suceeded.

JungkyuHan1_1-1726816064826.png

but using wireless uart peripheral mode, ble_shell base central mode.

ble connection/discovery has success. but secure pairing FAILED.

JungkyuHan1_2-1726816105826.png

 

What do you recommend to check at this moment.

Always thanks your efforts.

B.R

 

0 Kudos
Reply