Add console writer for commands

This commit is contained in:
Carsten Schmiemann 2022-11-23 01:06:17 +01:00
parent 69b4d25e62
commit 5c2f3497db

View file

@ -174,7 +174,7 @@ void OvmsVehicleRenaultZoePh2CAN::IncomingFrameCan2(CAN_frame_t* p_frame) {
* Handles incoming CAN-frames on bus 3, connected to V1-CAN
*/
void OvmsVehicleRenaultZoePh2CAN::IncomingFrameCan3(CAN_frame_t* p_frame) {
uint8_t *data = p_frame->data.u8;
//uint8_t *data = p_frame->data.u8;
//ESP_LOGI(TAG, "V1-CAN: PID:%x DATA: %02x %02x %02x %02x %02x %02x %02x %02x", p_frame->MsgID, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
//tooooooo many packets, OVMS will crash with logging
@ -398,6 +398,18 @@ void OvmsVehicleRenaultZoePh2CAN::Ticker1(uint32_t ticker) {
}
OvmsVehicleRenaultZoePh2CAN* OvmsVehicleRenaultZoePh2CAN::GetInstance(OvmsWriter* writer /*=NULL*/)
{
OvmsVehicleRenaultZoePh2CAN* zoe_ph2_can = (OvmsVehicleRenaultZoePh2CAN*) MyVehicleFactory.ActiveVehicle();
string type = StdMetrics.ms_v_type->AsString();
if (!zoe_ph2_can || type != "RZ2C") {
if (writer)
writer->puts("Error: Renault Zoe Ph2 (CAN) vehicle module not selected");
return NULL;
}
return zoe_ph2_can;
}
class OvmsVehicleRenaultZoePh2CANInit {
public: OvmsVehicleRenaultZoePh2CANInit();
} MyOvmsVehicleRenaultZoePh2CANInit __attribute__ ((init_priority (9000)));