LiamBindle / MQTT-C

A portable MQTT C client for embedded systems and PCs alike.
https://liambindle.ca/MQTT-C
MIT License
774 stars 275 forks source link

Client_id #85

Closed the-mind closed 4 years ago

the-mind commented 4 years ago

I want to use the client_id to connect to a mqtt broker.

const char* client_id = NULL;
/* Ensure we have a clean session */
uint8_t connect_flags = MQTT_CONNECT_CLEAN_SESSION;
/* Send connection request to the broker. */
mqtt_connect(&client, client_id, NULL, NULL, 0, NULL, NULL, connect_flags, 400);

What should i change to connect using a custom client_id like 12345 etc.

LiamBindle commented 4 years ago

@the-mind client_id is string that name your client. If you want your clients name to be 12345 you can do "12345".

See the docs here