1、improving MQTT transmission speed 2K Bytes per package

2、rename mqtt file name
This commit is contained in:
wgzAIIT
2023-06-21 18:59:04 +08:00
parent 6f3d3b8862
commit 5900b504e3
10 changed files with 520 additions and 473 deletions

View File

@@ -18,12 +18,21 @@
extern int FrameworkInit();
extern void ApplicationOtaTaskInit(void);
#ifdef OTA_BY_PLATFORM
extern int OtaTask(void);
#endif
int main(void)
{
printf("Hello, world! \n");
FrameworkInit();
printf("Hello, world! \n");
FrameworkInit();
#ifdef APPLICATION_OTA
ApplicationOtaTaskInit();
ApplicationOtaTaskInit();
#endif
#ifdef OTA_BY_PLATFORM
OtaTask();
#endif
return 0;
}

View File

@@ -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;

View File

@@ -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

View File

@@ -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;