Wirepas SDK
msap_frames.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
7#ifndef MSAP_FRAMES_H_
8#define MSAP_FRAMES_H_
9
10#include <stdbool.h>
11#include "multicast.h"
12
18#define APP_CONF_MAX 80
19
25typedef uint8_t otap_seq_t;
26
33#define MSAP_MAX_NBORS 8
34
36#define MSAP_AUTOSTART 1
37
52
54typedef struct __attribute__ ((__packed__))
55{
59 uint8_t link_rel;
61 int8_t rssi_norm;
63 uint8_t cost_0;
65 uint8_t channel;
67 uint8_t type;
69 int8_t tx_power;
71 int8_t rx_power;
73 uint16_t last_update;
75
76/* MSAP attributes */
77
97
98/* MSAP attributes lengths */
117
118/* FUNC_WAPS_MSAP_STACK_START_REQUEST */
119
120typedef struct __attribute__ ((__packed__))
121{
124
125typedef struct __attribute__ ((__packed__))
126{
128 uint8_t result;
130
131/* FUNC_WAPS_MSAP_STACK_START_CONFIRMATION */
132/* FUNC_WAPS_MSAP_STACK_STOP_CONFIRMATION */
133
134typedef struct __attribute__ ((__packed__))
135{
137 uint8_t seq;
138 uint16_t interval;
139 uint8_t config[APP_CONF_MAX];
141
142typedef struct __attribute__ ((__packed__))
143{
145 uint8_t base_cost;
147
148typedef struct __attribute__ ((__packed__))
149{
151 uint8_t result;
153 uint8_t base_cost;
155
156typedef struct __attribute__ ((__packed__))
157{
159 uint8_t seq;
161 uint16_t interval;
163 uint8_t config[APP_CONF_MAX];
165
166typedef struct __attribute__ ((__packed__))
167{
169 uint8_t result;
171 uint8_t seq;
172 uint16_t interval;
173 uint8_t config[APP_CONF_MAX];
175
176typedef struct __attribute__ ((__packed__))
177{
178 uint8_t queued;
180
191
193typedef struct __attribute__ ((__packed__))
194{
196 uint32_t num_bytes;
200
215
217#define MSAP_SCRATCHPAD_BLOCK_MAX_NUM_BYTES 112
218
220typedef struct __attribute__ ((__packed__))
221{
223 uint32_t start_addr;
225 uint8_t num_bytes;
229
230#define FRAME_MSAP_SCRATCHPAD_BLOCK_REQ_HEADER_SIZE \
231 (sizeof(msap_scratchpad_block_req_t) - MSAP_SCRATCHPAD_BLOCK_MAX_NUM_BYTES)
232
253
255typedef struct __attribute__ ((__packed__))
256{
258 uint32_t num_bytes;
259 uint16_t crc;
260 uint8_t seq;
261 uint8_t type;
262 uint8_t status;
270 uint32_t area_id;
277
286
288typedef struct __attribute__ ((__packed__))
289{
293
302
304typedef struct __attribute__ ((__packed__))
305{
309 uint32_t num_bytes;
310 uint16_t crc;
311 uint8_t seq;
312 uint8_t type;
313 uint8_t status;
321 uint32_t area_id;
329
337
344
346typedef struct __attribute__ ((__packed__))
347{
349 uint8_t scan_ready;
351
353typedef struct __attribute__ ((__packed__))
354{
356 uint8_t result;
360
370
372typedef struct __attribute__ ((__packed__))
373{
375 uint32_t seconds;
379
381typedef struct __attribute__ ((__packed__))
382{
386
388
390typedef struct __attribute__ ((__packed__))
391{
394
396
398typedef struct
399{
401 uint8_t result;
403 uint8_t quality;
405 uint8_t error_codes;
407
424
426typedef struct __attribute__ ((__packed__))
427{
431 uint16_t target_crc;
433 uint8_t action;
435 uint8_t param;
437
450
452typedef struct __attribute__ ((__packed__))
453{
455 uint8_t result;
458 uint16_t target_crc;
459 uint8_t action;
460 uint8_t param;
462
464#define MSAP_SCRATCHPAD_BLOCK_READ_MAX_NUM_BYTES (MSAP_SCRATCHPAD_BLOCK_MAX_NUM_BYTES)
465
467typedef struct __attribute__ ((__packed__))
468{
470 uint32_t start_addr;
472 uint8_t num_bytes;
474
491
493typedef struct __attribute__ ((__packed__))
494{
496 uint8_t result;
500
501#define FRAME_MSAP_SCRATCHPAD_BLOCK_READ_CNF_HEADER_SIZE \
502 (sizeof(msap_scratchpad_block_read_cnf_t) - MSAP_SCRATCHPAD_BLOCK_READ_MAX_NUM_BYTES)
503
505#define MSAP_NPD_PAYLOAD_MAX_LEN 80
506
508typedef struct __attribute__((__packed__))
509{
511 uint16_t npd_endpoint;
515 uint8_t npd_payload[MSAP_NPD_PAYLOAD_MAX_LEN];
517
535
537typedef struct __attribute__((__packed__))
538{
540 uint8_t result;
542
544typedef struct __attribute__((__packed__))
545{
547 uint16_t npd_endpoint;
549
561
563#define MSAP_CONFIG_DATA_ITEM_GET_HEADER_SIZE (sizeof(msap_config_data_item_get_cnf_t) - MSAP_NPD_PAYLOAD_MAX_LEN)
564
566typedef struct __attribute__((__packed__))
567{
569 uint8_t result;
573 uint8_t npd_payload[MSAP_NPD_PAYLOAD_MAX_LEN];
575
584
586#define MSAP_CONFIG_DATA_LIST_ITEMS_MAX_NUM_ENDPOINTS 16
587
589#define MSAP_CONFIG_DATA_LIST_ITEMS_HEADER_SIZE (sizeof(msap_config_data_list_items_cnf_t) - sizeof(uint16_t) * MSAP_CONFIG_DATA_LIST_ITEMS_MAX_NUM_ENDPOINTS)
590
592typedef struct __attribute__((__packed__))
593{
595 uint8_t result;
601
603typedef struct __attribute__((__packed__))
604{
606 uint8_t command;
608
610typedef struct __attribute__((__packed__))
611{
615 uint16_t npd_endpoint;
619 uint8_t npd_payload[MSAP_NPD_PAYLOAD_MAX_LEN];
621
622typedef union
623{
654} frame_msap;
655
656#endif /* MSAP_FRAMES_H_ */
uint8_t start_options
msap_scratchpad_block_read_cnf_t scratchpad_block_read_cnf
msap_config_data_list_items_e
@ MSAP_CONFIG_DATA_LIST_ITEMS_NOT_SUPPORTED
@ MSAP_CONFIG_DATA_LIST_ITEMS_SUCCESS
#define APP_CONF_MAX
App config max size. The define is needed for compiling time size reservations.
Definition msap_frames.h:18
msap_sleep_state_rsp_t sleep_state_rsp
msap_int_read_cnf_t int_read_cnf
msap_config_data_list_items_cnf_t config_data_list_items_cnf
#define MSAP_CONFIG_DATA_LIST_ITEMS_MAX_NUM_ENDPOINTS
msap_nrls_status_e
@ MSAP_NRLS_SLEEP_NOT_STARTED
@ MSAP_NRLS_SLEEP_ACTIVE
msap_attr_size_e
@ MSAP_ATTR_ROUTE_COUNT_SIZE
@ MSAP_ATTR_MCAST_GROUPS_SIZE
@ MSAP_ATTR_AC_LIMITS_SIZE
@ MSAP_ATTR_SCRATCHPAD_NUM_BYTES_SIZE
@ MSAP_ATTR_SYSTEM_TIME_SIZE
@ MSAP_ATTR_PDU_BUFF_CAP_SIZE
@ MSAP_ATTR_PDU_BUFF_USAGE_SIZE
@ MSAP_ATTR_AC_RANGE_SIZE
@ MSAP_ATTR_CURRENT_AC_SIZE
@ MSAP_ATTR_RESERVED_1_SIZE
@ MSAP_ATTR_SCRATCHPAD_BLOCK_MAX_SIZE
@ MSAP_ATTR_STACK_STATUS_SIZE
@ MSAP_ATTR_AUTOSTART_SIZE
@ MSAP_ATTR_NBOR_COUNT_SIZE
msap_scratchpad_bootable_result_e
@ MSAP_SCRATCHPAD_BOOTABLE_INVALID_STATE
@ MSAP_SCRATCHPAD_BOOTABLE_NO_SCRATCHPAD
@ MSAP_SCRATCHPAD_BOOTABLE_SUCCESS
@ MSAP_SCRATCHPAD_BOOTABLE_ACCESS_DENIED
msap_int_write_req_t int_write_req
msap_config_data_item_ind_t config_data_item_ind
msap_scratchpad_clear_e
@ MSAP_SCRATCHPAD_CLEAR_SUCCESS
@ MSAP_SCRATCHPAD_CLEAR_INVALID_STATE
@ MSAP_SCRATCHPAD_CLEAR_ACCESS_DENIED
msap_config_data_list_items_req_t config_data_list_items_req
msap_config_data_item_get_cnf_t config_data_item_get_cnf
msap_sink_cost_read_cnf_t cost_read_cnf
msap_scratchpad_block_read_req_t scratchpad_block_read_req
msap_install_quality_cnf_t inst_qual_cnf
msap_scratchpad_start_e
@ MSAP_SCRATCHPAD_START_ACCESS_DENIED
@ MSAP_SCRATCHPAD_START_INVALID_STATE
@ MSAP_SCRATCHPAD_START_SUCCESS
@ MSAP_SCRATCHPAD_START_INVALID_NUM_BYTES
@ MSAP_SCRATCHPAD_START_INVALID_SEQ
msap_scratchpad_target_write_req_t scratchpad_target_write_req
msap_start_req_t start_req
msap_scratchpad_status_cnf_t scratchpad_status_cnf
msap_attr_e
Definition msap_frames.h:79
@ MSAP_ATTR_RESERVED_1
Definition msap_frames.h:92
@ MSAP_ATTR_CURRENT_AC
Definition msap_frames.h:88
@ MSAP_ATTR_SCRATCHPAD_NUM_BYTES
Definition msap_frames.h:90
@ MSAP_ATTR_AUTOSTART
Definition msap_frames.h:93
@ MSAP_ATTR_STACK_STATUS
Definition msap_frames.h:81
@ MSAP_ATTR_PDU_BUFF_CAPA
Definition msap_frames.h:83
@ MSAP_ATTR_SCRATCHPAD_BLOCK_MAX
Definition msap_frames.h:89
@ MSAP_ATTR_NBOR_COUNT
Definition msap_frames.h:84
@ MSAP_ATTR_MCAST_GROUPS
Definition msap_frames.h:95
@ MSAP_ATTR_AC_LIMITS
Definition msap_frames.h:87
@ MSAP_ATTR_SYSTEM_TIME
Definition msap_frames.h:86
@ MSAP_ATTR_PDU_BUFF_USAGE
Definition msap_frames.h:82
@ MSAP_ATTR_AC_RANGE
Definition msap_frames.h:94
@ MSAP_ATTR_ROUTE_COUNT
Definition msap_frames.h:85
msap_config_data_item_set_e
@ MSAP_CONFIG_DATA_ITEM_SET_OUT_OF_MEMORY
@ MSAP_CONFIG_DATA_ITEM_SET_INVALID_CONTENT
@ MSAP_CONFIG_DATA_ITEM_SET_SUCCESS
@ MSAP_CONFIG_DATA_ITEM_SET_NOT_SUPPORTED
@ MSAP_CONFIG_DATA_ITEM_SET_INVALID_ROLE
@ MSAP_CONFIG_DATA_ITEM_SET_INVALID_ENDPOINT
uint16_t interval
uint8_t queued_indications
msap_remote_status_req_t remote_status_req
msap_sleep_latest_gotosleep_rsp_t sleep_gotosleep_rsp_t
msap_config_data_item_get_req_t config_data_item_get_req
msap_state_ind_t state_ind
msap_scratchpad_block_e
@ MSAP_SCRATCHPAD_BLOCK_INVALID_NUM_BYTES
@ MSAP_SCRATCHPAD_BLOCK_COMPLETED_OK
@ MSAP_SCRATCHPAD_BLOCK_NOT_ONGOING
@ MSAP_SCRATCHPAD_BLOCK_SUCCESS
@ MSAP_SCRATCHPAD_BLOCK_INVALID_START_ADDR
@ MSAP_SCRATCHPAD_BLOCK_COMPLETED_ERROR
@ MSAP_SCRATCHPAD_BLOCK_INVALID_STATE
@ MSAP_SCRATCHPAD_BLOCK_INVALID_DATA
uint8_t otap_seq_t
Type for OTAP sequence number.
Definition msap_frames.h:25
msap_sleep_update_e
@ MSAP_SLEEP_SUCCESS
@ MSAP_SLEEP_INVALID_ROLE
@ MSAP_SLEEP_ACCESS_DENIED
@ MSAP_SLEEP_INVALID_STATE
@ MSAP_SLEEP_INVALID_VALUE
msap_scratchpad_target_write_res_e
@ MSAP_SCRATCHPAD_TARGET_ACCESS_DENIED
@ MSAP_SCRATCHPAD_TARGET_INVALID_VALUE
@ MSAP_SCRATCHPAD_TARGET_SUCCESS
@ MSAP_SCRATCHPAD_TARGET_INVALID_ROLE
msap_scan_nbors_status_e
@ MSAP_SCAN_NBORS_SUCCESS
@ MSAP_SCAN_NBORS_ACCESS_DENIED
@ MSAP_SCAN_NBORS_INVALID_STATE
msap_scratchpad_block_read_e
@ MSAP_SCRATCHPAD_BLOCK_READ_SUCCESS
@ MSAP_SCRATCHPAD_BLOCK_READ_INVALID_START_ADDR
@ MSAP_SCRATCHPAD_BLOCK_READ_ACCESS_DENIED
@ MSAP_SCRATCHPAD_BLOCK_READ_INVALID_NUM_BYTES
@ MSAP_SCRATCHPAD_BLOCK_READ_INVALID_STATE
@ MSAP_SCRATCHPAD_BLOCK_READ_NO_SCRATCHPAD
msap_sleep_start_req_t sleep_start_req
msap_scratchpad_block_req_t scratchpad_block_req
msap_scratchpad_action_e
@ MSAP_SCRATCHPAD_ACTION_PROPAGATE_AND_PROCESS_WITH_DELAY
@ MSAP_SCRATCHPAD_ACTION_LEGACY
@ MSAP_SCRATCHPAD_ACTION_PROPAGATE_ONLY
@ MSAP_SCRATCHPAD_ACTION_NO_OTAP
@ MSAP_SCRATCHPAD_ACTION_PROPAGATE_AND_PROCESS
#define MSAP_MAX_NBORS
Definition msap_frames.h:33
msap_ind_poll_cnf_t ind_poll_cnf
#define MSAP_SCRATCHPAD_BLOCK_READ_MAX_NUM_BYTES
msap_sink_cost_write_req_t cost_write_req
msap_int_ind_t int_ind
msap_scratchpad_start_req_t scratchpad_start_req
msap_remote_status_ind_t remote_status_ind
#define MSAP_SCRATCHPAD_BLOCK_MAX_NUM_BYTES
#define MSAP_NPD_PAYLOAD_MAX_LEN
msap_on_scanned_nbors_ind_t on_scanned_nbors
msap_remote_status_e
@ MSAP_REMOTE_STATUS_ACCESS_DENIED
msap_scratchpad_target_read_cnf_t scratchpad_target_read_cnf
msap_neighbor_type_e
MSAP nbor type.
Definition msap_frames.h:44
@ NEIGHBOR_IS_CLUSTER
Definition msap_frames.h:50
@ NEIGHBOR_IS_NEXT_HOP
Definition msap_frames.h:46
@ NEIGHBOR_IS_MEMBER
Definition msap_frames.h:48
msap_neighbors_cnf_t nbor_cnf
msap_config_data_item_set_req_t config_data_item_set_req
msap_config_data_item_get_e
@ MSAP_CONFIG_DATA_ITEM_GET_SUCCESS
@ MSAP_CONFIG_DATA_ITEM_GET_INVALID_ENDPOINT
@ MSAP_CONFIG_DATA_ITEM_GET_NOT_SUPPORTED
msap_config_data_item_set_cnf_t config_data_item_set_cnf
Definition msap_frames.h:55
#define MULTICAST_ADDRESS_AMOUNT
Definition multicast.h:12
uint32_t w_addr_t
Definition waps_frames.h:17