Skip to content

Commit

Permalink
Code maintenance (#1309)
Browse files Browse the repository at this point in the history
* Fix issues after CPPcheck 1.88 update

* Code maintenance
  • Loading branch information
tekka007 authored Jul 20, 2019
1 parent 529485c commit 40f4deb
Show file tree
Hide file tree
Showing 37 changed files with 1,239 additions and 727 deletions.
13 changes: 3 additions & 10 deletions .mystools/cppcheck/config/suppressions.cfg
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
// inline suppression doesn't work
*:hal/architecture/NRF5/drivers/Flash.cpp
*:drivers/NVM/NVRAM.cpp
*:hal\transport\RFM69\driver\old\RFM69_old.cpp
*:hal/transport/RFM69/driver/old/RFM69_old.cpp
// 3rd party
*:hal/architecture/Linux/drivers/BCM/bcm2835.c
*:hal/architecture/Linux/drivers/core/Client.h
*:hal/architecture/Linux/drivers/core/EthernetClient.cpp
*:hal/architecture/Linux/drivers/core/EthernetClient.h
*:hal/architecture/Linux/drivers/core/EthernetServer.cpp
*:hal/architecture/Linux/drivers/core/EthernetServer.h
*:hal/architecture/Linux/drivers/core/SerialPort.h
*:hal/architecture/Linux/drivers/core/StdInOutStream.h
*:hal/architecture/Linux/*
*:drivers/*
592 changes: 406 additions & 186 deletions Doxyfile

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions MyConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
/**
* @file MyConfig.h
* @ingroup MyConfigGrp
*
* @brief MySensors specific configuration flags.
*
* @{
* Set these in your sketch before including MySensors.h to customize the library to your needs.
* If the sketch does not define these flags, they will get default values where applicable.
*/
Expand Down Expand Up @@ -1658,7 +1657,7 @@
#ifndef MY_DEFAULT_LED_BLINK_PERIOD
#define MY_DEFAULT_LED_BLINK_PERIOD 300
#endif
/** @}*/ // End of lEDSettingGrpPub group
/** @}*/ // End of LEDSettingGrpPub group

/**
* @defgroup SecuritySettingGrpPub Security
Expand Down
19 changes: 9 additions & 10 deletions core/MyGatewayTransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,25 @@ inline void gatewayTransportProcess(void)
{
if (gatewayTransportAvailable()) {
_msg = gatewayTransportReceive();
if (_msg.destination == GATEWAY_ADDRESS) {
if (_msg.getDestination() == GATEWAY_ADDRESS) {

// Check if sender requests an echo
if (mGetRequestEcho(_msg)) {
if (_msg.getRequestEcho()) {
// Copy message
_msgTmp = _msg;
// Reply without echo flag, otherwise we would end up in an eternal loop
mSetRequestEcho(_msgTmp,
false);
mSetEcho(_msgTmp, true);
_msgTmp.sender = getNodeId();
_msgTmp.destination = _msg.sender;
_msgTmp.setRequestEcho(false);
_msgTmp.setEcho(true);
_msgTmp.setSender(getNodeId());
_msgTmp.setDestination(_msg.getSender());
gatewayTransportSend(_msgTmp);
}
if (mGetCommand(_msg) == C_INTERNAL) {
if (_msg.type == I_VERSION) {
if (_msg.getCommand() == C_INTERNAL) {
if (_msg.getType() == I_VERSION) {
// Request for version. Create the response
gatewayTransportSend(buildGw(_msgTmp, I_VERSION).set(MYSENSORS_LIBRARY_VERSION));
#ifdef MY_INCLUSION_MODE_FEATURE
} else if (_msg.type == I_INCLUSION_MODE) {
} else if (_msg.getType() == I_INCLUSION_MODE) {
// Request to change inclusion mode
inclusionModeSet(atoi(_msg.data) == 1);
#endif
Expand Down
4 changes: 2 additions & 2 deletions core/MyGatewayTransportMQTTClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ bool gatewayTransportSend(MyMessage &message)
char *topic = protocolMyMessage2MQTT(MY_MQTT_PUBLISH_TOPIC_PREFIX, message);
GATEWAY_DEBUG(PSTR("GWT:TPS:TOPIC=%s,MSG SENT\n"), topic);
#if defined(MY_MQTT_CLIENT_PUBLISH_RETAIN)
const bool retain = mGetCommand(message) == C_SET ||
(mGetCommand(message) == C_INTERNAL && message.type == I_BATTERY_LEVEL);
const bool retain = message.getCommand() == C_SET ||
(message.getCommand() == C_INTERNAL && message.getType() == I_BATTERY_LEVEL);
#else
const bool retain = false;
#endif /* End of MY_MQTT_CLIENT_PUBLISH_RETAIN */
Expand Down
Loading

0 comments on commit 40f4deb

Please sign in to comment.