- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm writing an Android app to test and study the speed_test example in WICED SMART SDK, but encounter this problem:
Writing descriptor of SPEED_TEST_CHARACTERISTIC_DATA receives a success status on Android, but speed_test_write_handler is not called in the firmware. The "data descriptor" value changed trace is also not called.
Same writing method works for SPEED_TEST_CHARACTERISTIC_CONTROL_POINT. (speed_test_write_handler is called and shows "control descriptor" value changed)
And, the peerapp (Windows app) in the SDK project is able to write descriptor for both data and control characteristics.
Is it because descriptor writing method for data characteristic is different from control? Appreciate for helping!
Best regards,
Sam
[Edit]
Did some more tests and it seems which descriptor can be written is related to the handle. Following is my test:
1. No change in code:
Result:
Write Control descriptor shows success on phone. Write_handler callback is called by Control descriptor handle.
Write Data descriptor shows success on phone. Write_handler callback is not called.
2. Swap Data characteristic handles with Control characteristics handles:
#define HANDLE_SPEED_TEST_CHARACTERISTIC_DATA 0x2d
#define HANDLE_SPEED_TEST_CHARACTERISTIC_DATA_VALUE 0x2e
#define HANDLE_SPEED_TEST_DATA_CLIENT_CONFIGURATION_DESCRIPTOR 0x2f
#define HANDLE_SPEED_TEST_CHARACTERISTIC_CONTROL 0x2a
#define HANDLE_SPEED_TEST_CHARACTERISTIC_CONTROL_VALUE 0x2b
#define HANDLE_SPEED_TEST_CONTROL_CLIENT_CONFIGURATION_DESCRIPTOR 0x2c
Result:
Write Control descriptor shows success on phone, but write_handler callback is not called.
Write Data descriptor shows success on phone. Write_handler callback is called by Data descriptor handle.
3. Swap Data characteristic handles with Control characteristics handles, and swap position for Data and Control in speed_test_gatt_database[] (both positions of characteristic and descriptor are changed)
Result:
Write Control descriptor shows success on phone, but write_handler callback is not called.
Write Data descriptor shows success on phone. Write_handler callback is called by Data descriptor handle.
I have also tried several other handle numbers, but seems only 0x2f works.
[Edit 2]
I used wiced smart designer created a new project and created a characteristic with Device Role as Sensor sends value to host, and allow permission Notification in Client Configuration. Then, it works.
Guessing unable to write descriptor might because in speed_test, the characteristic is "writable". And, in .wic file, if set Device Role as Host writes to or read from sensor, Client Configuration tab will disappear.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the android source. I created a new project and found the issue may caused by Device Role setting. Please have a look my re-edit in the discussion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It may be a good idea to carry out these throughput tests in the Windows environment since speedtest.exe has already been provided for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
that should work. maybe you can collect over the air or SDK console traces to see what is going wrong. But it should be the same for Data and Control characteristic descriptors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi victorz, sorry for late reply. Yes, I was using trace to see if write handle callback function is called and from which handle. I did some more tests. Please have a look at my re-edit of the discussion.
- 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
Sorry for late reply. Yes the problem still happens. Please have a look my re-edit in the discussion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not sure it helps but you may like to take a peek at our Andorid reference soure code for SENSE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the android source. I created a new project and found the issue may caused by Device Role setting. Please have a look my re-edit in the discussion.
- 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
No issue when creating new project.