This structure represents raw message, that was sent between two virtual radios. It has no header and data are not structured.
More...
#include <Emulator_helpers.h>
|
| RawMessage (uint8_t *message, uint8_t messageLength, std::chrono::nanoseconds _sentTime, std::chrono::nanoseconds _sendingDoneTime) |
|
void | Set (uint8_t *message, uint8_t messageLength, std::chrono::nanoseconds _sentTime, std::chrono::nanoseconds _sendingDoneTime) |
| Sets message bytes. More...
|
|
void | Get (uint8_t *message, uint8_t &messageLength) const |
| Gets bytes from message. More...
|
|
void | Clear () |
| Clears data stored in message.
|
|
std::chrono::nanoseconds | SentTime () const |
| Gets time, when message was sent. More...
|
|
std::chrono::nanoseconds | ReceiveTime () const |
| Gets time, when message will be available to receive. More...
|
|
uint32_t | Length () const |
| Gets length of stored message in bytes. More...
|
|
uint64_t | GetUniqueIdentifier () const |
| Gets unique identifier of current message. More...
|
|
bool | IsTransacting (std::chrono::nanoseconds currentSimulationTime) const |
| Checks if message is transacting right now. More...
|
|
bool | IsInterfering (RawMessage &anotherMessage) const |
| Checks if two messages are interfering each other. More...
|
|
std::string | ConvertToBase64 () |
| Converts raw message to Base64. Structure of data is: More...
|
|
|
static void | printFrameCompressed (uint64_t uniqueID, MeshFrame &msg) |
|
|
uint8_t | payload [MESH_FRAME_SIZE_LIMIT] |
|
uint8_t | length = 0 |
|
std::chrono::nanoseconds | sentTime = std::chrono::nanoseconds::zero() |
|
std::chrono::nanoseconds | receiveTime = std::chrono::nanoseconds::zero() |
|
uint64_t | uniqueIdentifier = 0 |
|
|
static uint64_t | globalUniqueIdentifier = 1 |
|
This structure represents raw message, that was sent between two virtual radios. It has no header and data are not structured.
◆ ConvertToBase64()
std::string RawMessage::ConvertToBase64 |
( |
| ) |
|
Converts raw message to Base64. Structure of data is:
- 8 bytes - sentTime in ns.
- 8 bytes - receiveTime in ns.
- 8 bytes - uniqueIdentifier.
- 4 bytes - SenderNodeMACAddress.
- 1 byte - data length.
- x bytes - data of length data length.
- Returns
- Returns unique identifier of current message.
◆ Get()
void RawMessage::Get |
( |
uint8_t * |
message, |
|
|
uint8_t & |
messageLength |
|
) |
| const |
Gets bytes from message.
- Parameters
-
[out] | message | Buffer, where message will be copyied. |
[out] | messageLength | Number of bytes copyied. |
◆ GetUniqueIdentifier()
uint64_t RawMessage::GetUniqueIdentifier |
( |
| ) |
const |
|
inline |
Gets unique identifier of current message.
- Returns
- Returns unique identifier of current message.
◆ IsInterfering()
bool RawMessage::IsInterfering |
( |
RawMessage & |
anotherMessage | ) |
const |
Checks if two messages are interfering each other.
- Parameters
-
anotherMessage | Another message to check interference with current mssage. |
- Returns
- Returns true when messages are interfering.
◆ IsTransacting()
bool RawMessage::IsTransacting |
( |
std::chrono::nanoseconds |
currentSimulationTime | ) |
const |
|
inline |
Checks if message is transacting right now.
- Parameters
-
currentSimulationTime | Current simulation time, when to check transation state. |
- Returns
- Returns true when message is transacting.
◆ Length()
uint32_t RawMessage::Length |
( |
| ) |
const |
|
inline |
Gets length of stored message in bytes.
- Returns
- Returns length of stored message in bytes.
◆ ReceiveTime()
std::chrono::nanoseconds RawMessage::ReceiveTime |
( |
| ) |
const |
|
inline |
Gets time, when message will be available to receive.
- Returns
- Time, when message will be available to receive.
◆ SentTime()
std::chrono::nanoseconds RawMessage::SentTime |
( |
| ) |
const |
|
inline |
Gets time, when message was sent.
- Returns
- Time, when message was sent.
◆ Set()
void RawMessage::Set |
( |
uint8_t * |
message, |
|
|
uint8_t |
messageLength, |
|
|
std::chrono::nanoseconds |
_sentTime, |
|
|
std::chrono::nanoseconds |
_sendingDoneTime |
|
) |
| |
Sets message bytes.
- Parameters
-
[in] | message | Buffer with message to set. |
[in] | messageLength | Length of message in bytes. |
[in] | _sentTime | Time, when message was sent. |
[in] | _sendingDoneTime | Time, when message sending will be stopped. |
The documentation for this struct was generated from the following files: