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
14
typedef
uint8_t
ep_t
;
15
17
typedef
uint32_t
w_addr_t
;
18
20
typedef
uint16_t
attr_t
;
21
23
typedef
uint16_t
pduid_t
;
24
25
#include "
sap/attribute_frames.h
"
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
40
typedef
struct
__attribute__ ((__packed__))
41
{
42
uint8_t
result
;
43
}
simple_cnf_t
;
44
45
typedef
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
;
53
}
frame_header_t
;
54
55
typedef
union
56
{
57
frame_dsap
dsap
;
58
frame_msap
msap
;
59
frame_csap
csap
;
60
frame_attr
attr
;
61
simple_cnf_t
simple_cnf
;
62
}
waps_frame_payload_t
;
63
64
typedef
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
};
82
}
waps_frame_t
;
83
84
#endif
pduid_t
uint16_t pduid_t
Definition:
waps_frames.h:23
attribute_frames.h
frame_header_t::sfunc
uint8_t sfunc
Definition:
waps_frames.h:48
frame_header_t::sfid
uint8_t sfid
Definition:
waps_frames.h:50
frame_dsap
Definition:
dsap_frames.h:191
waps_frame_payload_t::simple_cnf
simple_cnf_t simple_cnf
Definition:
waps_frames.h:61
simple_cnf_t::result
uint8_t result
Definition:
waps_frames.h:42
waps_frame_t
Definition:
waps_frames.h:64
waps_frame_payload_t
Definition:
waps_frames.h:55
frame_header_t::splen
uint8_t splen
Definition:
waps_frames.h:52
waps_frame_payload_t::attr
frame_attr attr
Definition:
waps_frames.h:60
frame_csap
Definition:
csap_frames.h:96
ep_t
uint8_t ep_t
Definition:
waps_frames.h:14
waps_frame_payload_t::msap
frame_msap msap
Definition:
waps_frames.h:58
frame_header_t
Definition:
waps_frames.h:45
waps_frame_payload_t::dsap
frame_dsap dsap
Definition:
waps_frames.h:57
csap_frames.h
dsap_frames.h
WAPS_MAX_FRAME_PAYLOAD
#define WAPS_MAX_FRAME_PAYLOAD
Definition:
waps_frames.h:34
frame_attr
Definition:
attribute_frames.h:71
attr_t
uint16_t attr_t
Definition:
waps_frames.h:20
simple_cnf_t
Definition:
waps_frames.h:40
waps_frame_payload_t::csap
frame_csap csap
Definition:
waps_frames.h:59
msap_frames.h
w_addr_t
uint32_t w_addr_t
Definition:
waps_frames.h:17
frame_msap
Definition:
msap_frames.h:504