1
0
mirror of https://github.com/Oleg-Stepanenko-owo/IEBUS synced 2025-06-29 10:46:10 +00:00

added new cam_off sequanse

This commit is contained in:
OlegStepanenko_noute 2016-04-11 20:46:37 +03:00
parent 7ba8949a34
commit 4f208fb733
6 changed files with 37 additions and 12 deletions

View File

@ -544,7 +544,12 @@ byte AVCLanDrv::getActionID(const AvcInCmdTable messageTable[], byte mtSize)
return ACT_NONE;
}
byte idx = ((dataSize == 8) ? 0 : (dataSize == 9 ? 6 : 9)); // position in AvcInMessageTable
// position in AvcInMessageTable
byte idx = 0;
if (dataSize == 6) idx = 0;
else if (dataSize == 8) idx = 1;
else if (dataSize == 9) idx = 7;
else idx = 10;
for (; idx < mtSize; ++idx) {
if (dataSize != pgm_read_byte_near(&messageTable[idx].dataSize)) return ACT_NONE; // Because first unsized value from other range

View File

@ -2,19 +2,30 @@
#include "limits.h"
#include "AVCLanDrv.h"
#include "AVCLanHonda.h"
#include "AVCLan_BT.h"
#include <avr/pgmspace.h>
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
//TODO: master -> 131
// < d 183 131 06170D31020158
// +++
// < d 183 131 08590D31020122712F
// Rear camm off
// 09780D3103024B000009 - next track ?
// 08590D3102012212D0
// 08590D3102012213D1
// 08590D3102012214D2
// 0618023102004D - mute button press
// < d 183 100 0B600D01000140165400000B - time 16:54
// < d 100 183 0D60073100010003011018FF5008 - FM1 101.8
// 0D60073100010000021014FF5002 - FM2 101.4
// { action_name, packed_size, end_off_packege_word(check_sum) }
const AvcInCmdTable mtSearchHead[] PROGMEM = {
{ ACT_PREP_CAMOFF, 0x06, 0x58}, //06170D31020158
{ ACT_BUTTON_DOWN, 0x08, 0xBC}, // 08590D3102012000BC
{ ACT_BUTTON_UP, 0x08, 0xBE}, // 08590D3102012101BE
{ ACT_B_DISPOFF, 0x08, 0x2F}, // 08590D31020122712F
@ -37,6 +48,7 @@ void AVCLanHonda::begin()
{
avclan.deviceAddress = 0x0131;
bPrepareCamOff = false;
bShowHondaDisp = true;
setHondaDisLast(true);
bShowRearCam = false;
@ -88,6 +100,10 @@ void AVCLanHonda::processAction( AvcActionID ActionID )
if ( INIT2_TIME < millis() ) bFirstStart_20 = false;
}
if ( bPrepareCamOff && (ACT_B_DISPOFF == ActionID) ) {
ActionID = ACT_CAM_OFF;
avclanBT.print("CAMOFF+DISPOFF");
} else bPrepareCamOff = false;
switch ( ActionID ) {
case ACT_BUTTON_UP:
@ -123,6 +139,9 @@ void AVCLanHonda::processAction( AvcActionID ActionID )
bShowHondaDisp = bHondaDisLast;
setWaitTime(0L);
break;
case ACT_PREP_CAMOFF:
bPrepareCamOff = true;
break;
}
};

View File

@ -44,7 +44,8 @@ typedef enum {
ACT_B_DISPFULL_UP,
ACT_B_DISPHULF,
ACT_TEL,
ACT_TEL_CANCEL
ACT_TEL_CANCEL,
ACT_PREP_CAMOFF
// ACT_VOL
} AvcActionID;
@ -84,10 +85,9 @@ class AVCLanHonda
private:
unsigned long waitTime;
bool bWait;
bool bPrepareCamOff;
bool bShowRearCam;
bool bShowHondaDisp;
bool bTimeSwitch;

View File

@ -161,6 +161,7 @@ void AVCLanBT::printAction( AvcActionID ActionID )
case ACT_B_DISPHULF: mySerial.println(">>A:B_DISP_HILF<<"); break;
case ACT_TEL: mySerial.println(">>A:TEL<<"); break;
case ACT_TEL_CANCEL: mySerial.println(">>A:TEL CANCEL<<"); break;
case ACT_PREP_CAMOFF: mySerial.println(">>A:PREP_CAMOFF<<"); break;
default: mySerial.println(">>A:UNDEFINED<<");
}
}

View File

@ -78,7 +78,7 @@ void loop()
avclan.printMessage(true);
avclanHonda.getActionID();
if ( avclanHonda.bFirstStart_20 && (avclan.actionID == ACT_CAM_ON) )
if ( (INIT2_TIME > millis()) && (avclan.actionID == ACT_CAM_ON) )
{
avclanBT.printAction( (AvcActionID)avclan.actionID );
avclanHonda.processAction( (AvcActionID)avclan.actionID );

View File

@ -1,4 +1,4 @@
#define IEBUS_VERSION "0.7"
#define IEBUS_VERSION "0.8"
// type of AVCLan hardwire driver
#define AVCLAN_PCA82C250