cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 6

JeHu_3414236
Contributor II

I have one custom service defined in my GATT client.  PSoC creator defines this value:

#define CY_BLE_CUSTOMC_CUSTOM_SERVICE_SERVICE_INDEX   (0x01u) /* Index of Custom Service service in the cy_ble_customCServ array */

The cy_ble_customCServ array is defined as:

cy_stc_ble_customc_t cy_ble_customCServ[CY_BLE_CUSTOMC_SERVICE_COUNT]

and CY_BLE_CUSTOMC_SERVICE_COUNT = 1

How am I supposed to use CY_BLE_CUSTOMC_CUSTOM_SERVICE_SERVICE_INDEX?  It would be cy_ble_customCServ[1] when the size is only 1.  Should CY_BLE_CUSTOMC_CUSTOM_SERVICE_SERVICE_INDEX be defined as 0?

0 Likes
1 Solution
ShipingW_81
Moderator
Moderator

CY_BLE_CUSTOMC_CUSTOM_SERVICE_SERVICE_INDEX means the current number of custom service supported in GATT client. It cannot be defined as 0 if there is custom service existing.

CY_BLE_CUSTOMC_SERVICE_COUNT means the number of element in the cy_ble_customCServ array. It should be identical with CY_BLE_CUSTOMC_CUSTOM_SERVICE_SERVICE_INDEX.

View solution in original post

0 Likes
3 Replies
ShipingW_81
Moderator
Moderator

CY_BLE_CUSTOMC_CUSTOM_SERVICE_SERVICE_INDEX means the current number of custom service supported in GATT client. It cannot be defined as 0 if there is custom service existing.

CY_BLE_CUSTOMC_SERVICE_COUNT means the number of element in the cy_ble_customCServ array. It should be identical with CY_BLE_CUSTOMC_CUSTOM_SERVICE_SERVICE_INDEX.

View solution in original post

0 Likes
JeHu_3414236
Contributor II

Do you have an example project on how to use CY_BLE_CUSTOMC_CUSTOM_SERVICE_SERVICE_INDEX?  From this other thread Democode for PSoC6 BLE central reading value from custom service , it is being used the same way I interpreted it, which is apparently wrong:

myVal.attrHandle = cy_ble_customCServ[CY_BLE_CUSTOMC_HEAT_COST_ALLOCATOR_SERVICE_SERVICE_INDEX].customServChar[CY_BLE_CUSTOMC_HEAT_COST_ALLOCATOR_SERVICE_SENSORDATA_CHAR_INDEX].customServCharHandle[0];

0 Likes
ShipingW_81
Moderator
Moderator

Seems no such code example for GATT server handles its custom service.

Can you please clarify more about the specific issue encountered?

0 Likes
Top labels