|
我根据https://gitee.com/RT-Thread-Mirr ... ster/docs/README.md的操作步骤,编译之后提示没有找到
GAgent_mqtt.host = cloud->mqtt_server;
gagent_mqtt.port = cloud->mqtt_port;
编译出错,查paho_mqtt.h,发现gagent_mqtt所属的结构体MQTTClient没有host 和 port成员
以下是MQTTClient的定义
struct MQTTClient
{
const char *uri;
int sock;
MQTTPacket_connectData condata;
unsigned int next_packetid, command_timeout_ms;
size_t buf_size, readbuf_size;
unsigned char *buf, *readbuf;
unsigned int keepAliveInterval;
int isconnected;
uint32_t tick_ping;
void (*connect_callback)(MQTTClient *);
void (*online_callback)(MQTTClient *);
void (*offline_callback)(MQTTClient *);
struct MessageHandlers
{
char *topicFilter;
void (*callback)(MQTTClient *, MessageData *);
enum QoS qos;
} messageHandlers[MAX_MESSAGE_HANDLERS]; /* Message handlers are indexed by subscription topic */
void (*defaultMessageHandler)(MQTTClient *, MessageData *);
/* publish interface */
#if defined(RT_USING_POSIX) && (defined(RT_USING_DFS_NET) || defined(SAL_USING_POSIX))
int pub_pipe[2];
#else
int pub_sock;
int pub_port;
#endif /* RT_USING_POSIX && (RT_USING_DFS_NET || SAL_USING_POSIX) */
#ifdef MQTT_USING_TLS
/* mbedtls session struct*/
MbedTLSSession *tls_session;
#endif
};
|
|