changes
This commit is contained in:
@ -7,13 +7,34 @@
|
||||
|
||||
#include "meterBusClient.h"
|
||||
|
||||
inline void MeterBusClient::aSB(unsigned char c) {
|
||||
sendBuffer[sendBufferLen++] = c;
|
||||
}
|
||||
|
||||
unsigned char MeterBusClient::calcSendChecksum() {
|
||||
unsigned char checksum = 0;
|
||||
for (unsigned int i = 4; i < sendBufferLen; i++) {
|
||||
checksum += sendBuffer[i];
|
||||
}
|
||||
return checksum;
|
||||
}
|
||||
|
||||
void MeterBusClient::SND_NKE() {
|
||||
Serial3.write(0xE5);
|
||||
sendBufferLen = 0;
|
||||
aSB(0xE5);
|
||||
}
|
||||
|
||||
void MeterBusClient::REQ_UD2() {
|
||||
|
||||
sendBufferLen = 0;
|
||||
aSB(0x68);
|
||||
aSB(0x03);
|
||||
aSB(0x03);
|
||||
aSB(0x68);
|
||||
aSB(0x01);
|
||||
aSB(getAddress());
|
||||
aSB(0x03);
|
||||
aSB(calcSendChecksum());
|
||||
aSB(0x16);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user