|
|
@ -11,7 +11,7 @@ using namespace smtp2; |
|
|
|
#define TAG "SMTP2"
|
|
|
|
|
|
|
|
#define OVERTIME 100
|
|
|
|
#define DUMP_HEX 1
|
|
|
|
#define DUMP_HEX 0
|
|
|
|
|
|
|
|
#define SEND_CMD(fmt, ...) sendcmd(true, "/1" fmt "R\r", ##__VA_ARGS__);
|
|
|
|
#define SEND_CMD_NLOG(fmt, ...) sendcmd(false, "/1" fmt "R\r", ##__VA_ARGS__);
|
|
|
@ -42,7 +42,7 @@ int32_t SMTP2V2::pump_get_state(int32_t* isbusy) { |
|
|
|
} |
|
|
|
int32_t SMTP2V2::pump_get_state_as_int(int32_t state_index, int32_t* val) { |
|
|
|
size_t rxlen = 0; |
|
|
|
int ret = SEND_CMD("/1?%d\r", state_index); |
|
|
|
int ret = SEND_CMD("?%d\r", state_index); |
|
|
|
if (ret != 0) { |
|
|
|
return ret; |
|
|
|
} |
|
|
@ -164,7 +164,7 @@ bool SMTP2V2::sendcmd_auto_retry(bool dump, const char* cmd) { |
|
|
|
bool SMTP2V2::_sendcmd(bool dump, const char* cmd) { |
|
|
|
m_rxNum = 0; |
|
|
|
|
|
|
|
#ifdef DUMP_HEX
|
|
|
|
#if DUMP_HEX
|
|
|
|
if (dump) { |
|
|
|
ZLOGI(TAG, "tx:%s", cmd); |
|
|
|
} |
|
|
@ -172,7 +172,7 @@ bool SMTP2V2::_sendcmd(bool dump, const char* cmd) { |
|
|
|
|
|
|
|
bool ret = _sendcmd_dma(cmd); |
|
|
|
|
|
|
|
#ifdef DUMP_HEX
|
|
|
|
#if DUMP_HEX
|
|
|
|
if (dump) { |
|
|
|
ZLOGI(TAG, "rx:%s", m_rxbuf); |
|
|
|
} |
|
|
|