This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to change the connection settings of an already active connection?

Other Parts Discussed in Thread: CC2540

I had the issue that a connection between my CC2540 Dongle and my iPhone was constantly dropped by the iphone. I was able to resolve that issue using tool by connecting and after connecting, setting the connection settings the the following:

Min Connection Interval: 24, 
Max Connection Interval: 312, 
Slave Latency: 4, 
Supervision Timeout: 600

I found these values here: e2e.ti.com/.../363279 See the Answer by Martin Petřík.

within btool the output of setting looks like:

------------------------------------------------------------------------------------------------------------------------
[23] : <Tx> - 06:06:36.834
-Type : 0x01 (Command)
-Opcode : 0xFE30 (GAP_SetParam)
-Data Length : 0x03 (3) byte(s)
ParamID : 0x15 (Minimum Link Layer Connection Interval, 
When Using Connection Establishment 
Proc (mSec). TGAP_CONN_EST_INT_MIN)
ParamValue : 0x0018 (24)
Dump(Tx):
01 30 FE 03 15 18 00 

Now I want to add this part to my project (which is a fork of HIDAdvRemote Dongle), but I don't really know how to set these kind of parameters using C and the API. Any help or even a pointer would be greatly appreciated. 

Here is my full log from btool:

[1] : <Info> - 06:06:22.732
Port opened at 27.02.2015 18:06:22
------------------------------------------------------------------------------------------------------------------------
[2] : <Tx> - 06:06:23.075
-Type : 0x01 (Command)
-Opcode : 0xFE00 (GAP_DeviceInit)
-Data Length : 0x26 (38) byte(s)
ProfileRole : 0x08 ( Central )
MaxScanRsps : 0x05 (5)
IRK : 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
CSRK : 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
SignCounter : 0x00000001 (1)
Dump(Tx):
01 00 FE 26 08 05 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 01 00 00 00 
------------------------------------------------------------------------------------------------------------------------
[3] : <Rx> - 06:06:23.293
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE00 (GAP_DeviceInit)
DataLength : 0x00 (0)
Dump(Rx):
04 FF 06 7F 06 00 00 FE 00 
------------------------------------------------------------------------------------------------------------------------
[4] : <Rx> - 06:06:23.309
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x2C (44) bytes(s)
Event : 0x0600 (GAP_DeviceInitDone)
Status : 0x00 (Success)
DevAddr : 54:4A:16:48:A9:DE
DataPktLen : 0x001B (27)
NumDataPkts : 0x0C (12)
IRK : 3F:51:7F:51:EB:61:06:0E:D0:C0:59:DC:81:F9:48:E3
CSRK : D5:CF:09:1C:60:85:1E:28:C5:0A:FC:50:D3:C1:39:5C
Dump(Rx):
04 FF 2C 00 06 00 DE A9 48 16 4A 54 1B 00 0C 3F 
51 7F 51 EB 61 06 0E D0 C0 59 DC 81 F9 48 E3 D5 
CF 09 1C 60 85 1E 28 C5 0A FC 50 D3 C1 39 5C 
------------------------------------------------------------------------------------------------------------------------
[5] : <Tx> - 06:06:23.543
-Type : 0x01 (Command)
-Opcode : 0xFE31 (GAP_GetParam)
-Data Length : 0x01 (1) byte(s)
ParamID : 0x15 (Minimum Link Layer Connection Interval, 
When Using Connection Establishment 
Proc (mSec). TGAP_CONN_EST_INT_MIN)
Dump(Tx):
01 31 FE 01 15 
------------------------------------------------------------------------------------------------------------------------
[6] : <Tx> - 06:06:23.558
-Type : 0x01 (Command)
-Opcode : 0xFE31 (GAP_GetParam)
-Data Length : 0x01 (1) byte(s)
ParamID : 0x16 (Maximum Link Layer Connection Interval, 
When Using Connection Establishment 
Proc (mSec). TGAP_CONN_EST_INT_MAX)
Dump(Tx):
01 31 FE 01 16 
------------------------------------------------------------------------------------------------------------------------
[7] : <Tx> - 06:06:23.574
-Type : 0x01 (Command)
-Opcode : 0xFE31 (GAP_GetParam)
-Data Length : 0x01 (1) byte(s)
ParamID : 0x1A (Link Layer Connection Slave Latency, When Using 
Connection Establishment Proc (mSec) TGAP_CONN_EST_LATENCY)
Dump(Tx):
01 31 FE 01 1A 
------------------------------------------------------------------------------------------------------------------------
[8] : <Tx> - 06:06:23.590
-Type : 0x01 (Command)
-Opcode : 0xFE31 (GAP_GetParam)
-Data Length : 0x01 (1) byte(s)
ParamID : 0x19 (Link Layer Connection Supervision Timeout, 
When Using Connection Establishment 
Proc (mSec). TGAP_CONN_EST_SUPERV_TIMEOUT)
Dump(Tx):
01 31 FE 01 19 
------------------------------------------------------------------------------------------------------------------------
[9] : <Rx> - 06:06:23.590
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x08 (8) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE31 (GAP_GetParam)
DataLength : 0x02 (2)
ParamValue : 0x0018 (24)
Dump(Rx):
04 FF 08 7F 06 00 31 FE 02 18 00 
------------------------------------------------------------------------------------------------------------------------
[10] : <Rx> - 06:06:23.605
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x08 (8) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE31 (GAP_GetParam)
DataLength : 0x02 (2)
ParamValue : 0x0138 (312)
Dump(Rx):
04 FF 08 7F 06 00 31 FE 02 38 01 
------------------------------------------------------------------------------------------------------------------------
[11] : <Rx> - 06:06:23.621
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x08 (8) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE31 (GAP_GetParam)
DataLength : 0x02 (2)
ParamValue : 0x0004 (4)
Dump(Rx):
04 FF 08 7F 06 00 31 FE 02 04 00 
------------------------------------------------------------------------------------------------------------------------
[12] : <Rx> - 06:06:23.636
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x08 (8) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE31 (GAP_GetParam)
DataLength : 0x02 (2)
ParamValue : 0x0258 (600)
Dump(Rx):
04 FF 08 7F 06 00 31 FE 02 58 02 
------------------------------------------------------------------------------------------------------------------------
[13] : <Tx> - 06:06:28.722
-Type : 0x01 (Command)
-Opcode : 0xFE04 (GAP_DeviceDiscoveryRequest)
-Data Length : 0x03 (3) byte(s)
Mode : 0x03 (All)
ActiveScan : 0x01 (Enable)
WhiteList : 0x00 (Disable)
Dump(Tx):
01 04 FE 03 03 01 00 
------------------------------------------------------------------------------------------------------------------------
[14] : <Rx> - 06:06:28.753
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE04 (GAP_DeviceDiscoveryRequest)
DataLength : 0x00 (0)
Dump(Rx):
04 FF 06 7F 06 00 04 FE 00 
------------------------------------------------------------------------------------------------------------------------
[15] : <Rx> - 06:06:28.769
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x29 (41) bytes(s)
Event : 0x060D (GAP_DeviceInformation)
Status : 0x00 (Success)
EventType : 0x00 (Connectable Undirect Advertisement)
AddrType : 0x03 (PrivateResolve)
Addr : 5E:27:9C:52:B8:13
Rssi : 0xD0 (208)
DataLength : 0x1C (28)
Data : 02:01:1A:09:03:0A:18:0F:F8:12:F8:01:F8:0E:09:48:
49:44:20:41:64:76:52:65:6D:6F:74:65
Dump(Rx):
04 FF 29 0D 06 00 00 03 13 B8 52 9C 27 5E D0 1C 
02 01 1A 09 03 0A 18 0F F8 12 F8 01 F8 0E 09 48 
49 44 20 41 64 76 52 65 6D 6F 74 65 
------------------------------------------------------------------------------------------------------------------------
[16] : <Tx> - 06:06:29.564
-Type : 0x01 (Command)
-Opcode : 0xFE05 (GAP_DeviceDiscoveryCancel)
-Data Length : 0x00 (0) byte(s)
Dump(Tx):
01 05 FE 00 
------------------------------------------------------------------------------------------------------------------------
[17] : <Rx> - 06:06:29.596
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE05 (GAP_DeviceDiscoveryCancel)
DataLength : 0x00 (0)
Dump(Rx):
04 FF 06 7F 06 00 05 FE 00 
------------------------------------------------------------------------------------------------------------------------
[18] : <Rx> - 06:06:29.611
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x04 (4) bytes(s)
Event : 0x0601 (GAP_DeviceDiscoveryDone)
Status : 0x30 (The User Canceled The Task)
NumDevs : 0x00 (0)
Dump(Rx):
04 FF 04 01 06 30 00 
------------------------------------------------------------------------------------------------------------------------
[19] : <Tx> - 06:06:30.313
-Type : 0x01 (Command)
-Opcode : 0xFE09 (GAP_EstablishLinkRequest)
-Data Length : 0x09 (9) byte(s)
HighDutyCycle : 0x00 (Disable)
WhiteList : 0x00 (Disable)
AddrTypePeer : 0x03 (PrivateResolve)
PeerAddr : 13:B8:52:9C:27:5E
Dump(Tx):
01 09 FE 09 00 00 03 13 B8 52 9C 27 5E 
------------------------------------------------------------------------------------------------------------------------
[20] : <Rx> - 06:06:30.344
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE09 (GAP_EstablishLinkRequest)
DataLength : 0x00 (0)
Dump(Rx):
04 FF 06 7F 06 00 09 FE 00 
------------------------------------------------------------------------------------------------------------------------
[21] : <Info> - 06:06:30.454
Device Connected
Handle = 0x0000
Addr Type = 0x03 (PrivateResolve)
BDAddr = 5E:27:9C:52:B8:13
------------------------------------------------------------------------------------------------------------------------
[22] : <Rx> - 06:06:30.454
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x13 (19) bytes(s)
Event : 0x0605 (GAP_EstablishLink)
Status : 0x00 (Success)
DevAddrType : 0x03 (PrivateResolve)
DevAddr : 5E:27:9C:52:B8:13
ConnHandle : 0x0000 (0)
ConnInterval : 0x0138 (312)
ConnLatency : 0x0004 (4)
ConnTimeout : 0x0258 (600)
ClockAccuracy : 0x00 (0)
Dump(Rx):
04 FF 13 05 06 00 03 13 B8 52 9C 27 5E 00 00 38 
01 04 00 58 02 00 
------------------------------------------------------------------------------------------------------------------------
[23] : <Tx> - 06:06:36.834
-Type : 0x01 (Command)
-Opcode : 0xFE30 (GAP_SetParam)
-Data Length : 0x03 (3) byte(s)
ParamID : 0x15 (Minimum Link Layer Connection Interval, 
When Using Connection Establishment 
Proc (mSec). TGAP_CONN_EST_INT_MIN)
ParamValue : 0x0018 (24)
Dump(Tx):
01 30 FE 03 15 18 00 
------------------------------------------------------------------------------------------------------------------------
[24] : <Tx> - 06:06:36.850
-Type : 0x01 (Command)
-Opcode : 0xFE30 (GAP_SetParam)
-Data Length : 0x03 (3) byte(s)
ParamID : 0x16 (Maximum Link Layer Connection Interval, 
When Using Connection Establishment 
Proc (mSec). TGAP_CONN_EST_INT_MAX)
ParamValue : 0x0138 (312)
Dump(Tx):
01 30 FE 03 16 38 01 
------------------------------------------------------------------------------------------------------------------------
[25] : <Tx> - 06:06:36.865
-Type : 0x01 (Command)
-Opcode : 0xFE30 (GAP_SetParam)
-Data Length : 0x03 (3) byte(s)
ParamID : 0x1A (Link Layer Connection Slave Latency, When Using 
Connection Establishment Proc (mSec) TGAP_CONN_EST_LATENCY)
ParamValue : 0x0004 (4)
Dump(Tx):
01 30 FE 03 1A 04 00 
------------------------------------------------------------------------------------------------------------------------
[26] : <Tx> - 06:06:36.881
-Type : 0x01 (Command)
-Opcode : 0xFE30 (GAP_SetParam)
-Data Length : 0x03 (3) byte(s)
ParamID : 0x19 (Link Layer Connection Supervision Timeout, 
When Using Connection Establishment 
Proc (mSec). TGAP_CONN_EST_SUPERV_TIMEOUT)
ParamValue : 0x0258 (600)
Dump(Tx):
01 30 FE 03 19 58 02 
------------------------------------------------------------------------------------------------------------------------
[27] : <Rx> - 06:06:36.881
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE30 (GAP_SetParam)
DataLength : 0x00 (0)
Dump(Rx):
04 FF 06 7F 06 00 30 FE 00 
------------------------------------------------------------------------------------------------------------------------
[28] : <Rx> - 06:06:36.896
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE30 (GAP_SetParam)
DataLength : 0x00 (0)
Dump(Rx):
04 FF 06 7F 06 00 30 FE 00 
------------------------------------------------------------------------------------------------------------------------
[29] : <Rx> - 06:06:36.912
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE30 (GAP_SetParam)
DataLength : 0x00 (0)
Dump(Rx):
04 FF 06 7F 06 00 30 FE 00 
------------------------------------------------------------------------------------------------------------------------
[30] : <Rx> - 06:06:36.928
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE30 (GAP_SetParam)
DataLength : 0x00 (0)
Dump(Rx):
04 FF 06 7F 06 00 30 FE 00 
------------------------------------------------------------------------------------------------------------------------
[31] : <Info> - 06:06:42.606
Device Disconnected
Handle = 0x0000
Addr Type = 0x03 (PrivateResolve)
BDAddr = 5E:27:9C:52:B8:13
------------------------------------------------------------------------------------------------------------------------
[32] : <Rx> - 06:06:42.606
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x0606 (GAP_TerminateLink)
Status : 0x00 (Success)
ConnHandle : 0x0000 (0)
Reason : 0x13 (Peer Requested)
Dump(Rx):
04 FF 06 06 06 00 00 00 13 
------------------------------------------------------------------------------------------------------------------------
[33] : <Tx> - 06:06:47.239
-Type : 0x01 (Command)
-Opcode : 0xFE09 (GAP_EstablishLinkRequest)
-Data Length : 0x09 (9) byte(s)
HighDutyCycle : 0x00 (Disable)
WhiteList : 0x00 (Disable)
AddrTypePeer : 0x03 (PrivateResolve)
PeerAddr : 13:B8:52:9C:27:5E
Dump(Tx):
01 09 FE 09 00 00 03 13 B8 52 9C 27 5E 
------------------------------------------------------------------------------------------------------------------------
[34] : <Rx> - 06:06:47.286
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFE09 (GAP_EstablishLinkRequest)
DataLength : 0x00 (0)
Dump(Rx):
04 FF 06 7F 06 00 09 FE 00 
------------------------------------------------------------------------------------------------------------------------
[35] : <Info> - 06:06:47.411
Device Connected
Handle = 0x0000
Addr Type = 0x03 (PrivateResolve)
BDAddr = 5E:27:9C:52:B8:13
------------------------------------------------------------------------------------------------------------------------
[36] : <Rx> - 06:06:47.411
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x13 (19) bytes(s)
Event : 0x0605 (GAP_EstablishLink)
Status : 0x00 (Success)
DevAddrType : 0x03 (PrivateResolve)
DevAddr : 5E:27:9C:52:B8:13
ConnHandle : 0x0000 (0)
ConnInterval : 0x0138 (312)
ConnLatency : 0x0004 (4)
ConnTimeout : 0x0258 (600)
ClockAccuracy : 0x00 (0)
Dump(Rx):
04 FF 13 05 06 00 03 13 B8 52 9C 27 5E 00 00 38 
01 04 00 58 02 00 
------------------------------------------------------------------------------------------------------------------------
[37] : <Tx> - 06:06:53.105
-Type : 0x01 (Command)
-Opcode : 0xFD88 (GATT_DiscCharsByUUID)
-Data Length : 0x08 (8) byte(s)
ConnHandle : 0x0000 (0)
StartHandle : 0x0001 (1)
EndHandle : 0xFFFF (65535)
Type : 00:2A
Dump(Tx):
01 88 FD 08 00 00 01 00 FF FF 00 2A 
------------------------------------------------------------------------------------------------------------------------
[38] : <Rx> - 06:06:53.136
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFD88 (GATT_DiscCharsByUUID)
DataLength : 0x00 (0)
Dump(Rx):
04 FF 06 7F 06 00 88 FD 00 
------------------------------------------------------------------------------------------------------------------------
[39] : <Rx> - 06:06:55.476
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x0E (14) bytes(s)
Event : 0x0509 (ATT_ReadByTypeRsp)
Status : 0x00 (Success)
ConnHandle : 0x0000 (0)
PduLen : 0x08 (8)
Length : 0x07 (7)
Handle : 0x0002
Data : 02:03:00:00:2A
Dump(Rx):
04 FF 0E 09 05 00 00 00 08 07 02 00 02 03 00 00 
2A 
------------------------------------------------------------------------------------------------------------------------
[40] : <Rx> - 06:07:10.686
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x0509 (ATT_ReadByTypeRsp)
Status : 0x1A (The Procedure Is Completed)
ConnHandle : 0x0000 (0)
PduLen : 0x00 (0)
Dump(Rx):
04 FF 06 09 05 1A 00 00 00 
------------------------------------------------------------------------------------------------------------------------

  • Hi Sebastian,

    The log shows that you are using a Central role project. You can initiate a connection parameter update using GAPCentralRole_UpdateLink(). To set the connection parameters using defaults, use GAP_SetParamValue(). The available parameters, such as TGAP_CONN_EST_INT_MIN, are documented in gap.h.

    Best wishes