Wirepas SDK
waps_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 WAPS_FRAMES_H__
8#define WAPS_FRAMES_H__
9
10#include <stdint.h>
11#include <string.h>
12
14typedef uint8_t ep_t;
15
17typedef uint32_t w_addr_t;
18
20typedef uint16_t attr_t;
21
23typedef uint16_t pduid_t;
24
26#include "sap/dsap_frames.h"
27#include "sap/msap_frames.h"
28#include "sap/csap_frames.h"
29
31#define WAPS_MIN_FRAME_LENGTH (uint16_t)(sizeof(frame_header_t))
32
34#define WAPS_MAX_FRAME_PAYLOAD (uint16_t)(sizeof(waps_frame_payload_t))
35
37#define WAPS_MAX_FRAME_LENGTH (uint16_t)(sizeof(waps_frame_t))
38
40typedef struct __attribute__ ((__packed__))
41{
42 uint8_t result;
44
45typedef struct __attribute__ ((__packed__))
46{
47 // Service/function code,
48 uint8_t sfunc;
49 // Frame identifier
50 uint8_t sfid;
51 // Payload length in bytes
52 uint8_t splen;
54
63
64typedef struct __attribute__ ((__packed__))
65{
66 // Service/function code,
67 uint8_t sfunc;
68 // Frame identifier
69 uint8_t sfid;
70 // Payload length in bytes
71 uint8_t splen;
72 // Upper level payload, length range is 0-36
73 union
74 {
75 frame_dsap dsap;
76 frame_msap msap;
77 frame_csap csap;
78 frame_attr attr;
79 simple_cnf_t simple_cnf;
80 uint8_t spld[WAPS_MAX_FRAME_PAYLOAD];
81 };
83
84#endif
uint16_t attr_t
Definition waps_frames.h:20
uint8_t result
Definition waps_frames.h:42
simple_cnf_t simple_cnf
Definition waps_frames.h:61
uint32_t w_addr_t
Definition waps_frames.h:17
uint16_t pduid_t
Definition waps_frames.h:23
#define WAPS_MAX_FRAME_PAYLOAD
Definition waps_frames.h:34
uint8_t ep_t
Definition waps_frames.h:14