finally works

This commit is contained in:
2023-04-06 22:35:23 +02:00
parent e4530544c2
commit 2968856d71
12 changed files with 184 additions and 154 deletions

View File

@ -37,7 +37,7 @@ void I2cTestClass::battInit() {
if (ioctl(bpxInfo.fd, I2C_SLAVE, bpxInfo.addr) < 0) {
sif::error << "Failed to acquire bus access and/or talk to slave" << std::endl;
}
cmdBuf[0] = BpxBattery::PORT_PING;
cmdBuf[0] = bpxBat::PORT_PING;
cmdBuf[1] = 0x42;
sendLen = 2;
ReturnValue_t result = i2cWrite(bpxInfo.fd, cmdBuf.data(), sendLen);
@ -66,7 +66,7 @@ void I2cTestClass::battPeriodic() {
if (ioctl(bpxInfo.fd, I2C_SLAVE, bpxInfo.addr) < 0) {
sif::error << "Failed to acquire bus access and/or talk to slave" << std::endl;
}
cmdBuf[0] = BpxBattery::PORT_GET_HK;
cmdBuf[0] = bpxBat::PORT_GET_HK;
sendLen = 1;
ReturnValue_t result = i2cWrite(bpxInfo.fd, cmdBuf.data(), sendLen);
if (result != returnvalue::OK) {