Garmin Fleet Management Controller
2.19.0
|
Encapsulation of a message ID. More...
#include <MessageId.h>
Public Member Functions | |
MessageId () | |
Default constructor. More... | |
MessageId (const MessageId &aRightSide) | |
Copy constructor. More... | |
MessageId (const uint8 aIdSize, const uint8 *aId) | |
Construct message ID from raw binary ID and length. More... | |
MessageId (const CString &aCString, codepage_type aCodePage) | |
Construct message ID from displayable string. More... | |
const uint8 * | getId () const |
Return a reference to the bytes of the message ID. More... | |
uint8 | getIdSize () const |
Return the size of the message ID. More... | |
bool | operator< (const MessageId &aRightSide) const |
Less-than operator. More... | |
const MessageId & | operator= (const MessageId &aRightSide) |
Assignment operator. More... | |
bool | operator== (const MessageId &aRightSide) const |
Equality operator. More... | |
CString | toCString (codepage_type aCodePage) const |
CString representation of the message ID. More... | |
Private Attributes | |
uint8 | mId [16] |
The message ID. More... | |
uint8 | mIdSize |
Number of significant bytes of mId. More... | |
Encapsulation of a message ID.
Encapsulates a message ID (0-16 bytes of binary data), and provides methods to compare and copy message IDs, and convert the ID to and from a string representation.
Definition at line 26 of file MessageId.h.
MessageId::MessageId | ( | ) |
Default constructor.
Construct a message ID with size zero.
Definition at line 18 of file MessageId.cpp.
Referenced by MessageId().
MessageId::MessageId | ( | const MessageId & | aRightSide | ) |
Copy constructor.
aRightSide | The MessageId to construct a copy of. |
Definition at line 27 of file MessageId.cpp.
References MessageId(), mId, and mIdSize.
Construct message ID from raw binary ID and length.
aIdSize | The length of the message ID in bytes. If this is greater than 16, a length of 16 will be used. |
aId | The binary message ID. |
Definition at line 43 of file MessageId.cpp.
References MessageId(), mId, mIdSize, and minval.
MessageId::MessageId | ( | const CString & | aCString, |
codepage_type | aCodePage | ||
) |
Construct message ID from displayable string.
aCString | The displayable representation of the string. If this begins with "0x" then the rest of the string will be interpreted as hexadecimal, otherwise the string will be converted to the specified codepage. |
aCodePage | The code page to use (ASCII or Unicode) |
Definition at line 61 of file MessageId.cpp.
References mId, mIdSize, minval, and UTIL_hex_to_uint8().
const uint8 * MessageId::getId | ( | ) | const |
Return a reference to the bytes of the message ID.
Definition at line 144 of file MessageId.cpp.
References mId.
Referenced by FmiApplicationLayer::beginA611LongTextMessage(), FmiApplicationLayer::sendA602TextMessage(), FmiApplicationLayer::sendA604TextMessage(), FmiApplicationLayer::sendCannedResponseTextMessage(), FmiApplicationLayer::sendMessageDeleteRequest(), FmiApplicationLayer::sendTextMessageStatusRequest(), and InboxListItem::writeToStream().
uint8 MessageId::getIdSize | ( | ) | const |
Return the size of the message ID.
Definition at line 152 of file MessageId.cpp.
References mIdSize, and toCString().
Referenced by FmiApplicationLayer::beginA611LongTextMessage(), CTxtMsgNewDlg::OnBnClickedOk(), FmiApplicationLayer::sendA602TextMessage(), FmiApplicationLayer::sendA604TextMessage(), FmiApplicationLayer::sendCannedResponseTextMessage(), FmiApplicationLayer::sendMessageDeleteRequest(), FmiApplicationLayer::sendTextMessageStatusRequest(), and InboxListItem::writeToStream().
bool MessageId::operator< | ( | const MessageId & | aRightSide | ) | const |
Less-than operator.
Less-than operator for sorting purposes. A message ID is considered less than another if the mIdSize is smaller or if the mId array itself is smaller in a strict binary comparison.
aRightSide | The right hand side of the expression. |
Definition at line 90 of file MessageId.cpp.
Assignment operator.
aRightSide | The right hand side of the assignment expression. |
Definition at line 105 of file MessageId.cpp.
bool MessageId::operator== | ( | const MessageId & | aRightSide | ) | const |
Equality operator.
Equality operator for comparison purposes. A message ID is considered equal to another if both the mIdSize and the significant bytes of the mId array itself are binary equal.
aRightSide | The right hand side of the expression. |
Definition at line 126 of file MessageId.cpp.
CString MessageId::toCString | ( | codepage_type | aCodePage | ) | const |
CString representation of the message ID.
Returns a CString representation of the message ID. If the string consists exclusively of printable characters, the resulting string will interpret the message ID as text. Otherwise, the resulting string will be "0x" followed by the message ID in hexadecimal.
aCodePage | The code page to convert from. |
Definition at line 167 of file MessageId.cpp.
References mId, mIdSize, UTIL_data_is_printable(), and UTIL_uint8_to_hex().
Referenced by getIdSize(), CFmiPcAppDlg::OnEventLongTextMsgError(), CFmiPcAppDlg::OnEventOpenTextMsgError(), CTxtMsgFromClient::OnInitDialog(), CTxtMsgAckDlg::OnInitDialog(), and CTxtMsgStatusDlg::OnInitDialog().
|
private |
The message ID.
Definition at line 70 of file MessageId.h.
Referenced by getId(), MessageId(), operator<(), operator=(), operator==(), and toCString().
|
private |
Number of significant bytes of mId.
Definition at line 71 of file MessageId.h.
Referenced by getIdSize(), MessageId(), operator<(), operator=(), operator==(), and toCString().