kw36 connection interval,slave latency supersiontimeout set

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

kw36 connection interval,slave latency supersiontimeout set

893 Views
shawn_123
Contributor I

hi, dear nxp fae

    i am using a kw36 freedom board. used the SDK2.2.1 and run some examples. i want to change the three parameter connection interval, slave latency and superisontimeout. but i found there are many MACRO relate to this 3 parameter.

such as: 

ble_general.h

#define gcConnectionIntervalMin_c                  (0x000C) //(0x0006)
#define gcConnectionIntervalMax_c                  (0x000C) //(0x0C80)
#define gcConnectionSlaveLatencyMax_c             (0x0000)  //(0x01F3)
#define gcConnectionSupervisionTimeoutMin_c          (0x0C80)      //(0x000A)
#define gcConnectionSupervisionTimeoutMax_c          (0x0C80)     //(0x0C80)

#define gcConnectionIntervalMinDefault_c            (12)//(40)

#define gcConnectionIntervalMaxDefault_c            (12)//(160)

#define gcConnectionSlaveLatencyDefault_c           (0)

gap_types.h

/*! Default connection latency: 0 */
#define gGapDefaultConnectionLatency_d      0x0000
/*! Default supervision timeout: 10s */
#define gGapDefaultSupervisionTimeout_d          0x0C80//0x03E8 chang 10 to 32s
/*! Default minimum connection interval: 100ms */
#define gGapDefaultMinConnectionInterval_d       0x000C  //0x0050 change to 0x000C
/*! Default maximum connection interval: 200ms */
#define gGapDefaultMaxConnectionInterval_d       0x000C// 0x00A0 change to 0x000C

how can change them such as connection interval =15ms ,slave latency 6ms superision timeout =32s 

should i only need to change the "*Default*" or ("*Max*" and "*Min*")  or both,please give me a precise modification.thank you! 

Labels (3)
0 Kudos
3 Replies

788 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Yuan, I hope you're doing well!

 

The macros defined are for the default values for the connection parameters, but these can be changed when scanning a device on the BleApp_ScanningCallback function.

 

The values for connection interval, latency and supervision are modifiable in examples that use the BLE Central device type, as BLE Peripherals take this parameters from the Central device that wants to connect. For example, in the Wireless UART SDK example (<...\SDK_2.2.2_FRDM-KW36 - MCUXpresso\boards\frdmkw36\wireless_examples\bluetooth\w_uart>), these values can be found and changed in the gConnReqParams structure of the app_config.c source file.

 

For more information, could you please take a look at the BLE Application Developers Guide in the SDK Documentation folder?:

 

<…\SDK_2.2.2_FRDM-KW36\docs\wireless\Bluetooth\Bluetooth Low Energy Application Developer Guide.pdf>

 

Please let me know if you need any more information.

 

Best regards,

Sebastian

0 Kudos

788 Views
shawn_123
Contributor I

Dear Sebastián Del Río 

   thank you for your info. you means only the central device can update these parameters. if i need to update which.

either the device is act as a centrol and has such a gConnReqParams structure. and asigned user wanted value. or

used a client such as a smart phone or tablet. and write some code like java using android ble sdk and initiate scanning and update the parameters. is there any way for the peripheral call some api to update those by it self.

0 Kudos

788 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Yuan,

 

Connection parameters are negotiated between both Central and Peripheral devices during connection time, however, changes to the parameters can be requested by both of the device types, triggering a new negotiation process.

 

The peripheral cannot by itself change the parameters for its connection with the central device, it can however request a change.

 

The Peripheral Preferred Connection Parameters can also be set from the GATT DB of the peripheral device as well; this can be seen in chapter 7.1.4 of the BLE Application Developer's Guide:

<…\SDK_2.2.2_FRDM-KW36\docs\wireless\Bluetooth\Bluetooth Low Energy Application Developer Guide.pdf>

 

Please let me know if you need any more information.

 

Best regards,

Sebastian

0 Kudos