void MQTT_Connect(char *username, char *password)
{
MQTTPacket_connectData data = MQTTPacket_connectData_initializer;
u32 len;
u8 buf[200];
data.clientID.cstring = "ch32v307";
data.keepAliveInterval = 2000;
data.cleansession = 1;
data.username.cstring = username;
data.password.cstring = password;
len = MQTTSerialize_connect(buf,sizeof(buf),&data);
Transport_SendPacket(buf,len);
}
热门产品 :
CH182: 以太网PHY收发器芯片