forked from xuos/xiuos
improving MQTT transmission speed
This commit is contained in:
parent
87921c4212
commit
6f3d3b8862
|
@ -163,8 +163,8 @@ static int Ec200tIoctl(struct Adapter *adapter, int cmd, void *args)
|
||||||
serial_cfg.serial_parity_mode = PARITY_NONE;
|
serial_cfg.serial_parity_mode = PARITY_NONE;
|
||||||
serial_cfg.serial_bit_order = STOP_BITS_1;
|
serial_cfg.serial_bit_order = STOP_BITS_1;
|
||||||
serial_cfg.serial_invert_mode = NRZ_NORMAL;
|
serial_cfg.serial_invert_mode = NRZ_NORMAL;
|
||||||
//serial receive timeout 1s
|
//serial receive timeout 0.6s
|
||||||
serial_cfg.serial_timeout = 1000;
|
serial_cfg.serial_timeout = 600;
|
||||||
serial_cfg.is_ext_uart = 0;
|
serial_cfg.is_ext_uart = 0;
|
||||||
#ifdef ADAPTER_EC200T_DRIVER_EXT_PORT
|
#ifdef ADAPTER_EC200T_DRIVER_EXT_PORT
|
||||||
serial_cfg.is_ext_uart = 1;
|
serial_cfg.is_ext_uart = 1;
|
||||||
|
|
|
@ -738,8 +738,8 @@ SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHE
|
||||||
|
|
||||||
|
|
||||||
#ifdef OTA_BY_PLATFORM
|
#ifdef OTA_BY_PLATFORM
|
||||||
#define FRAME_LEN 256 //每帧数据的数据包长度
|
#define FRAME_LEN 1024 //每帧数据的数据包长度
|
||||||
static uint8_t MqttRxbuf[512];
|
static uint8_t MqttRxbuf[2048];
|
||||||
static uint8_t FrameBuf[FRAME_LEN];
|
static uint8_t FrameBuf[FRAME_LEN];
|
||||||
static OTA_TCB AliOTA;
|
static OTA_TCB AliOTA;
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
@ -806,7 +806,7 @@ static void app_ota_by_platform(void)
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
memset(MqttRxbuf,0,sizeof(MqttRxbuf));
|
memset(MqttRxbuf,0,sizeof(MqttRxbuf));
|
||||||
datalen = MQTT_Recv(MqttRxbuf, 512);
|
datalen = MQTT_Recv(MqttRxbuf, sizeof(MqttRxbuf));
|
||||||
if(datalen > 0 && (MqttRxbuf[0] == 0x30))
|
if(datalen > 0 && (MqttRxbuf[0] == 0x30))
|
||||||
{
|
{
|
||||||
MQTT_DealPublishData(MqttRxbuf, datalen);
|
MQTT_DealPublishData(MqttRxbuf, datalen);
|
||||||
|
@ -879,7 +879,7 @@ static void app_ota_by_platform(void)
|
||||||
ota_info.down.crc32= calculate_crc32(DOWN_FLAH_ADDRESS, AliOTA.size);
|
ota_info.down.crc32= calculate_crc32(DOWN_FLAH_ADDRESS, AliOTA.size);
|
||||||
|
|
||||||
memset(ota_info.down.version,0,sizeof(ota_info.down.version));
|
memset(ota_info.down.version,0,sizeof(ota_info.down.version));
|
||||||
create_version(ota_info.os.version, ota_info.down.version);
|
strncpy(ota_info.down.version, AliOTA.version, sizeof(ota_info.down.version));
|
||||||
|
|
||||||
memset(ota_info.down.description,0,sizeof(ota_info.down.description));
|
memset(ota_info.down.description,0,sizeof(ota_info.down.description));
|
||||||
strncpy(ota_info.down.description, "MQTT OTA bin.",sizeof(ota_info.down.description));
|
strncpy(ota_info.down.description, "MQTT OTA bin.",sizeof(ota_info.down.description));
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#define SERVERPORT "1883"
|
#define SERVERPORT "1883"
|
||||||
|
|
||||||
#define PACK_SIZE 512 //存放报文数据缓冲区大小
|
#define PACK_SIZE 512 //存放报文数据缓冲区大小
|
||||||
#define CMD_SIZE 512 //保存推送的PUBLISH报文中的数据缓冲区大小
|
#define CMD_SIZE 2048 //保存推送的PUBLISH报文中的数据缓冲区大小
|
||||||
|
|
||||||
typedef struct{
|
typedef struct{
|
||||||
uint8_t Pack_buff[PACK_SIZE]; //存放发送报文数据缓冲区
|
uint8_t Pack_buff[PACK_SIZE]; //存放发送报文数据缓冲区
|
||||||
|
|
Loading…
Reference in New Issue