You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
750 B
24 lines
750 B
#include "protocol_event_bus_sender.hpp"
|
|
|
|
#include "api/api.hpp"
|
|
#include "cmdid.hpp"
|
|
namespace iflytop {
|
|
using namespace std;
|
|
|
|
void ProtocolEventBusSender::initialize(IZCanCmder* zcan_cmder) { m_zcan_cmder = zcan_cmder; }
|
|
|
|
void ProtocolEventBusSender::push_reg_state_change_event(int32_t moduleid, int32_t regindex, int32_t oldval, int32_t toval) {
|
|
zcr_cmd_header_t cmd_header = {0};
|
|
int32_t data[3];
|
|
|
|
cmd_header.cmdmoduleid = moduleid;
|
|
cmd_header.cmdmoduleid = zcr::kevent_bus_reg_change_report >> 8;
|
|
cmd_header.submoduleid = zcr::kevent_bus_reg_change_report & 0xff;
|
|
|
|
data[1] = regindex;
|
|
data[2] = oldval;
|
|
data[3] = toval;
|
|
m_zcan_cmder->triggerEvent(&cmd_header, (uint8_t*)data, sizeof(data));
|
|
}
|
|
|
|
} // namespace iflytop
|