3.1.7.7.3 OTA Services Interface

OTA Service Enum

typedef enum
{
    RNWF_OTA_ENABLE,                /**<Connected to MQTT broker event */
    RNWF_OTA_DISABLE,               /**<Connected to MQTT broker event */
    RNWF_OTA_CONFIG,                /**<Connected to MQTT broker event */
    RNWF_OTA_SET_CALLBACK,          /**<Register OTA application callback*/
    RNWF_OTA_SET_SRVC_CALLBACK,
    RNWF_OTA_AUTO_MODE,             /**<OTA Auto mode, triggered reqularly*/  
}RNWF_OTA_SERVICE_t;

RNWF OTA Event Enum

OTA Service Event list.
typedef enum
{
    RNWF_EVENT_MAKE_UART,   /**<Change to UART mode */
    RNWF_EVENT_DWLD_START,  /**<FW Download complete */
    RNWF_EVENT_DWLD_DONE,   /**<FW Download complete */
     
}RNWF_OTA_EVENT_t;

RNWF OTA Modes Enum

typedef enum 
{
    RNWF_OTA_MODE_HTTP,     /**<FW file is from HTTP server */
    RNWF_OTA_MODE_USB,      /**<FW file is from Host USB */
    RNWF_OTA_MODE_UART,     /**<FW file is from Host UART*/    
}RNWF_OTA_MODES_t;

OTA Chunk Header Struct

OTA Chunk struct:
typedef struct
{
    uint32_t chunk_addr; 
    uint32_t chunk_size;    
    uint8_t  *chunk_ptr;    
}RNWF_OTA_CHUNK_t;
OTA Header struct:
typedef struct
{
    uint32_t seq_num;
    uint32_t fw_ver;
    uint32_t start_addr;    
}RNWF_OTA_HDR_t;

OTA Configuration Parameters Enum

typedef enum
{
    OTA_CFG_PARAM_PORT,
    OTA_CFG_PARAM_SERVER,
    OTA_CFG_PARAM_FILE,
    OTA_CFG_PARAM_TYPE,
    OTA_CFG_PARAM_MAX,
}OTA_CFG_PARAM_t;

OTA Configuration Struct

typedef struct
{
    RNWF_NET_SOCKET_t socket;               /**<Socket handler for HTTP link*/
    RNWF_OTA_MODES_t mode;                  /**<Active OTA mode */
    RNWF_OTA_IMAGE_t type;                  /**<Image type */
    const char      *file;                  /**<Image File Name */
    const char      *certificate;
}RNWF_OTA_CFG_t;

OTA Image Enum

typedef enum
{
    RNWF_OTA_LOW_FW,        /**<FW at lower slot */
    RNWF_OTA_HIGH_FW,       /**<FW at higher slot */
    RNWF_OTA_FILESYSTEM,    /**<Files system slot*/
}RNWF_OTA_IMAGE_t;