Code: Select all
pub fn params108(hv_can: &HVCAN) {
let id: u16 = 0x108;
let size: u8 = 8;
let mut params108_frame = DataFrame::new(ID::BaseID(BaseID::new(id)));
params108_frame.set_data_length(size.into());
let params108 = params108_frame.data_as_mut();
params108[0] = 0x00; // Weld check not supported.
params108[1] = 60; // Max voltage frame.data.byte[1] + frame.data.byte[2] * 256;
params108[2] = 0x00;
params108[3] = 0x20; // Max Amps current available (not really...)
params108[4] = 50; // Threshold voltage frame.data.byte[4] + frame.data.byte[5] * 256;
params108[5] = 0x00;
params108[6] = 0x00;
params108[7] = 0x00;
hv_can.transmit(¶ms108_frame.into()).ok();
}
pub fn status109(hv_can: &HVCAN) {
let id: u16 = 0x109;
let size: u8 = 8;
let mut status109_frame = DataFrame::new(ID::BaseID(BaseID::new(id)));
status109_frame.set_data_length(size.into());
let status109 = status109_frame.data_as_mut();
/* STATUS
* define EVSE_STATUS_CHARGE 1 //charger is active
* #define EVSE_STATUS_ERR 2 //something went wrong
* #define EVSE_STATUS_CONNLOCK 4 //connector is currently locked
* #define EVSE_STATUS_INCOMPAT 8 //params btwn vehicle and charger not compatible
* #define EVSE_STATUS_BATTERR 16 //something wrong with battery?!
* #define EVSE_STATUS_STOPPED 32 //charger is stopped
*/
status109[0] = 0x02; // Protocol > 1 = 1.0
status109[1] = 0x00; // Present voltage byte1 + 256*byte2
status109[2] = 0x00;
status109[3] = 0x00; // Current
status109[4] = 0x00; // Reserved?
status109[5] = 0x05; // Status
status109[6] = 0xFF; // If < 0xFF then chgSecondsRemain = byte6 * 10;
status109[7] = 0x10; // else chgSecondsRemain = byte7 * 60;
hv_can.transmit(&status109_frame.into()).ok();
}
I currently have 12 V on pin 2 and 0 V on pin 1, and CAN...and that's it. I feel like I'm missing something, and that's why the adapter isn't sending the 0x100, 0x101, and 0x102 frames. I only get the power-on bootup frame from Tesla.
It's unclear what to do with pins 4 and 10.
Any insight would be greatly appreciated.
-Matt