Unable to write descriptor of DATA characteristic in speed_test example

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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.

0 Likes
1 Solution
Anonymous
Not applicable

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.

View solution in original post

0 Likes
9 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

It may be a good idea to carry out these throughput tests in the Windows environment since speedtest.exe has already been provided for.

0 Likes

sam.wang

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.

0 Likes
Anonymous
Not applicable

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.

0 Likes
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

sam.wang

Is this still an issue?

0 Likes
Anonymous
Not applicable

Sorry for late reply. Yes the problem still happens. Please have a look my re-edit in the discussion.

0 Likes

Not sure it helps but you may like to take a peek at our Andorid reference soure code for SENSE.

WICED Sense Android Source (v1.08)

0 Likes
Anonymous
Not applicable

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.

0 Likes

sam.wang Is this still an issue?

0 Likes
Anonymous
Not applicable

No issue when creating new project.

0 Likes