- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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];
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Seems no such code example for GATT server handles its custom service.
Can you please clarify more about the specific issue encountered?