|
@ -19,6 +19,7 @@ typedef std::function<void(uint8_t, Inverter<> *)> payloadListenerType; |
|
|
typedef std::function<void(Inverter<> *)> powerLimitAckListenerType; |
|
|
typedef std::function<void(Inverter<> *)> powerLimitAckListenerType; |
|
|
typedef std::function<void(Inverter<> *)> powerPowerAckListenerType; |
|
|
typedef std::function<void(Inverter<> *)> powerPowerAckListenerType; |
|
|
typedef std::function<void(Inverter<> *)> powerRebootAckListenerType; |
|
|
typedef std::function<void(Inverter<> *)> powerRebootAckListenerType; |
|
|
|
|
|
typedef std::function<void(Inverter<> *)> newDataListenerType; |
|
|
typedef std::function<void(Inverter<> *)> alarmListenerType; |
|
|
typedef std::function<void(Inverter<> *)> alarmListenerType; |
|
|
|
|
|
|
|
|
class Communication : public CommQueue<> { |
|
|
class Communication : public CommQueue<> { |
|
@ -51,6 +52,10 @@ class Communication : public CommQueue<> { |
|
|
mCbPwrRebootAck = cb; |
|
|
mCbPwrRebootAck = cb; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void addNewDataListener(newDataListenerType cb) { |
|
|
|
|
|
mCbNewData = cb; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void addAlarmListener(alarmListenerType cb) { |
|
|
void addAlarmListener(alarmListenerType cb) { |
|
|
mCbAlarm = cb; |
|
|
mCbAlarm = cb; |
|
|
} |
|
|
} |
|
@ -601,6 +606,7 @@ class Communication : public CommQueue<> { |
|
|
for (uint8_t i = 0; i < rec->length; i++) { |
|
|
for (uint8_t i = 0; i < rec->length; i++) { |
|
|
q->iv->addValue(i, mPayload.data(), rec); |
|
|
q->iv->addValue(i, mPayload.data(), rec); |
|
|
} |
|
|
} |
|
|
|
|
|
(mCbNewData)(q->iv); |
|
|
rec->mqttSentStatus = MqttSentStatus::NEW_DATA; |
|
|
rec->mqttSentStatus = MqttSentStatus::NEW_DATA; |
|
|
|
|
|
|
|
|
q->iv->rssi = rssi; |
|
|
q->iv->rssi = rssi; |
|
@ -1057,6 +1063,7 @@ class Communication : public CommQueue<> { |
|
|
powerLimitAckListenerType mCbPwrAck = NULL; |
|
|
powerLimitAckListenerType mCbPwrAck = NULL; |
|
|
powerPowerAckListenerType mCbPwrPowerAck = NULL; |
|
|
powerPowerAckListenerType mCbPwrPowerAck = NULL; |
|
|
powerRebootAckListenerType mCbPwrRebootAck = NULL; |
|
|
powerRebootAckListenerType mCbPwrRebootAck = NULL; |
|
|
|
|
|
newDataListenerType mCbNewData = NULL; |
|
|
alarmListenerType mCbAlarm = NULL; |
|
|
alarmListenerType mCbAlarm = NULL; |
|
|
Heuristic mHeu; |
|
|
Heuristic mHeu; |
|
|
uint32_t mLastEmptyQueueMillis = 0; |
|
|
uint32_t mLastEmptyQueueMillis = 0; |
|
|