- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. modify the hello_client.c as below to add LEGATTDB_CHAR_PROP_NOTIFY | LEGATTDB_CHAR_PROP_INDICATE permission;
CHARACTERISTIC_UUID16 (0x0062, 0x0063, UUID_CHARACTERISTIC_BATTERY_LEVEL,
LEGATTDB_CHAR_PROP_READ | LEGATTDB_CHAR_PROP_NOTIFY | LEGATTDB_CHAR_PROP_INDICATE,
LEGATTDB_PERM_READABLE /*| LEGATTDB_PERM_WRITE_CMD |LEGATTDB_PERM_WRITE_REQ*/, 1),
0x60,
2. using the following code to modify characteristic value and send out the notification:
BLEPROFILE_DB_PDU db_pdu;
bleprofile_ReadHandle(0x63, &db_pdu);
db_pdu.pdu[0]=0x50;
bleprofile_WriteHandle(0x63, &db_pdu);
blecm_SetPtrConMux(hello_client.handle_to_master);
bleprofile_sendNotification(0x63, db_pdu.pdu, (INT32) db_pdu.len);
3. the connected android device can't receive the notification, but the value has been modified;
4. bleprofile_sendNotification(HANDLE_HELLO_CLIENT_DATA_VALUE, db_pdu.pdu, (INT32) db_pdu.len); ----for this characteristic,
the connected device can receive the notification.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I tried your code and it works.
I tried putting your code in number 2 into hello_client's timeout function and I was able to receive the notifications every second.
But instead of putting 0x50 all the time, I used a counter to see the changes.
If you put 0x50 all the time, you won't see any changes in the Android side unless you also show time stamps.
If you are seeing the value being modified to 0x50, but you don't see any changes, then perhaps this is your problem.
But I did verify that your code works.
Hope this helps.
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I tried your code and it works.
I tried putting your code in number 2 into hello_client's timeout function and I was able to receive the notifications every second.
But instead of putting 0x50 all the time, I used a counter to see the changes.
If you put 0x50 all the time, you won't see any changes in the Android side unless you also show time stamps.
If you are seeing the value being modified to 0x50, but you don't see any changes, then perhaps this is your problem.
But I did verify that your code works.
Hope this helps.
James