|
@ -7,15 +7,14 @@ void ProtocolEventBusSender::initialize(IZCanReceiver* zcanreceiver) { |
|
|
lock_.init(); |
|
|
lock_.init(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ProtocolEventBusSender::push_reg_state_change_event(int32_t moduleid, int32_t regindex, int32_t oldval, int32_t toval) { |
|
|
void ProtocolEventBusSender::push_reg_state_change_event(int32_t moduleid, int32_t regindex, int32_t oldval, int32_t toval) { |
|
|
zlock_guard l(lock_); |
|
|
zlock_guard l(lock_); |
|
|
|
|
|
|
|
|
zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf; |
|
|
zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf; |
|
|
int32_t* data = (int32_t*)cmd_header->data; |
|
|
int32_t* data = (int32_t*)cmd_header->data; |
|
|
cmd_header->subModuleid = moduleid; |
|
|
|
|
|
cmd_header->cmdMainId = zcr::kevent_bus_reg_change_report >> 8; |
|
|
|
|
|
cmd_header->subModuleid = zcr::kevent_bus_reg_change_report & 0xff; |
|
|
|
|
|
|
|
|
cmd_header->moduleid = moduleid; |
|
|
|
|
|
cmd_header->cmdMainId = zcr::kevent_bus_reg_change_report >> 8; |
|
|
|
|
|
cmd_header->cmdSubId = zcr::kevent_bus_reg_change_report & 0xff; |
|
|
|
|
|
|
|
|
data[0] = regindex; |
|
|
data[0] = regindex; |
|
|
data[1] = oldval; |
|
|
data[1] = oldval; |
|
@ -23,16 +22,28 @@ void ProtocolEventBusSender::push_reg_state_change_event(int32_t moduleid, int32 |
|
|
m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 4 * 3); |
|
|
m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 4 * 3); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ProtocolEventBusSender::report(int32_t moduleid, int32_t cmdindex) { |
|
|
|
|
|
zlock_guard l(lock_); |
|
|
|
|
|
|
|
|
|
|
|
zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf; |
|
|
|
|
|
int32_t* data = (int32_t*)cmd_header->data; |
|
|
|
|
|
cmd_header->moduleid = moduleid; |
|
|
|
|
|
cmd_header->cmdMainId = cmdindex >> 8; |
|
|
|
|
|
cmd_header->cmdSubId = cmdindex & 0xff; |
|
|
|
|
|
|
|
|
|
|
|
m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 0); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void ProtocolEventBusSender::report(int32_t moduleid, int32_t cmdindex, int32_t data0) { |
|
|
void ProtocolEventBusSender::report(int32_t moduleid, int32_t cmdindex, int32_t data0) { |
|
|
zlock_guard l(lock_); |
|
|
zlock_guard l(lock_); |
|
|
|
|
|
|
|
|
zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf; |
|
|
zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf; |
|
|
int32_t* data = (int32_t*)cmd_header->data; |
|
|
int32_t* data = (int32_t*)cmd_header->data; |
|
|
cmd_header->subModuleid = moduleid; |
|
|
|
|
|
cmd_header->cmdMainId = cmdindex >> 8; |
|
|
|
|
|
cmd_header->subModuleid = cmdindex & 0xff; |
|
|
|
|
|
|
|
|
cmd_header->moduleid = moduleid; |
|
|
|
|
|
cmd_header->cmdMainId = cmdindex >> 8; |
|
|
|
|
|
cmd_header->cmdSubId = cmdindex & 0xff; |
|
|
|
|
|
|
|
|
data[0] = data0; |
|
|
|
|
|
|
|
|
data[0] = data0; |
|
|
m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 4 * 1); |
|
|
m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 4 * 1); |
|
|
} |
|
|
} |
|
|
void ProtocolEventBusSender::report(int32_t moduleid, int32_t cmdindex, int32_t data0, int32_t data1) { |
|
|
void ProtocolEventBusSender::report(int32_t moduleid, int32_t cmdindex, int32_t data0, int32_t data1) { |
|
@ -40,12 +51,12 @@ void ProtocolEventBusSender::report(int32_t moduleid, int32_t cmdindex, int32_t |
|
|
|
|
|
|
|
|
zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf; |
|
|
zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf; |
|
|
int32_t* data = (int32_t*)cmd_header->data; |
|
|
int32_t* data = (int32_t*)cmd_header->data; |
|
|
cmd_header->subModuleid = moduleid; |
|
|
|
|
|
cmd_header->cmdMainId = cmdindex >> 8; |
|
|
|
|
|
cmd_header->subModuleid = cmdindex & 0xff; |
|
|
|
|
|
|
|
|
cmd_header->moduleid = moduleid; |
|
|
|
|
|
cmd_header->cmdMainId = cmdindex >> 8; |
|
|
|
|
|
cmd_header->cmdSubId = cmdindex & 0xff; |
|
|
|
|
|
|
|
|
data[0] = data0; |
|
|
|
|
|
data[1] = data1; |
|
|
|
|
|
|
|
|
data[0] = data0; |
|
|
|
|
|
data[1] = data1; |
|
|
m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 4 * 1); |
|
|
m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 4 * 1); |
|
|
} |
|
|
} |
|
|
void ProtocolEventBusSender::report(int32_t moduleid, int32_t cmdindex, int32_t data0, int32_t data1, int32_t data2) { |
|
|
void ProtocolEventBusSender::report(int32_t moduleid, int32_t cmdindex, int32_t data0, int32_t data1, int32_t data2) { |
|
@ -53,13 +64,13 @@ void ProtocolEventBusSender::report(int32_t moduleid, int32_t cmdindex, int32_t |
|
|
|
|
|
|
|
|
zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf; |
|
|
zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf; |
|
|
int32_t* data = (int32_t*)cmd_header->data; |
|
|
int32_t* data = (int32_t*)cmd_header->data; |
|
|
cmd_header->subModuleid = moduleid; |
|
|
|
|
|
cmd_header->cmdMainId = cmdindex >> 8; |
|
|
|
|
|
cmd_header->subModuleid = cmdindex & 0xff; |
|
|
|
|
|
|
|
|
cmd_header->moduleid = moduleid; |
|
|
|
|
|
cmd_header->cmdMainId = cmdindex >> 8; |
|
|
|
|
|
cmd_header->cmdSubId = cmdindex & 0xff; |
|
|
|
|
|
|
|
|
data[0] = data0; |
|
|
|
|
|
data[1] = data1; |
|
|
|
|
|
data[2] = data2; |
|
|
|
|
|
|
|
|
data[0] = data0; |
|
|
|
|
|
data[1] = data1; |
|
|
|
|
|
data[2] = data2; |
|
|
m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 4 * 1); |
|
|
m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 4 * 1); |
|
|
} |
|
|
} |
|
|
|
|
|
|