Quick rewrite
This commit is contained in:
parent
266dcefdfd
commit
e6928a3aa6
27 changed files with 6041 additions and 773 deletions
|
|
@ -6,7 +6,7 @@
|
|||
#include "modbus.h"
|
||||
#include "sunspecParameters.h"
|
||||
|
||||
Sunspec::Sunspec(int address, std::shared_ptr<class modbus> modbus) {
|
||||
Sunspec::Sunspec(int address, modbus_t *modbus) {
|
||||
this->modbus = modbus;
|
||||
this->sunspecAddress = address;
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ void Sunspec::setValues() {
|
|||
uint16_t registers[70];
|
||||
|
||||
int registerCount;
|
||||
registerCount = this->modbus.get()->modbus_read_holding_registers(this->sunspecAddress, 70, registers);
|
||||
registerCount = modbus_read_registers(this->modbus, this->sunspecAddress, 70, registers);
|
||||
|
||||
std::vector<std::shared_ptr<SunspecParameter>>::iterator parametersIterator = this->parameters.begin();
|
||||
while(parametersIterator != this->parameters.end()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue