Skip to content

Update MyMessage.cpp #1352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions core/MyMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,27 +135,27 @@ bool MyMessage::isAck(void) const

bool MyMessage::isEcho(void) const
{
return (bool)BF_GET(this->command_echo_payload, V2_MYS_HEADER_CEP_ECHOREQUEST_POS,
V2_MYS_HEADER_CEP_ECHOEQUEST_SIZE);
return (bool)BF_GET(this->command_echo_payload, V2_MYS_HEADER_CEP_ECHO_POS,
V2_MYS_HEADER_CEP_ECHO_SIZE);
}

MyMessage& MyMessage::setEcho(const bool echo)
{
BF_SET(this->command_echo_payload, echo, V2_MYS_HEADER_CEP_ECHOREQUEST_POS,
V2_MYS_HEADER_CEP_ECHOEQUEST_SIZE);
BF_SET(this->command_echo_payload, echo, V2_MYS_HEADER_CEP_ECHO_POS,
V2_MYS_HEADER_CEP_ECHO_SIZE);
return *this;
}

bool MyMessage::getRequestEcho(void) const
{
return (bool)BF_GET(this->command_echo_payload, V2_MYS_HEADER_CEP_ECHO_POS,
V2_MYS_HEADER_CEP_ECHO_SIZE);
return (bool)BF_GET(this->command_echo_payload, V2_MYS_HEADER_CEP_ECHOREQUEST_POS,
V2_MYS_HEADER_CEP_ECHOREQUEST_SIZE);
}

MyMessage& MyMessage::setRequestEcho(const bool requestEcho)
{
BF_SET(this->command_echo_payload, requestEcho, V2_MYS_HEADER_CEP_ECHO_POS,
V2_MYS_HEADER_CEP_ECHO_SIZE);
BF_SET(this->command_echo_payload, requestEcho, V2_MYS_HEADER_CEP_ECHOREQUEST_POS,
V2_MYS_HEADER_CEP_ECHOREQUEST_SIZE);
return *this;
}

Expand Down
2 changes: 1 addition & 1 deletion core/MyMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#define V2_MYS_HEADER_CEP_COMMAND_POS (0) //!< bitfield position command field
#define V2_MYS_HEADER_CEP_COMMAND_SIZE (3u) //!< size command field
#define V2_MYS_HEADER_CEP_ECHOREQUEST_POS (3u) //!< bitfield position echo request field
#define V2_MYS_HEADER_CEP_ECHOEQUEST_SIZE (1u) //!< size echo request field
#define V2_MYS_HEADER_CEP_ECHOREQUEST_SIZE (1u) //!< size echo request field
#define V2_MYS_HEADER_CEP_ECHO_POS (4u) //!< bitfield position echo field
#define V2_MYS_HEADER_CEP_ECHO_SIZE (1u) //!< size echo field
#define V2_MYS_HEADER_CEP_PAYLOADTYPE_POS (5u) //!< bitfield position payload type field
Expand Down