otas.h
Go to the documentation of this file.
1 
59 #ifndef _OTAS_H_
60 #define _OTAS_H_
61 
62 /*
63  * INCLUDE FILES
64  ****************************************************************************************
65  */
66 #include "gr55xx_sys.h"
67 #include "custom_config.h"
68 
73 #define OTAS_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
74  10 : CFG_MAX_CONNECTIONS)
75 #define OTAS_MAX_DATA_LEN 244
76 #define BLE_UUID_OTA_SERVICE 0x1B, 0xD7, 0x90, 0xEC, 0xE8, 0xB9, 0x75, 0x80,\
77  0x0A, 0x46, 0x44, 0xD3, 0x01, 0x04, 0xED, 0xA6
78 #define OTAS_CTRL_ENTER_DFU 0x474f4f44
86 typedef enum
87 {
88  OTAS_EVT_INVALID,
89  OTAS_EVT_TX_NOTIFICATION_ENABLED,
90  OTAS_EVT_TX_NOTIFICATION_DISABLED,
91  OTAS_EVT_RX_RECEIVE_DATA,
92  OTAS_EVT_NOTIFY_COMPLETE,
93  OTAS_EVT_DFU_MODE_ENTER,
102 typedef struct
103 {
105  uint8_t conn_idx;
106  uint8_t *p_data;
107  uint16_t length;
108 } otas_evt_t;
116 typedef void (*otas_evt_handler_t)(otas_evt_t *p_evt);
117 
119 typedef void (*function)(void);
127 typedef struct
128 {
130 } otas_init_t;
148 
149 
161 sdk_err_t otas_notify_tx_data(uint8_t conn_idx, uint8_t *p_data,uint16_t length);
164 #endif
165 
otas_notify_tx_data
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_handler_t
void(* otas_evt_handler_t)(otas_evt_t *p_evt)
OTA Service event handler type.
Definition: otas.h:116
otas_evt_t
OTA Service event.
Definition: otas.h:103
otas_evt_t::p_data
uint8_t * p_data
Definition: otas.h:106
otas_evt_t::conn_idx
uint8_t conn_idx
Definition: otas.h:105
gr55xx_sys.h
GR55XX System API.
otas_evt_t::length
uint16_t length
Definition: otas.h:107
otas_init_t
OTA Service initialization variable.
Definition: otas.h:128
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
otas_service_init
sdk_err_t otas_service_init(otas_init_t *p_otas_init)
Add an OTA Service instance in the DB.
otas_evt_t::evt_type
otas_evt_type_t evt_type
Definition: otas.h:104
otas_init_t::evt_handler
otas_evt_handler_t evt_handler
Definition: otas.h:129
otas_evt_type_t
otas_evt_type_t
OTA Service event type.
Definition: otas.h:87