Wirepas SDK
wms_otap.h
Go to the documentation of this file.
1/* Copyright 2017 Wirepas Ltd. All Rights Reserved.
2 *
3 * See file LICENSE.txt for full license details.
4 *
5 */
6
20#ifndef APP_LIB_OTAP_H_
21#define APP_LIB_OTAP_H_
22
23#include <stdlib.h>
24#include <stdint.h>
25#include <stdbool.h>
26
27#include "wms_app.h"
28
30#define APP_LIB_OTAP_NAME 0x000f2338
31
33#define APP_LIB_OTAP_VERSION 0x202
34
51
61typedef enum
62{
68
93
113
124typedef uint8_t app_lib_otap_seq_t;
125
131typedef size_t
133
139typedef size_t
141
150typedef size_t
152
162 (*app_lib_otap_get_seq_f)(void);
163
173typedef uint16_t
174 (*app_lib_otap_get_crc_f)(void);
175
183
192
202typedef size_t
204
216
226typedef uint16_t
228
238typedef uint32_t
240
251typedef bool
253
263typedef bool
265
271typedef bool
273
300 (*app_lib_otap_read_f)(uint32_t start,
301 size_t num_bytes,
302 void * bytes);
303
318 (*app_lib_otap_clear_f)(void);
319
349 (*app_lib_otap_begin_f)(size_t num_bytes,
351
375 (*app_lib_otap_write_f)(uint32_t start,
376 size_t num_bytes,
377 const void * bytes);
378
393
457 app_lib_otap_seq_t target_sequence,
458 uint16_t target_crc,
460 uint8_t delay);
461
480 app_lib_otap_seq_t * target_sequence,
481 uint16_t * target_crc,
482 app_lib_otap_action_e * action,
483 uint8_t * delay);
484
512
513#endif /* APP_LIB_OTAP_H_ */
app_res_e
Definition wms_app.h:202
app_lib_otap_get_processed_area_id_f getProcessedAreaId
Definition wms_otap.h:500
app_lib_otap_type_e
Different scratchpad type.
Definition wms_otap.h:42
@ APP_LIB_OTAP_TYPE_BLANK
Definition wms_otap.h:44
@ APP_LIB_OTAP_TYPE_PRESENT
Definition wms_otap.h:47
@ APP_LIB_OTAP_TYPE_PROCESS
Definition wms_otap.h:49
app_lib_otap_type_e(* app_lib_otap_get_type_f)(void)
Get the type of the stored scratchpad.
Definition wms_otap.h:182
app_res_e(* app_lib_otap_get_target_scratchpad_and_action_f)(app_lib_otap_seq_t *target_sequence, uint16_t *target_crc, app_lib_otap_action_e *action, uint8_t *delay)
This service allows to get the information for scratchpad in the sink tree. What is the target scratc...
Definition wms_otap.h:479
app_lib_otap_get_num_bytes_f getNumBytes
Definition wms_otap.h:491
bool(* app_lib_otap_is_processed_f)(void)
Check if the stored scratchpad has been processed by the bootloader.
Definition wms_otap.h:264
bool(* app_lib_otap_is_set_to_be_processed_f)(void)
Check if scratchpad is set to be processed.
Definition wms_otap.h:272
app_lib_otap_clear_f clear
Definition wms_otap.h:505
app_res_e(* app_lib_otap_set_target_scratchpad_and_action_f)(app_lib_otap_seq_t target_sequence, uint16_t target_crc, app_lib_otap_action_e action, uint8_t delay)
This service allows to set the information for scratchpad in the sink tree. What is the target scratc...
Definition wms_otap.h:456
size_t(* app_lib_otap_get_max_num_bytes_f)(void)
Get maximum scratchpad size.
Definition wms_otap.h:132
app_lib_otap_is_processed_f isProcessed
Definition wms_otap.h:502
app_lib_otap_get_target_scratchpad_and_action_f getTargetScratchpadAndAction
Definition wms_otap.h:510
app_res_e(* app_lib_otap_begin_f)(size_t num_bytes, app_lib_otap_seq_t seq)
Start writing a new scratchpad.
Definition wms_otap.h:349
app_lib_otap_write_f write
Definition wms_otap.h:507
app_lib_otap_status_e(* app_lib_otap_get_status_f)(void)
Get the bootloader status of the stored scratchpad.
Definition wms_otap.h:191
app_lib_otap_is_set_to_be_processed_f isSetToBeProcessed
Definition wms_otap.h:503
app_lib_otap_get_processed_seq_f getProcessedSeq
Definition wms_otap.h:498
app_lib_otap_get_max_block_num_bytes_f getMaxBlockNumBytes
Definition wms_otap.h:492
app_lib_otap_write_res_e
Write function return code.
Definition wms_otap.h:75
@ APP_LIB_OTAP_WRITE_RES_NOT_ONGOING
Definition wms_otap.h:83
@ APP_LIB_OTAP_WRITE_RES_INVALID_NULL_BYTES
Definition wms_otap.h:91
@ APP_LIB_OTAP_WRITE_RES_COMPLETED_OK
Definition wms_otap.h:79
@ APP_LIB_OTAP_WRITE_RES_COMPLETED_ERROR
Definition wms_otap.h:81
@ APP_LIB_OTAP_WRITE_RES_INVALID_NUM_BYTES
Definition wms_otap.h:87
@ APP_LIB_OTAP_WRITE_RES_INVALID_START
Definition wms_otap.h:85
@ APP_LIB_OTAP_WRITE_RES_INVALID_HEADER
Definition wms_otap.h:89
@ APP_LIB_OTAP_WRITE_RES_OK
Definition wms_otap.h:77
app_lib_otap_read_f read
Definition wms_otap.h:504
app_lib_otap_write_res_e(* app_lib_otap_write_f)(uint32_t start, size_t num_bytes, const void *bytes)
Write a block of scratchpad.
Definition wms_otap.h:375
app_res_e(* app_lib_otap_set_to_be_processed_f)(void)
Mark the stored scratchpad to be eligible for processing by the bootloader.
Definition wms_otap.h:392
app_lib_otap_get_max_num_bytes_f getMaxNumBytes
Definition wms_otap.h:490
app_res_e(* app_lib_otap_clear_f)(void)
Erase a stored scratchpad from memory.
Definition wms_otap.h:318
app_lib_otap_action_e
Scratchpad possible actions.
Definition wms_otap.h:101
@ APP_LIB_OTAP_ACTION_PROPAGATE_ONLY
Definition wms_otap.h:105
@ APP_LIB_OTAP_ACTION_NO_OTAP
Definition wms_otap.h:103
@ APP_LIB_OTAP_ACTION_PROPAGATE_AND_PROCESS_WITH_DELAY
Definition wms_otap.h:111
@ APP_LIB_OTAP_ACTION_PROPAGATE_AND_PROCESS
Definition wms_otap.h:107
app_lib_otap_is_valid_f isValid
Definition wms_otap.h:501
uint16_t(* app_lib_otap_get_crc_f)(void)
Get the 16-bit CRC of the stored scratchpad.
Definition wms_otap.h:174
uint8_t app_lib_otap_seq_t
Type for OTAP sequence number.
Definition wms_otap.h:124
uint32_t(* app_lib_otap_get_processed_area_id_f)(void)
Get the area ID of the file in the scratchpad that produced the running stack firmware.
Definition wms_otap.h:239
app_lib_otap_get_status_f getStatus
Definition wms_otap.h:496
size_t(* app_lib_otap_get_processed_num_bytes_f)(void)
Get the size of scratchpad, in bytes, that produced the running stack firmware.
Definition wms_otap.h:203
app_lib_otap_seq_t(* app_lib_otap_get_seq_f)(void)
Get the OTAP sequence number.
Definition wms_otap.h:162
size_t(* app_lib_otap_get_num_bytes_f)(void)
Get stored scratchpad size.
Definition wms_otap.h:140
app_lib_otap_get_crc_f getCrc
Definition wms_otap.h:494
app_lib_otap_begin_f begin
Definition wms_otap.h:506
bool(* app_lib_otap_is_valid_f)(void)
Get the scratchpad validity status.
Definition wms_otap.h:252
app_lib_otap_set_to_be_processed_f setToBeProcessed
Definition wms_otap.h:508
app_lib_otap_seq_t(* app_lib_otap_get_processed_seq_f)(void)
Get the OTAP sequence number of the scratchpad that produced the running stack firmware.
Definition wms_otap.h:215
app_lib_otap_status_e
Status code from the bootloader.
Definition wms_otap.h:62
@ APP_LIB_OTAP_STATUS_OK
Definition wms_otap.h:64
@ APP_LIB_OTAP_STATUS_NEW
Definition wms_otap.h:66
app_lib_otap_set_target_scratchpad_and_action_f setTargetScratchpadAndAction
Definition wms_otap.h:509
uint16_t(* app_lib_otap_get_processed_crc_f)(void)
Get the 16-bit CRC of the scratchpad that produced the running stack firmware.
Definition wms_otap.h:227
app_lib_otap_get_type_f getType
Definition wms_otap.h:495
app_res_e(* app_lib_otap_read_f)(uint32_t start, size_t num_bytes, void *bytes)
Read a block of scratchpad.
Definition wms_otap.h:300
size_t(* app_lib_otap_get_max_block_num_bytes_f)(void)
Get maximum block size in bytes.
Definition wms_otap.h:151
app_lib_otap_get_processed_crc_f getProcessedCrc
Definition wms_otap.h:499
app_lib_otap_get_seq_f getSeq
Definition wms_otap.h:493
app_lib_otap_get_processed_num_bytes_f getProcessedNumBytes
Definition wms_otap.h:497