BLE FOTA example for Central device

Hi,

Is there any example of a Central device which is able to connect to a peripheral and update it ? Im guessing the bluetooth_central_dfu_smp sample is probably the closest one to what I want.

Thank you!

Parents Reply
  • Thanks for the reply and for pointing me some useful stuff!

    So basically I'm using the NRF52840DK and NRF Connect 2.2.0.

    Im trying to send a 259395 bytes binary file - the update bin. In order to do it, im sending 64 bytes chunks to my peripheral. My encode is the following:

    zse->constant_state->stop_on_error = true;
    		zcbor_map_start_encode(zse, 20); // I think this is only used if you enable ZCBOR_CANONICAL
    		zcbor_tstr_put_lit(zse, "image");
    		zcbor_int64_put(zse, 0); // Image slot
    		zcbor_tstr_put_lit(zse, "data"); // Data
    		zcbor_bstr_put_lit(zse, (const char*)data); // 64 bytes chunk
        if (first) {
          zcbor_tstr_put_lit(zse, "len");
          zcbor_uint64_put(zse, (uint64_t)0x3F543); // Image size 259395 bytes
        }
    		zcbor_tstr_put_lit(zse, "off");
    		zcbor_uint64_put(zse, off); // Offset off+=64 each time
        if(first) {
          zcbor_tstr_put_lit(zse, "sha");
          zcbor_bstr_put_lit(zse, "12345");
        }
    		zcbor_tstr_put_lit(zse, "upgrade");
    		zcbor_bool_put(zse, false);
    		zcbor_map_end_encode(zse, 20); // Ditto as above


    Do you notice anything wrong here ?

    Thanks again will also take a look at the PR Slight smile

Children
Related