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);
}
热门产品 :
CH634: 4端口USB3.0 HUB控制器芯片