This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong.
xxxxxxxxxx
<file c sdk-gnss-mqtt-publish.are>
HOST = "123.123.123.123";
PORT = 1883;
KEEPALIVE = 60;
PROTOCOL = "V31";
USERNAME = "mqtt-username";
PASSWORD = "mqtt-password";
CLIENT_ID = "SDK-GPS";
TOPIC = "your-topic";
QOS = 0;
RETAIN = 0;
MESSAGE = "";
CLEAN_SESSION = true;
MQTT_HANDLE = 0;
/*create new mqtt instance*/
MQTT_HANDLE = nb_mqttlib_new(CLIENT_ID, CLEAN_SESSION);
if (nb_mqttlib_set_protocol_version(MQTT_HANDLE, PROTOCOL) < 0 ) {
printf("Unable to set Protocol version\n");
exit(1);
}
if (nb_mqttlib_set_user_pw(MQTT_HANDLE, USERNAME, PASSWORD) < 0 ) {
printf("Unable to set Username and Passsword\n");