add qcloud explorer ota sample

This commit is contained in:
daishengdong
2020-05-07 15:09:09 +08:00
parent 3e631cd96a
commit 7fdfb8f1c5
19 changed files with 5510 additions and 49 deletions

View File

@@ -11,7 +11,7 @@
/* #undef LOG_UPLOAD */
/* #undef IOT_DEBUG */
/* #undef DEBUG_DEV_INFO_USED */
#define AT_TCP_ENABLED
/* #undef AT_TCP_ENABLED */
#define AT_UART_RECV_IRQ
/* #undef AT_OS_USED */
/* #undef AT_DEBUG */

View File

@@ -119,7 +119,7 @@ typedef void (*OnSubEventHandler)(void *pClient, MQTTEventType event_type, void
*/
typedef struct {
QoS qos; // MQTT QoS level
OnMessageHandler on_message_handler; // callback when message arrived
OnMessageHandler on_message_handler; // callback when message arrived
OnSubEventHandler on_sub_event_handler; // callback when event happened
void *user_data; // user context for callback
} SubscribeParams;
@@ -160,7 +160,7 @@ typedef struct {
/* device info */
char *product_id; // product ID
char *device_name; // device name
#ifdef AUTH_MODE_CERT
char *cert_file; // cert file path
char *key_file; // key file path
@@ -219,7 +219,7 @@ int IOT_MQTT_Yield(void *pClient, uint32_t timeout_ms);
/**
* @brief Publish MQTT message
*
* @param pClient handle to MQTT client
* @param pClient handle to MQTT client
* @param topicName MQTT topic name
* @param pParams publish parameters
*
@@ -230,7 +230,7 @@ int IOT_MQTT_Publish(void *pClient, char *topicName, PublishParams *pParams);
/**
* @brief Subscribe MQTT topic
*
* @param pClient handle to MQTT client
* @param pClient handle to MQTT client
* @param topicFilter MQTT topic filter
* @param pParams subscribe parameters
*
@@ -241,7 +241,7 @@ int IOT_MQTT_Subscribe(void *pClient, char *topicFilter, SubscribeParams *pParam
/**
* @brief Unsubscribe MQTT topic
*
* @param pClient handle to MQTT client
* @param pClient handle to MQTT client
* @param topicFilter MQTT topic filter
*
* @return packet id (>=0) when success, or err code (<0) for failure
@@ -251,7 +251,7 @@ int IOT_MQTT_Unsubscribe(void *pClient, char *topicFilter);
/**
* @brief Check if MQTT is connected
*
* @param pClient handle to MQTT client
* @param pClient handle to MQTT client
* @return true= connected, false = unconnected
*/
bool IOT_MQTT_IsConnected(void *pClient);

View File

@@ -20,9 +20,9 @@
* Below variables are dependant on user situation (network status/device memory/application context)
* Adjust the default value to meet your requirement
*/
/* default MQTT/CoAP timeout value when connect/pub/sub (unit: ms) */
#define QCLOUD_IOT_MQTT_COMMAND_TIMEOUT (5 * 1000)
#define QCLOUD_IOT_MQTT_COMMAND_TIMEOUT (15 * 1000)
/* default MQTT keep alive interval (unit: ms) */
#define QCLOUD_IOT_MQTT_KEEP_ALIVE_INTERNAL (240 * 1000)
@@ -57,7 +57,7 @@
#define MAX_LOG_MSG_LEN (1023)
#endif
/*
/*
* Log upload related params, which will affect the size of device memory/disk consumption
* the default value can be changed for different user situation
*/