Skip to content

Commit

Permalink
fix two warnings�1) C++ forbids converting a string constant to 'char*'
Browse files Browse the repository at this point in the history
2) suggest paranthesis around '&&' within '||'
  • Loading branch information
You69Man committed Mar 1, 2024
1 parent dd8f8c1 commit 49508ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/hm/Communication.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Communication : public CommQueue<> {

//q->iv->radioStatistics.txCnt++;
q->iv->radio->mRadioWaitTime.startTimeMonitor(mTimeout);
if(!mIsRetransmit && (q->cmd == AlarmData) || (q->cmd == GridOnProFilePara))
if((!mIsRetransmit && (q->cmd == AlarmData)) || (q->cmd == GridOnProFilePara))
incrAttempt((q->cmd == AlarmData)? MORE_ATTEMPS_ALARMDATA : MORE_ATTEMPS_GRIDONPROFILEPARA);

mIsRetransmit = false;
Expand Down
2 changes: 1 addition & 1 deletion src/publisher/pubMqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ class PubMqtt {
}

DynamicJsonDocument doc2(512);
constexpr static char* unitTotal[] = {"W", "kWh", "Wh", "W"};
constexpr static const char* unitTotal[] = {"W", "kWh", "Wh", "W"};
doc2[F("name")] = String(name.data());
doc2[F("stat_t")] = String(mCfgMqtt->topic) + "/" + ((!total) ? String(iv->config->name) : "total" ) + String(topic.data());
doc2[F("unit_of_meas")] = ((!total) ? (iv->getUnit(mDiscovery.sub, rec)) : (unitTotal[mDiscovery.sub]));
Expand Down

0 comments on commit 49508ba

Please sign in to comment.