|
|
@ -15,20 +15,21 @@ using namespace std; |
|
|
|
|
|
|
|
void ZModuleDeviceManager::initialize(IZcanCmderMaster *cancmder) { |
|
|
|
m_cancmder = cancmder; |
|
|
|
assert(m_cancmder != nullptr); |
|
|
|
|
|
|
|
m_cancmder->regEventPacketListener([this](int32_t fromboard, zcr_cmd_header_t *packet, int32_t datalen) { |
|
|
|
if (datalen < 4) return; |
|
|
|
|
|
|
|
int32_t *pdata = (int32_t *)packet->data; |
|
|
|
int32_t event = pdata[0]; |
|
|
|
if (event == kreg_change_event) { |
|
|
|
int32_t moduleid = pdata[1]; |
|
|
|
int32_t event_id = pdata[2]; |
|
|
|
int32_t eventval = pdata[3]; |
|
|
|
callOnRegValChangeEvent(moduleid, event_id, eventval); |
|
|
|
} |
|
|
|
}); |
|
|
|
// assert(m_cancmder != nullptr);
|
|
|
|
if (m_cancmder) { |
|
|
|
m_cancmder->regEventPacketListener([this](int32_t fromboard, zcr_cmd_header_t *packet, int32_t datalen) { |
|
|
|
if (datalen < 4) return; |
|
|
|
|
|
|
|
int32_t *pdata = (int32_t *)packet->data; |
|
|
|
int32_t event = pdata[0]; |
|
|
|
if (event == kreg_change_event) { |
|
|
|
int32_t moduleid = pdata[1]; |
|
|
|
int32_t event_id = pdata[2]; |
|
|
|
int32_t eventval = pdata[3]; |
|
|
|
callOnRegValChangeEvent(moduleid, event_id, eventval); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
void ZModuleDeviceManager::registerModule(ZIModule *module) { |
|
|
|
assert(module != nullptr); |
|
|
@ -41,6 +42,7 @@ void ZModuleDeviceManager::registerModule(ZIModule *module) { |
|
|
|
/*******************************************************************************
|
|
|
|
* ZIModule * |
|
|
|
*******************************************************************************/ |
|
|
|
int32_t ZModuleDeviceManager::module_ping(uint16_t id) { PROXY_IMPL(ZIModule, module_ping); } |
|
|
|
int32_t ZModuleDeviceManager::module_stop(uint16_t id) { PROXY_IMPL(ZIModule, module_stop); } |
|
|
|
int32_t ZModuleDeviceManager::module_break(uint16_t id) { PROXY_IMPL(ZIModule, module_break); } |
|
|
|
int32_t ZModuleDeviceManager::module_get_last_exec_status(uint16_t id, int32_t *ack0) { PROXY_IMPL(ZIModule, module_get_last_exec_status, ack0); } |
|
|
|