Go to the documentation of this file.
67 #include "custom_config.h"
68 #include "flash_scatter_config.h"
74 #define OTAS_CONNECTION_MAX 10
75 #define OTAS_MAX_DATA_LEN 244
76 #define OTAS_VERSION 0x02
77 #define BLE_UUID_OTA_SERVICE 0x1B, 0xD7, 0x90, 0xEC, 0xE8, 0xB9, 0x75, 0x80,\
78 0x0A, 0x46, 0x44, 0xD3, 0x01, 0x04, 0xED, 0xA6
sdk_err_t otas_notify_tx_data(uint8_t conn_idx, uint8_t *p_data, uint16_t length)
Send data to peer device.
@ OTAS_EVT_TX_NOTIFICATION_ENABLED
tx notification enable event for ota service.
otas_dfu_mode_t dfu_mode
OTA Service dfu mode.
void(* otas_evt_handler_t)(otas_evt_t *p_evt)
OTA Service event handler type.
@ OTAS_EVT_INVALID
Invalid event for ota service.
uint8_t * p_data
Pointer to data.
uint16_t otas_service_start_handle_get(void)
Provide the interface for other modules to obtain the ots service start handle .
@ OTAS_CTRL_PT_OP_RSP_CODE
Response code.
uint8_t conn_idx
Index of connection.
otas_dfu_mode_t
OTA Service dfu mode.
@ OTAS_DFU_MODE_COPY_UPGRADE
OTAS Copy DFU mode (Double bank, Background).
@ OTAS_EVT_DISCONNECT
link disconnected.
otas_ctrl_pt_op_code_t
OTA Service Control Point Operation Code.
@ OTAS_DFU_MODE_RESERVED
Reserved for future use.
@ OTAS_EVT_RX_RECEIVE_DATA
rx receive data event for ota service.
uint16_t length
Length of data.
@ OTAS_EVT_TX_NOTIFICATION_DISABLED
tx notification disable event for ota service.
@ OTAS_EVT_DFU_MODE_SET
set dfu mode for ota service.
OTA Service initialization variable.
@ OTAS_EVT_CTRL_PT_INDICATION_ENABLED
control point indication enable event for ota service.
@ OTAS_CTRL_PT_OP_RESERVED
Reserved for future use.
uint16_t sdk_err_t
SDK API result type.
@ OTAS_EVT_DFU_TASK_ENTER
set dfu task enter event for ota service.
sdk_err_t otas_service_init(otas_init_t *p_otas_init)
Add an OTA Service instance in the DB.
@ OTAS_CTRL_PT_OP_DFU_ENTER
OTAS task enter Operation Code.
@ OTAS_EVT_CTRL_PT_INDICATION_DISABLED
control point indication disable event for ota service.
@ OTAS_DFU_MODE_NON_COPY_UPGRADE
OTAS Non-Copy DFU mode (Single bank, Non-background).
@ OTAS_EVT_NOTIFY_COMPLETE
notify complete event for ota service.
otas_evt_type_t evt_type
The OTAS event.
otas_evt_handler_t evt_handler
Handler to handle otas event.
otas_evt_type_t
OTA Service event type.