locked
What is the best way to implement BLE OTA in background ? RRS feed

  • Question

  • Hello,

    I have to implement a firmware update over the air using BLE communication in background on a

    custom characteristic.

    Write now the background task is implemented using DeviceUseTrigger .

    (1) Is this a good approach ?

    (2) How can i prevent the task from being killed by the OS ?

    Thank you,

    Sebastian

    Tuesday, June 9, 2015 5:47 PM

Answers

  • Hi Sebastian,

    Thanks for asking your question here.

    This forum only discuss APIs and development questions that available to public store app developers. Your question is about the firmware update and should be asked to OEM support channels.

    We will put this as off-topic. Thanks for your understanding.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    Alan Yao
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Sebastian Ene Thursday, June 11, 2015 9:42 AM
    Thursday, June 11, 2015 1:36 AM
  • Yes, a DeviceUseTrigger is the correct approach to use Bluetooth LE Gatt in the background.   It will allow you to run for a longer period of time.  Your application will need a way to verify, and rollback if the task is canceled by the OS.   Please read the following on the requirements etc...

    https://msdn.microsoft.com/en-us/library/windows/apps/dn630194.aspx

    You may want to require the device to be plugged in, or have a certain amount of battery power as well.   The battery saver is one way BG Tasks will be pre-empted.   

    With the few customers I worked with the following had caused the BG Task to be shut down:

    1) The foreground application crashes
    2) Battery Saver

    3)  The BG Task was not accessing the DeviceUseTrigger Device frequently enough..  Per the above article it is 1 I/O to the device every 5 seconds

    4) Another device with same GATT UUID is in the mix.   So use a very unique UUID, dont' use the default from sample code pulled from the internet, lots of folks use that.

    If you run into something specific please let us know.


    Bret Bentzinger (MSFT) @awehellyeah

    • Marked as answer by Sebastian Ene Sunday, June 14, 2015 12:10 PM
    Friday, June 12, 2015 5:36 PM

All replies

  • Hi Sebastian,

    Thanks for asking your question here.

    This forum only discuss APIs and development questions that available to public store app developers. Your question is about the firmware update and should be asked to OEM support channels.

    We will put this as off-topic. Thanks for your understanding.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    Alan Yao
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Sebastian Ene Thursday, June 11, 2015 9:42 AM
    Thursday, June 11, 2015 1:36 AM
  • Yes, a DeviceUseTrigger is the correct approach to use Bluetooth LE Gatt in the background.   It will allow you to run for a longer period of time.  Your application will need a way to verify, and rollback if the task is canceled by the OS.   Please read the following on the requirements etc...

    https://msdn.microsoft.com/en-us/library/windows/apps/dn630194.aspx

    You may want to require the device to be plugged in, or have a certain amount of battery power as well.   The battery saver is one way BG Tasks will be pre-empted.   

    With the few customers I worked with the following had caused the BG Task to be shut down:

    1) The foreground application crashes
    2) Battery Saver

    3)  The BG Task was not accessing the DeviceUseTrigger Device frequently enough..  Per the above article it is 1 I/O to the device every 5 seconds

    4) Another device with same GATT UUID is in the mix.   So use a very unique UUID, dont' use the default from sample code pulled from the internet, lots of folks use that.

    If you run into something specific please let us know.


    Bret Bentzinger (MSFT) @awehellyeah

    • Marked as answer by Sebastian Ene Sunday, June 14, 2015 12:10 PM
    Friday, June 12, 2015 5:36 PM