fast_otas.h
Go to the documentation of this file.
1 
59 #ifndef _FAST_OTAS_H_
60 #define _FAST_OTAS_H_
61 
62 /*
63  * INCLUDE FILES
64  ****************************************************************************************
65  */
66 #include "gr55xx_sys.h"
67 #include "custom_config.h"
68 
73 #define FAST_OTAS_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
74  10 : CFG_MAX_CONNECTIONS)
75 #define FAST_OTAS_MAX_DATA_LEN 244
76 #define BLE_UUID_FAST_OTA_SERVICE 0x1B, 0xD7, 0x90, 0xEC, 0xE8, 0xB9, 0x75, 0x80,\
77  0x0A, 0x46, 0x44, 0xD3, 0x01, 0x07, 0xED, 0xA6
79 #define FAST_OTA_PATTERN_VALUE 0x474f4f44
87 typedef enum
88 {
89  FAST_OTAS_EVT_INVALID,
90  FAST_OTAS_EVT_CMD_NOTIFICATION_ENABLED,
91  FAST_OTAS_EVT_CMD_NOTIFICATION_DISABLED,
92  FAST_OTAS_EVT_CMD_RECEIVE_DATA,
93  FAST_OTAS_EVT_CMD_NOTIFY_COMPLETE,
94  FAST_OTAS_EVT_DATA_RECEIVE_DATA
103 typedef struct
104 {
106  uint8_t conn_idx;
107  uint8_t *p_data;
108  uint16_t length;
117 typedef void (*fast_otas_evt_handler_t)(fast_otas_evt_t *p_evt);
118 
120 typedef void (*function)(void);
128 typedef struct
129 {
149 
150 
162 sdk_err_t fast_otas_notify_cmd_data(uint8_t conn_idx, uint8_t *p_data,uint16_t length);
165 #endif
166 
fast_otas_evt_t
FAST_OTA Service event.
Definition: fast_otas.h:104
fast_otas_service_init
sdk_err_t fast_otas_service_init(fast_otas_init_t *p_otas_init)
Add an FAST_OTA Service instance in the DB.
fast_otas_evt_type_t
fast_otas_evt_type_t
FAST_OTA Service event type.
Definition: fast_otas.h:88
fast_otas_notify_cmd_data
sdk_err_t fast_otas_notify_cmd_data(uint8_t conn_idx, uint8_t *p_data, uint16_t length)
Send data to peer device.
fast_otas_evt_t::conn_idx
uint8_t conn_idx
Definition: fast_otas.h:106
fast_otas_init_t
FAST_OTA Service initialization variable.
Definition: fast_otas.h:129
gr55xx_sys.h
GR55XX System API.
fast_otas_evt_handler_t
void(* fast_otas_evt_handler_t)(fast_otas_evt_t *p_evt)
FAST_OTA Service event handler type.
Definition: fast_otas.h:117
fast_otas_init_t::evt_handler
fast_otas_evt_handler_t evt_handler
Definition: fast_otas.h:130
fast_otas_evt_t::p_data
uint8_t * p_data
Definition: fast_otas.h:107
fast_otas_evt_t::evt_type
fast_otas_evt_type_t evt_type
Definition: fast_otas.h:105
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
fast_otas_evt_t::length
uint16_t length
Definition: fast_otas.h:108