comms status PID
This commit is contained in:
parent
e273f2ffa6
commit
32c5a37f57
|
@ -61,8 +61,19 @@ Responder::Responder()
|
|||
&Responder::actionDiscoveryUnmute,
|
||||
this, std::placeholders::_1,
|
||||
std::placeholders::_2));
|
||||
// Category – Network Management
|
||||
// PID COMMS_STATUS
|
||||
/// 10.2.1 Communication Status (COMMS_STATUS)
|
||||
/// The COMMS_STATUS parameter is used to collect information that may be
|
||||
/// useful in analyzing the integrity of the communication system.
|
||||
parameters_.try_emplace(COMMS_STATUS, new Parameter());
|
||||
parameters_.at(COMMS_STATUS)->getAction(std::bind(
|
||||
&Responder::actionGetCommsStatus,
|
||||
this, std::placeholders::_1,
|
||||
std::placeholders::_2));
|
||||
parameters_.at(COMMS_STATUS)->setAction(std::bind(
|
||||
&Responder::actionSetCommsStatus,
|
||||
this, std::placeholders::_1,
|
||||
std::placeholders::_2));
|
||||
|
||||
// Category - Status Collection
|
||||
// QUEUED_MESSAGE
|
||||
// STATUS_MESSAGES
|
||||
|
@ -396,4 +407,39 @@ void Responder::actionDiscoveryUnmute(const Message *message, Message *response)
|
|||
response->appendData(control_field);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Responder::actionGetCommsStatus
|
||||
* @param message
|
||||
* @param response
|
||||
*/
|
||||
void Responder::actionGetCommsStatus(const Message *message, Message *response)
|
||||
{
|
||||
if (!message->requiredLength(0, response))
|
||||
return;
|
||||
|
||||
response->responseType = RESPONSE_TYPE_ACK;
|
||||
response->appendData(short_message_counter_);
|
||||
response->appendData(length_mismatch_counter_);
|
||||
response->appendData(checksum_fail_counter_);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Responder::actionSetCommsStatus
|
||||
* @param message
|
||||
* @param response
|
||||
*/
|
||||
void Responder::actionSetCommsStatus(const Message *message, Message *response)
|
||||
{
|
||||
if (!message->requiredLength(0, response))
|
||||
return;
|
||||
|
||||
short_message_counter_ = 0;
|
||||
length_mismatch_counter_ = 0;
|
||||
checksum_fail_counter_ = 0;
|
||||
|
||||
response->responseType = RESPONSE_TYPE_ACK;
|
||||
}
|
||||
|
||||
} // namespace RDM
|
||||
|
|
|
@ -64,6 +64,8 @@ protected:
|
|||
void actionDiscoverUniqueBranch (const Message *message, Message *response);
|
||||
void actionDiscoveryMute (const Message *message, Message *response);
|
||||
void actionDiscoveryUnmute (const Message *message, Message *response);
|
||||
void actionGetCommsStatus (const Message *message, Message *response);
|
||||
void actionSetCommsStatus (const Message *message, Message *response);
|
||||
|
||||
std::queue<Message*> queued_messages_;
|
||||
|
||||
|
|
Loading…
Reference in New Issue