- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to take a uint16 characteristic and store it in a local variable. This is the code:
wrReqParam = (CYBLE_GATTS_WRITE_REQ_PARAM_T *) eventParam;
/* If the attribute handle of the characteristic written to
* is equal to that of the Delay_Info characteristic, then extract
* the Delay_Info data */
if (CYBLE_DELAY_SERVICE_DELAY_INFO_CHAR_HANDLE ==
wrReqParam->handleValPair.attrHandle)
{
TimeSignature[0] =
wrReqParam->handleValPair.value.val[0];
TimeSignature[1] =
wrReqParam->handleValPair.value.val[1];
Delay = wrReqParam->handleValPair.value.val;
}
wrReqParam works for the uint8 TimeSignature, but Delay is a uint16 and therefore gives me an error. Is there any way around this? Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you try replacing Delay = wrReqParam->handleValPair.value.val; with
Delay = ((uint16)TimeSignature[1])<<8)| (uint16) TimeSignature[0] ;
Thanks
Jobin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you try replacing Delay = wrReqParam->handleValPair.value.val; with
Delay = ((uint16)TimeSignature[1])<<8)| (uint16) TimeSignature[0] ;
Thanks
Jobin