MCPcopy Create free account
hub / github.com/attermann/microReticulum / get_packed_flags

Method get_packed_flags

src/microReticulum/Packet.cpp:121–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119
120
121uint8_t Packet::get_packed_flags() {
122 assert(_object);
123 uint8_t packed_flags = 0;
124 if (_object->_context == LRPROOF) {
125//TRACE("***** Packing with LINK type");
126 packed_flags = (_object->_header_type << 6) | (_object->_context_flag << 5) | (_object->_transport_type << 4) | (Type::Destination::LINK << 2) | _object->_packet_type;
127 }
128 else {
129 if (!_object->_destination) {
130 throw std::logic_error("Packet destination is required");
131 }
132//TRACEF("***** Packing with %d type", _object->_destination.type());
133 packed_flags = (_object->_header_type << 6) | (_object->_context_flag << 5) | (_object->_transport_type << 4) | (_object->_destination.type() << 2) | _object->_packet_type;
134 }
135 return packed_flags;
136}
137
138void Packet::unpack_flags(uint8_t flags) {
139 assert(_object);

Callers

nothing calls this directly

Calls 1

typeMethod · 0.45

Tested by

no test coverage detected