update mqtt client
update mqtt client
This commit is contained in:
@@ -2,12 +2,16 @@
|
||||
* @Author: jiejie
|
||||
* @Github: https://github.com/jiejieTop
|
||||
* @Date: 2019-12-15 00:42:16
|
||||
* @LastEditTime: 2020-04-27 23:35:05
|
||||
* @LastEditTime: 2020-10-17 14:16:15
|
||||
* @Description: the code belongs to jiejie, please keep the author information and source code according to the license.
|
||||
*/
|
||||
#ifndef _MQTT_ERROR_H_
|
||||
#define _MQTT_ERROR_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum mqtt_error {
|
||||
MQTT_SSL_CERT_ERROR = -0x001C, /* cetr parse failed */
|
||||
MQTT_SOCKET_FAILED_ERROR = -0x001B, /* socket fd failed */
|
||||
@@ -42,4 +46,8 @@ typedef enum mqtt_error {
|
||||
|
||||
#define RETURN_ERROR(x) { return x; }
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -2,12 +2,16 @@
|
||||
* @Author: jiejie
|
||||
* @Github: https://github.com/jiejieTop
|
||||
* @Date: 2019-12-11 22:47:55
|
||||
* @LastEditTime: 2020-04-27 23:25:37
|
||||
* @LastEditTime: 2020-10-17 14:18:02
|
||||
* @Description: the code belongs to jiejie, please keep the author information and source code according to the license.
|
||||
*/
|
||||
#ifndef _MQTT_LIST_H_
|
||||
#define _MQTT_LIST_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct mqtt_list_node {
|
||||
struct mqtt_list_node *next;
|
||||
struct mqtt_list_node *prev;
|
||||
@@ -58,5 +62,9 @@ void mqtt_list_move(mqtt_list_t *node, mqtt_list_t *list);
|
||||
void mqtt_list_move_tail(mqtt_list_t *node, mqtt_list_t *list);
|
||||
int mqtt_list_is_empty(mqtt_list_t *list);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LIST_H_ */
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* @Author: jiejie
|
||||
* @Github: https://github.com/jiejieTop
|
||||
* @Date: 2019-12-27 03:25:58
|
||||
* @LastEditTime: 2020-06-17 20:28:18
|
||||
* @LastEditTime: 2020-10-17 14:15:55
|
||||
* @Description: the code belongs to jiejie, please keep the author information and source code according to the license.
|
||||
*/
|
||||
#ifndef _MQTT_LOG_H_
|
||||
@@ -10,6 +10,10 @@
|
||||
|
||||
#include "mqtt_defconfig.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MQTT_LOG_BASE_LEVEL (0)
|
||||
#define MQTT_LOG_ERR_LEVEL (MQTT_LOG_BASE_LEVEL + 1)
|
||||
#define MQTT_LOG_WARN_LEVEL (MQTT_LOG_ERR_LEVEL + 1)
|
||||
@@ -60,4 +64,8 @@
|
||||
#define mqtt_log_init()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LOG_H_ */
|
||||
|
@@ -2,17 +2,25 @@
|
||||
* @Author: jiejie
|
||||
* @Github: https://github.com/jiejieTop
|
||||
* @Date: 2020-01-09 19:59:19
|
||||
* @LastEditTime : 2020-01-10 08:52:45
|
||||
* @LastEditTime: 2020-10-17 14:18:15
|
||||
* @Description: the code belongs to jiejie, please keep the author information and source code according to the license.
|
||||
*/
|
||||
|
||||
#ifndef _RANDOM_H_
|
||||
#define _RANDOM_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define RANDOM_MAX 0x7FFFFFFF
|
||||
|
||||
int random_number(void);
|
||||
int random_number_range(unsigned int min, unsigned int max);
|
||||
char *random_string(unsigned int len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _RANDOM_H_ */
|
||||
|
Reference in New Issue
Block a user