Class CPLMessage
Introduction This class implements a lookup table for Atheros vendor-specific management messages and their error codes. Messages types are stored in the MMTYPE field of all HomePlug AV management messages. This class can be used to convert any HomePlug AV message type, including Atheros vendor-specific message types, to the formal mnemonic (name) for that message type. This can be used for debugging and event logging purposes. Error codes are stored in the MSTATUS field of many Atheros vendor-specific confirmation messages. This class can be used to obtain the message text for any valid combination of Atheros vendor-specific message type and error code found in a confirmation message frame. This can be used to report powerline management error conditions in human-friendly format. In addition, this class can be used to print CVS or HTML tables of message mnemonics, message types, error codes and error text. This optional feature may be useful for application and system developers who must frequently diagnose software and hardware problems using hex dumps. This class is declared in CPLMessage.hpp and defined in CPLMessage.cpp.
Inheritance None.
Dependence None.
Properties None.
Methods
CPLMessage::CSV CPLMessage & CSV void Print a CSV formatted file on stdout. The output lists the mnemonic, MMTYPE, MSTATUS and message text of every Atheros vendor-specific management message error recognized by the firmware. The output is suitable for inclusion in a spreadsheet or for processing by another program. The object instance is returned as the method value.
CPLMessage::HTML CPLMessage & HTML void Print a HTML formatted file on stdout. The output c the name, MMTYPE, MSTATUS and message text of every Atheros vendor-specific management message error recognized by the firmware. The output is organized as a table and is suitable for inclusion in an ordinary webpage. The object instance is returned as the method value.
CPLMessage::MessageText char const * MessageErrorText uint16_t type uint8_t code Return the error message text for a given Atheros vendor-specific management message type and error code as a constant character string or "Failed" for an invalid combination of the two. Argument type is the MMTYPE field and code is the MSTATUS field described in the Atheros Firmware Technical Reference Manual. For this method, type must be a confirmation message type.
CPLMessage::MessageMode char const * MessageMode uint16_t type Return the variant of a given message type as a const character string. The four possible variants are "REQ", "CNF", "IND" and "RSP" to indicate a request, confirmation, indication or response. This method examines only the lower two bits of type and ingnores the remainder. See the HomePlug AV Specification for more information on message variants.
CPLMessage::MessageName char const * MessageName uint16_t type Return the formal HomePlug AV or Atheros vendor-specific mnemonic (name) for a given management message type as a constant character string or "UNKNOWN_MME" for an invalid message type. Argument type is the MMTYPE field as described in the HomePlug AV Specification or Atheros Firmware Technical Reference Manual. The lower order two bits of type are ignored during lookup so that request, confirmation, indication or response message variants all return the same string.
Operators None.
Constructors CPLMessage void CPLMessage void
Examples To be written. Display Message Name CPLMessage message; uint16_t mmtype = 0xA001; std::cout "Message type is " << message.MessageName (mmtype) << "." << message.MessageMode (mmtype) << std::endl; This example uses methods MessageName and MessageMode to lookup then print the full mnemonic for Atheros vendor-specific message type 0xA001 on stdout. The output looks like ... Message type is VS_SW_VER.CNF