This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to simulate a control point write?

Hello,

I would like to provide an alternate mechanism to start the DFU process. Is it possible to call ble_dfu_buttonless_on_ctrl_pt_write() directly to kick-off the operation?

Thanks

  • Ok,

    Lets think of this as a unit test problem. Is it possible to simulate receiving a BT message without writing another application to send the desired message?

    Perhaps all I need to do is call "app_schedule_event_put(ble_evt_t*, ble_dfu_buttonless_on_ble_evt)"? If I used this to send a BLE_GATTS_EVT_WRITE and BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST would this trigger the bootloader?

    It looks like you could call ble_dfu_buttonless_on_ctrl_pt_write() too but where will the responses go? The first option is more desirable since it is closer to the metal.

    Thanks

  • You should be able to do something like this is main.

    ble_evt_t ble_evt;
    memset(&ble_evt, 0, sizeof(ble_evt_t));
    
    ble_evt.header.evt_id = BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST;
    
    ble_dfu_buttonless_on_ble_evt(&ble_evt, NULL);
    

    Is that what you are after?

Related