/* Function for handling the BLE_GATTS_EVT_WRITE event from the S110 SoftDevice.  */
static void on_write(ble_dfu_t *p_dfu, ble_evt_t *p_ble_evt)
/* Function for handling the BLE_GATTS_EVT_WRITE event from the S110 SoftDevice.  */
static void on_write(ble_dfu_t *p_dfu, ble_evt_t *p_ble_evt)
{
    if (p_ble_evt->evt.gatts_evt.params.write.handle == p_dfu->dfu_pkt_handles.value_handle)
    {
        ble_dfu_evt_t ble_dfu_evt;
        ble_dfu_evt.ble_dfu_evt_type             = BLE_DFU_PACKET_WRITE;
        ble_dfu_evt.evt.ble_dfu_pkt_write.len    = p_ble_evt->evt.gatts_evt.params.write.len;
        ble_dfu_evt.evt.ble_dfu_pkt_write.p_data = p_ble_evt->evt.gatts_evt.params.write.data;
        p_dfu->evt_handler(p_dfu, &ble_dfu_evt);
    }
}