Skip to content

Commit 79d7977

Browse files
tekka007mfalkvidd
authored andcommitted
MyTransport update (#1329)
Fix: do not set nodeID to AUTO if invalid I_ID_RESPONSE received Save 2 bytes of RAM: remove transportSM variable (uplinkQualityRSSI) if unused Bump pre-release version to 7
1 parent 7055fdb commit 79d7977

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

core/MyTransport.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ bool transportAssignNodeID(const uint8_t newNodeId)
505505
} else {
506506
TRANSPORT_DEBUG(PSTR("!TSF:SID:FAIL,ID=%" PRIu8 "\n"),newNodeId); // ID is invalid, cannot assign ID
507507
setIndication(INDICATION_ERR_NET_FULL);
508-
_transportConfig.nodeId = AUTO;
509508
return false;
510509
}
511510
}
@@ -1092,6 +1091,7 @@ void transportTogglePassiveMode(const bool OnOff)
10921091

10931092
int16_t transportGetSignalReport(const signalReport_t signalReport)
10941093
{
1094+
#if defined(MY_SIGNAL_REPORT_ENABLED)
10951095
int16_t result;
10961096
switch (signalReport) {
10971097
case SR_RX_RSSI:
@@ -1120,10 +1120,15 @@ int16_t transportGetSignalReport(const signalReport_t signalReport)
11201120
break;
11211121
}
11221122
return result;
1123+
#else
1124+
(void)signalReport;
1125+
return 0;
1126+
#endif
11231127
}
11241128

11251129
int16_t transportSignalReport(const char command)
11261130
{
1131+
#if defined(MY_SIGNAL_REPORT_ENABLED)
11271132
signalReport_t reportCommand;
11281133
switch (command) {
11291134
case 'S':
@@ -1161,4 +1166,8 @@ int16_t transportSignalReport(const char command)
11611166
const uint16_t result = transportGetSignalReport(reportCommand);
11621167
TRANSPORT_DEBUG(PSTR("TSF:SIR:CMD=%" PRIu8 ",VAL=%" PRIu16 "\n"), reportCommand, result);
11631168
return result;
1169+
#else
1170+
(void)command;
1171+
return 0;
1172+
#endif
11641173
}

core/MyTransport.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,9 @@ typedef struct {
307307
uint8_t failureCounter : 3; //!< counter for TSM failures (max 7)
308308
bool msgReceived : 1; //!< flag message received
309309
uint8_t pingResponse; //!< stores I_PONG hops
310+
#if defined(MY_SIGNAL_REPORT_ENABLED)
310311
transportRSSI_t uplinkQualityRSSI; //!< Uplink quality, internal RSSI representation
312+
#endif
311313
} transportSM_t;
312314

313315
/**
@@ -545,6 +547,7 @@ void transportDisable(void);
545547
* @brief Reinitialise transport. Put transport to standby - If xxx_POWER_PIN set, power up and go to standby
546548
*/
547549
void transportReInitialise(void);
550+
548551
/**
549552
* @brief Get transport signal report
550553
* @param command:
@@ -557,14 +560,14 @@ void transportReInitialise(void);
557560
* U = Uplink quality (via ACK from parent node), avg. RSSI
558561
* @return Signal report (if report is not available, INVALID_RSSI, INVALID_SNR, INVALID_PERCENT, or INVALID_LEVEL is sent instead)
559562
*/
560-
int16_t transportSignalReport(const char command);
563+
int16_t transportSignalReport(const char command) __attribute__((unused));
561564

562565
/**
563566
* @brief Get transport signal report
564567
* @param signalReport
565568
* @return report
566569
*/
567-
int16_t transportGetSignalReport(const signalReport_t signalReport);
570+
int16_t transportGetSignalReport(const signalReport_t signalReport) __attribute__((unused));
568571

569572
#endif // MyTransport_h
570573
/** @}*/

core/Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#define MYSENSORS_LIBRARY_VERSION_MINOR 3 //!< Minor release version
5151
#define MYSENSORS_LIBRARY_VERSION_PATCH 2 //!< Patch version
5252
#define MYSENSORS_LIBRARY_VERSION_PRERELEASE "beta" //!< Pre-release suffix, i.e. alpha, beta, rc.1, etc
53-
#define MYSENSORS_LIBRARY_VERSION_PRERELEASE_NUMBER 0x06 //!< incremental counter, starting at 0x00. 0xFF for final release
53+
#define MYSENSORS_LIBRARY_VERSION_PRERELEASE_NUMBER 0x07 //!< incremental counter, starting at 0x00. 0xFF for final release
5454

5555

5656
#if (MYSENSORS_LIBRARY_VERSION_PRERELEASE_NUMBER != 0xFF)

0 commit comments

Comments
 (0)