|
|
@ -172,16 +172,17 @@ class HmRadio { |
|
|
|
// 4 bytes control data
|
|
|
|
// Power Limit fix point 10 eg. 30 W --> 0d300 = 0x012c
|
|
|
|
// -1 = 0xffff --> no limit
|
|
|
|
if (data[0] == 0xffff){ |
|
|
|
data[0] &= 0xffff; // ToDo: unlimit value is needed and is inverter specific! --> get it via RF from inverter or via user interface
|
|
|
|
uint16_t powerLimit = data[0]; |
|
|
|
uint16_t powerLimitSetting = data[1]; |
|
|
|
if (powerLimit == 0xffff){ |
|
|
|
powerLimit &= 0xffff; // ToDo: unlimit value is needed and is inverter specific! --> get it via RF from inverter or via user interface
|
|
|
|
} else { |
|
|
|
data[0] *= 10; // will overwrite the data bc it is a pointer
|
|
|
|
powerLimit *= 10; // will overwrite the data bc it is a pointer
|
|
|
|
} |
|
|
|
mTxBuf[10 + (++cnt)] = (data[0] >> 8) & 0xff; // power limit
|
|
|
|
mTxBuf[10 + (++cnt)] = (data[0] ) & 0xff; // power limit
|
|
|
|
mTxBuf[10 + (++cnt)] = (data[1] >> 8) & 0xff; // setting for persistens handling
|
|
|
|
mTxBuf[10 + (++cnt)] = (data[1] ) & 0xff; // setting for persistens handling
|
|
|
|
data[0] /= 10; // UGLY!
|
|
|
|
mTxBuf[10 + (++cnt)] = (powerLimit >> 8) & 0xff; // power limit
|
|
|
|
mTxBuf[10 + (++cnt)] = (powerLimit ) & 0xff; // power limit
|
|
|
|
mTxBuf[10 + (++cnt)] = (powerLimitSetting >> 8) & 0xff; // setting for persistens handling
|
|
|
|
mTxBuf[10 + (++cnt)] = (powerLimitSetting ) & 0xff; // setting for persistens handling
|
|
|
|
} |
|
|
|
// crc control data
|
|
|
|
uint16_t crc = crc16(&mTxBuf[10], cnt+1); |
|
|
|