meterBus and nearly everything disabled, still not working
This commit is contained in:
97
meterBusClient.cpp-disabled
Normal file
97
meterBusClient.cpp-disabled
Normal file
@ -0,0 +1,97 @@
|
||||
/*
|
||||
* meterBusClient.cpp
|
||||
*
|
||||
* Created on: 08.03.2014
|
||||
* Author: wn
|
||||
*/
|
||||
|
||||
#include "meterBusClient.h"
|
||||
|
||||
|
||||
MeterBusClient::MeterBusClient() : m_address(0) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MeterBusClient::begin(CmdServer *cmdServer) {
|
||||
Serial3.begin(1200);
|
||||
|
||||
|
||||
setAddress(Config::getUChar(Config::METERBUSCLIENT_ADDRESS));
|
||||
}
|
||||
|
||||
void MeterBusClient::setAddress(unsigned char a) {
|
||||
Config::setUChar(Config::METERBUSCLIENT_ADDRESS, a);
|
||||
m_address = a;
|
||||
}
|
||||
|
||||
unsigned char MeterBusClient::getAddress() {
|
||||
return m_address;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Single Character: E5h
|
||||
*
|
||||
* Short Frame:
|
||||
* Start 10h
|
||||
* C-Field
|
||||
* A-Field
|
||||
* Check-Sum
|
||||
* Stop 16h
|
||||
*
|
||||
* Control Frame:
|
||||
* Start 68h
|
||||
* Length
|
||||
* Length
|
||||
* Start 68h
|
||||
* C-Field
|
||||
* A-Field
|
||||
* CI-Field
|
||||
* Check-Sum
|
||||
* Stop 16h
|
||||
*
|
||||
* Long Frame:
|
||||
* Start 68h
|
||||
* Length
|
||||
* Length
|
||||
* Start 68h
|
||||
* C-Field
|
||||
* A-Field
|
||||
* CI-Field
|
||||
* User-Data
|
||||
* Check-Sum
|
||||
* Stop 16h
|
||||
*
|
||||
* Frames:
|
||||
* SND_NKE
|
||||
* Short Frame, C: 40h
|
||||
*
|
||||
* REQ_UD2
|
||||
* Short Frame, C: 5Bh
|
||||
*/
|
||||
|
||||
|
||||
void MeterBusClient::exec() {
|
||||
static uint8_t state = 0;
|
||||
bool done = false;
|
||||
|
||||
if (Serial3.available()) {
|
||||
int chi;
|
||||
while ((chi = Serial3.read()) != -1) {
|
||||
char ch = (char) chi;
|
||||
switch (state) {
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
|
||||
if (done) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user