only:hellen-honda-k
This commit is contained in:
rusefillc 2023-04-03 14:10:07 -04:00
parent 2a7436c090
commit b606a141e8
1 changed files with 17 additions and 0 deletions

View File

@ -20,6 +20,8 @@ size_t readWhileGives(ByteSource source, uint8_t *buffer, int bufferSize) {
bool kAcRequestState;
static bool doSend = false;
static void handleHonda(uint8_t *bufferIn) {
uint8_t acByte = bufferIn[2];
kAcRequestState = acByte & 0x80;
@ -80,6 +82,13 @@ void kLineThread(void*) {
}
handleHonda(bufferIn);
}
if (doSend) {
const char out[] = {0x2, 0x0, 0x0, 0x50, 0x0, 0x0, 149};
efiPrintf("kline doSend");
chnWrite(klDriver, (const uint8_t *)out, 7);
}
}
}
if (kLineOutPending) {
@ -148,6 +157,14 @@ void initKLine() {
addConsoleAction("kline", [](){
efiPrintf("kline totalBytes %d", totalBytes);
});
addConsoleAction("klineyes", [](){
doSend = true;
efiPrintf("kline send %d", doSend);
});
addConsoleAction("klineyes", [](){
doSend = false;
efiPrintf("kline send %d", doSend);
});
addConsoleActionI("klinesend", [](int value){
kLineOutPending = true;
kLineOut = value;