- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Labels:
-
Over The Air Upgrades - OTA
-
SDK 2.X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes. According to the GATT spec result codes over 0x80 are reserved for the application to use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, can I control when to Response?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes. According to the GATT spec result codes over 0x80 are reserved for the application to use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.