OTAFU data attribute

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

cross mob
Anonymous
Not applicable

Hi Sir,

I have a question. When I start transferring the upgrade data, it seems that the data keep transmitting without ack from device.

If I want to do the rate control and want an ack when device get the data, can I change the property like the HANDLE_WS_UPGRADE_CHARACTERISTIC_CONTROL_POINT? 

screenshot.pngscreenshot.png

0 Likes
1 Solution

Yes. According to the GATT spec result codes over 0x80 are reserved for the application to use.

View solution in original post

0 Likes
9 Replies
VictorZ_46
Employee
Employee
5 comments on blog 25 sign-ins 250 likes received

Characteristic property LAGATTDB_CHAR_PROP_WRITE indeed indicates to the client that it can only use Write Request which requires Write Response for every packet.  So the default procedure for the OTA uses acknowledge writes which is seems what you are looking for. 

The Indicate and Notify properties show that the value can be sent from the server to client and have nothing to do with the writes from client to server.

If you want to speed up the upgrade you can modify the properties of the DATA characteristic to support unacknowledged writes LEGATTDB_CHAR_PROP_WRITE_NO_RESPONSE.  But you would need to provide some flow control back to the client to prevent data loss.

0 Likes
Anonymous
Not applicable

Thanks, can I control when to Response?

0 Likes

No, your write handler will be called and as soon as you return the response will be send to the client. But if it is your client you can reply with some proprietary result code telling client to delay the next write.

0 Likes
Anonymous
Not applicable

I'm sorry, a little confuse, do you mean that I can return the proprietary result code in 'test_write_handler'?

legattdb_regWriteHandleCb((LEGATTDB_WRITE_CB) test_write_handler);

0 Likes

Yes. According to the GATT spec result codes over 0x80 are reserved for the application to use.

0 Likes
Anonymous
Not applicable

I try the WsOtaUpgrade on Windows 7 and have some question.

I add the message in the GattRequestCallback() but I do not see the result code is received in this function.

Do I misuse the function to get the return result?

0 Likes

When you return error code to the Write Req on the server, on the client side the WriteCharacteristic function should fail with the same error code.

0 Likes
Anonymous
Not applicable

I check the dwResult in the Send WsUpgradeData() function.

I try return 0x80, 0x81, the dwResult keep showing the same value 0x054f but not 0x80 or 0x81.

BTW, what's the size of the return result?

Well, it looks that Windows stack on Win7 has a problem and it returns ERROR_INTERNAL_ERROR whenever Write fails.  You may want to try on Win8, or Android, or iOS.  If this is not sufficient to you, you can also send proprietary Notification over the Control characteristic to flow control the client.

0 Likes