- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am using a custom event handler to send 2 bytes of data. How is this typically done?
Here are the things I've done: the custom characteristic in the BLE component in the TopDesign file is sent to send a uint16 value and I have a function that sends a uint16 value. I am having trouble assigning the handle (where do I change this to point to a uint16 value?) to the actual data I'm sending.
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You just treat the uint16 as an array of two uint8. Best way is to use a pointer to the variable, and cast the type of the pointer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You just treat the uint16 as an array of two uint8. Best way is to use a pointer to the variable, and cast the type of the pointer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Okay cool. So I have one byte that I send as the first element of the array and then the second byte that I send as the second element of the array? Should I write two functions that send each byte individually? I guess I'm still confused about how specifying a 2-element array of uint8s in the BLE component will match up with the functions that are sending the bytes.