- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to read values from a BLE server on one module using a Pioneer Kit as the Client so that I can hook up the Bridge Control Panel to the client via USB->I2C and plot the results.
I've taken the 100 Projects In 100 Days, Days #035 and #036 as my template, but I want to convert notifications to reads and as the service on the server module is a custom service it has a 128 bit UUID. I trigger a read using the following function:
void ReadPadsValues(void) {
CYBLE_API_RESULT_T api_result;
CYBLE_GATTC_READ_BY_TYPE_REQ_T *cyBle_readreq;
cyBle_readreq->range = attrHandleRange;
cyBle_readreq->uuid = PadsCharUuid;
cyBle_readreq->uuidFormat = CYBLE_GATT_128_BIT_UUID_FORMAT;
api_result = CyBle_GattcReadUsingCharacteristicUuid(cyBle_connHandle, cyBle_readreq);
}
I have tried to initialise PadsCharUuid
with my service UUID as a CYBLE_UUID_T
type, like this:
CYBLE_UUID_T PadsCharUuid = {.uuid128 = {0x00u, 0x31u, 0x01u, 0x9Bu, 0x5Fu, 0x80u, 0x00u, 0x00u, \
0x80u, 0x00u, 0x10u, 0x00u, 0x01u, 0xCBu, 0x03u, 0x00u}};
But in the automatically generated file BLE_StackGatt.h, GATT_SUPPORT_128_BIT_UUID
is not defined, so the type CYBLE_UUID_T
does not include the uuid128 portion of the union. So I get a warning when trying to initialise PadsCharUuid
.
Is there a way in the tools to cause GATT_SUPPORT_128_BIT_UUID
to be defined? Or is there a specific reason why it isn't, and am I going about it the wrong way.
Many thanks in advance.
Zigs
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hli,
Thanks for looking at this again. By this I guess you mean that when I click on the Custom Service under the "Profiles" tab, there is a box to enter a UUID on the right with a pull down to the right allowing 16-bit, 32-bit or 128-bit UUID's. My custom service does have a 128-bit UUID, but this doesn't result in GATT_SUPPORT_128_BIT_UUID being #defined in BLEStackGatt.h. This means that I am unable to assign a 128-bit value to a variable of type CYBLE_UUID_T. Perhaps this is a bug in PSoC Creator 3.3. I'll flag it as an issue.
In the meantime I have solved my problem by migrating to using CyBle_GattcReadCharacteristicValue which requires the handle of the service rather than the UUID, thus avoiding the problem.
Once again, thanks for your contribution.
Regards
Zigs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The 128 bit mode is set in the configuration dialog for the BLE copmponent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hli, and many thanks for responding quickly.
I'm afraid I can't find the option to set this. To clarify, I have the BLE set as Custom, Client, Central and am trying to define a UUID for use in a read request, to read a custom service on a server using a 128bit UUID.
I'm using PSoC Creator 3.3.
I've even go as far as adding a Custom Descriptor (with a 128 UUID) to the Generic Attribute Service to try and force the software to #define GATT_SUPPORT_128_BIT_UUID, but with no luck.
Following your comment, I also went back and checked my Server code, and even though this uses 128 UUID's the #define is missing.
Could you please be more specific about where you feel this setting is enabled in the BLE configuration dialog.
Many thanks
Zigs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you define your custom service, there is an option set the UUID length. So you should define a custom service that matches the one you are talking to, and use its methods.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hli,
Thanks for looking at this again. By this I guess you mean that when I click on the Custom Service under the "Profiles" tab, there is a box to enter a UUID on the right with a pull down to the right allowing 16-bit, 32-bit or 128-bit UUID's. My custom service does have a 128-bit UUID, but this doesn't result in GATT_SUPPORT_128_BIT_UUID being #defined in BLEStackGatt.h. This means that I am unable to assign a 128-bit value to a variable of type CYBLE_UUID_T. Perhaps this is a bug in PSoC Creator 3.3. I'll flag it as an issue.
In the meantime I have solved my problem by migrating to using CyBle_GattcReadCharacteristicValue which requires the handle of the service rather than the UUID, thus avoiding the problem.
Once again, thanks for your contribution.
Regards
Zigs