async_coap/message/
mod.rs

1// Copyright 2019 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15
16//! Types related to parsing and encoding CoAP messages.
17//!
18use super::*;
19
20/// Type for representing a CoAP message id.
21pub type MsgId = u16;
22
23mod read;
24pub use read::AckMessage;
25pub use read::MessageRead;
26pub use read::ResetMessage;
27
28mod write;
29pub use write::MessageWrite;
30
31mod msg_code;
32pub use msg_code::MsgCode;
33pub use msg_code::MsgCodeClass;
34
35mod msg_type;
36pub use msg_type::MsgType;
37
38mod display;
39pub use display::CoapByteDisplayFormatter;
40pub use display::MessageDisplay;
41
42mod null;
43pub use null::NullMessageRead;
44pub use null::NullMessageWrite;
45
46mod std_encoder;
47pub use std_encoder::BufferMessageEncoder;
48pub use std_encoder::VecMessageEncoder;
49
50mod std_parser;
51pub use std_parser::OwnedImmutableMessage;
52pub use std_parser::StandardMessageParser;
53
54mod token;
55pub use token::*;
56
57pub mod codec;
58
59#[allow(dead_code)]
60const COAP_MSG_VER_MASK: u8 = 0b11000000;
61
62#[allow(dead_code)]
63const COAP_MSG_VER_OFFS: u8 = 6;
64
65#[allow(dead_code)]
66const COAP_MSG_T_MASK: u8 = 0b00110000;
67
68#[allow(dead_code)]
69const COAP_MSG_T_OFFS: u8 = 4;
70
71#[allow(dead_code)]
72const COAP_MSG_TKL_MASK: u8 = 0b00001111;
73
74#[allow(dead_code)]
75const COAP_MSG_TKL_OFFS: u8 = 0;