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.

CC2642R: CC2652R: How to remove connection params updates sent from simple_peripheral project

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG

CC26x2


Note: The following instructions have been written for SDK 3_40_00_02 but can be adapted to quite any SDK version (that is why I provided the sources but also the diff files). In addition, the code was written for CC2642R but can be adapted to all the devices of the family (CC2652R, CC2652P, CC1352R, CC1352P)

At the end of this instruction, you will get a project which is not anymore able to send requests to update the connection parameters. The project will still be able to answer a connection request.
The goal is to save flash space and CPU time.

How to do this?

  1. Import the project you want (the OOB simple_peripheral or the project where you have already removed the display function, the secondary advertisement and the auto PHY functionalities [see here])
  2. Do the following in simple_peripheral.c
    • Remove SimplePeripheral_processParamUpdate() function. Remove the call to the function (you can basically remove all the treatment of the events SP_SEND_PARAM_UPDATE_EVT and GAP_LINK_PARAM_UPDATE_EVENT)
    • Modify the spConnRec_t structure to remove the elements pParamUpdateEventData and pUpdateClock. Remove the code using those elements too.
    • Remove the list paramUpdateList (and the code referring to). As a result you can remove the functions SimplePeripheral_clearPendingParamUpdate()
    • Remove the definition of the struct spConnHandleEntry_t
    • Remove the inclusion of the list library: #include <ti/drivers/utils/List.h>

>> Here is the diff file and the file you are supposed to get if you also removed the display, the secondary advertisement and the auto PHY functionalities:

simple_peripheral_remove_update_param.diff
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
--- C:\ti\simplelink_cc13x2_26x2_sdk_3_40_00_02\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\simple_peripheral\Application\simple_peripheral_withoutAutoPHY.c Wed Feb 12 13:28:45 2020
+++ C:\ti\simplelink_cc13x2_26x2_sdk_3_40_00_02\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\simple_peripheral\Application\simple_peripheral_SIMPLE.c Wed Feb 12 15:35:38 2020
@@ -59,8 +59,6 @@
#include <intrinsics.h>
#endif
-#include <ti/drivers/utils/List.h>
-
#include <icall.h>
#include "util.h"
#include <bcomdef.h>
@@ -180,19 +178,10 @@
uint8_t data[];
} spClockEventData_t;
-// List element for parameter update and PHY command status lists
-typedef struct
-{
- List_Elem elem;
- uint16_t connHandle;
-} spConnHandleEntry_t;
-
// Connected device information
typedef struct
{
uint16_t connHandle; // Connection Handle
- spClockEventData_t* pParamUpdateEventData;
- Clock_Struct* pUpdateClock; // pointer to clock struct
} spConnRec_t;
/*********************************************************************
@@ -239,9 +228,6 @@
// Per-handle connection info
static spConnRec_t connList[MAX_NUM_BLE_CONNS];
-
-// List to store connection handles for queued param updates
-static List_List paramUpdateList;
// Advertising handles
static uint8 advHandleLegacy;
@@ -281,7 +267,6 @@
static uint8_t SimplePeripheral_addConn(uint16_t connHandle);
static uint8_t SimplePeripheral_getConnIndex(uint16_t connHandle);
static uint8_t SimplePeripheral_removeConn(uint16_t connHandle);
-static void SimplePeripheral_processParamUpdate(uint16_t connHandle);
static uint8_t SimplePeripheral_clearConnListEntry(uint16_t connHandle);
#ifdef PTM_MODE
void simple_peripheral_handleNPIRxInterceptEvent(uint8_t *pMsg); // Declaration
@@ -749,18 +734,6 @@
case SP_READ_RPA_EVT:
SimplePeripheral_updateRPA();
break;
-
- case SP_SEND_PARAM_UPDATE_EVT:
- {
- // Extract connection handle from data
- uint16_t connHandle = *(uint16_t *)(((spClockEventData_t *)pMsg->pData)->data);
-
- SimplePeripheral_processParamUpdate(connHandle);
-
- // This data is not dynamically allocated
- dealloc = FALSE;
- break;
- }
default:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
   0412.simple_peripheral_SIMPLE.C

Build and test your program. Except the eventual warning raised by SysConfig due to modification we did earlier, everything should build and work smoothly.