forked from xuos/xiuos
1、improving MQTT transmission speed 2K Bytes per package
2、rename mqtt file name
This commit is contained in:
@@ -163,8 +163,12 @@ static int Ec200tIoctl(struct Adapter *adapter, int cmd, void *args)
|
||||
serial_cfg.serial_parity_mode = PARITY_NONE;
|
||||
serial_cfg.serial_bit_order = STOP_BITS_1;
|
||||
serial_cfg.serial_invert_mode = NRZ_NORMAL;
|
||||
//serial receive timeout 0.6s
|
||||
serial_cfg.serial_timeout = 600;
|
||||
#ifdef TOOL_USING_OTA
|
||||
serial_cfg.serial_timeout = OTA_RX_TIMEOUT;
|
||||
#else
|
||||
//serial receive timeout 10s
|
||||
serial_cfg.serial_timeout = 100000;
|
||||
#endif
|
||||
serial_cfg.is_ext_uart = 0;
|
||||
#ifdef ADAPTER_EC200T_DRIVER_EXT_PORT
|
||||
serial_cfg.is_ext_uart = 1;
|
||||
|
||||
@@ -355,12 +355,25 @@ static int GetCompleteATReply(ATAgentType agent)
|
||||
PrivMutexObtain(&agent->lock);
|
||||
if (agent->receive_mode == ENTM_MODE) {
|
||||
if (agent->entm_recv_len < ENTM_RECV_MAX) {
|
||||
if((res == 1) && (agent->entm_recv_len < agent->read_len)) {
|
||||
#ifdef TOOL_USING_MQTT
|
||||
if((res == 1) && (agent->entm_recv_len < agent->read_len))
|
||||
{
|
||||
agent->entm_recv_buf[agent->entm_recv_len] = ch;
|
||||
agent->entm_recv_len++;
|
||||
PrivMutexAbandon(&agent->lock);
|
||||
continue;
|
||||
} else {
|
||||
}
|
||||
#else
|
||||
agent->entm_recv_buf[agent->entm_recv_len] = ch;
|
||||
agent->entm_recv_len++;
|
||||
if(agent->entm_recv_len < agent->read_len)
|
||||
{
|
||||
PrivMutexAbandon(&agent->lock);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
#ifdef CONNECTION_FRAMEWORK_DEBUG
|
||||
printf("ENTM_MODE recv %d Bytes done.\n",agent->entm_recv_len);
|
||||
#endif
|
||||
|
||||
@@ -28,6 +28,12 @@
|
||||
|
||||
#define REPLY_TIME_OUT 10
|
||||
|
||||
#ifdef TOOL_USING_OTA
|
||||
#define ENTM_RECV_MAX OTA_RX_BUFFERSIZE
|
||||
#else
|
||||
#define ENTM_RECV_MAX 256
|
||||
#endif
|
||||
|
||||
enum ReceiveMode
|
||||
{
|
||||
DEFAULT_MODE = 0,
|
||||
@@ -70,7 +76,6 @@ struct ATAgent
|
||||
#endif
|
||||
pthread_t at_handler;
|
||||
|
||||
#define ENTM_RECV_MAX 2048
|
||||
char entm_recv_buf[ENTM_RECV_MAX];
|
||||
uint32 entm_recv_len;
|
||||
enum ReceiveMode receive_mode;
|
||||
|
||||
Reference in New Issue
Block a user