|
@ -25,9 +25,19 @@ void MicroComputerModuleDeviceScriptCmderPaser::initialize(ICmdParser* cancmder, |
|
|
m_cmdParser = cancmder; |
|
|
m_cmdParser = cancmder; |
|
|
m_deviceManager = deviceManager; |
|
|
m_deviceManager = deviceManager; |
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
|
|
* ¼æÈÝ½Ó¿Ú * |
|
|
|
|
|
*******************************************************************************/ |
|
|
cancmder->regCMD("dumpreg", "(mid)", 1, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) { //
|
|
|
cancmder->regCMD("dumpreg", "(mid)", 1, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) { //
|
|
|
app_dump_reg(paramN, paraV, ack); |
|
|
app_dump_reg(paramN, paraV, ack); |
|
|
}); |
|
|
}); |
|
|
|
|
|
cancmder->regCMD("scanmodule", "()", 0, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) { //
|
|
|
|
|
|
do_scan_module(paramN, paraV, ack); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
|
|
* ½Ó¿Ú * |
|
|
|
|
|
*******************************************************************************/ |
|
|
cancmder->regCMD("app_dump_regs", "(mid)", 1, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) { //
|
|
|
cancmder->regCMD("app_dump_regs", "(mid)", 1, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) { //
|
|
|
app_dump_reg(paramN, paraV, ack); |
|
|
app_dump_reg(paramN, paraV, ack); |
|
|
}); |
|
|
}); |
|
@ -40,10 +50,13 @@ void MicroComputerModuleDeviceScriptCmderPaser::initialize(ICmdParser* cancmder, |
|
|
cancmder->regCMD("app_wait_for_module", "(mid,timeout)", -1, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) { //
|
|
|
cancmder->regCMD("app_wait_for_module", "(mid,timeout)", -1, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) { //
|
|
|
do_wait_for_module(paramN, paraV, ack); |
|
|
do_wait_for_module(paramN, paraV, ack); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
cancmder->regCMD("scanmodule", "()", 0, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) { //
|
|
|
|
|
|
|
|
|
cancmder->regCMD("app_scanmodule", "()", 0, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) { //
|
|
|
do_scan_module(paramN, paraV, ack); |
|
|
do_scan_module(paramN, paraV, ack); |
|
|
}); |
|
|
}); |
|
|
|
|
|
cancmder->regCMD("app_module_read_raw_str", "(mid,size)", 2, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) { //
|
|
|
|
|
|
app_module_read_raw_str(paramN, paraV, ack); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
deviceManager->regOnRegValChangeEvent([this](int32_t moduleid, int32_t event_id, int32_t eventval) { //
|
|
|
deviceManager->regOnRegValChangeEvent([this](int32_t moduleid, int32_t event_id, int32_t eventval) { //
|
|
|
ZLOGI(TAG, "onRegValChangeEvent(%d,%d,%d)", moduleid, event_id, eventval); |
|
|
ZLOGI(TAG, "onRegValChangeEvent(%d,%d,%d)", moduleid, event_id, eventval); |
|
|
}); |
|
|
}); |
|
@ -63,6 +76,16 @@ void MicroComputerModuleDeviceScriptCmderPaser::app_dump_reg(int32_t paramN, con |
|
|
app_dump_reg(moduleId, regid); |
|
|
app_dump_reg(moduleId, regid); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MicroComputerModuleDeviceScriptCmderPaser::app_module_read_raw_str(int32_t paramN, const char* paraV[], ICmdParserACK* ack) { |
|
|
|
|
|
ack->ecode = 0; |
|
|
|
|
|
uint16_t moduleId = atoi(paraV[0]); |
|
|
|
|
|
uint16_t startadd = atoi(paraV[1]); |
|
|
|
|
|
ack->rawlen = sizeof(ack->rawdata); |
|
|
|
|
|
ack->ecode = m_deviceManager->module_read_raw(moduleId, startadd, ack->rawdata, &ack->rawlen); |
|
|
|
|
|
ack->acktype = ICmdParserACK::kAckType_str; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void MicroComputerModuleDeviceScriptCmderPaser::app_dump_reg(int32_t moduleId, int32_t regid) { |
|
|
void MicroComputerModuleDeviceScriptCmderPaser::app_dump_reg(int32_t moduleId, int32_t regid) { |
|
|
#define DUMP_CONFIG(tag, configid) \
|
|
|
#define DUMP_CONFIG(tag, configid) \
|
|
|
if (regid == 0 || regid == configid) { \ |
|
|
if (regid == 0 || regid == configid) { \ |
|
|