X-Ryl669 / eMQTT5

An embedded MQTTv5 client in C++ with minimal footprint, maximal performance
MIT License
65 stars 13 forks source link

How to connect without ClientID? #22

Open 1115william opened 2 weeks ago

1115william commented 2 weeks ago

It needs a clientID to initialize the Network::Client::MQTTv5, but if we don't have clientID, how to connect to the server? for example, connect to a remote broker.

X-Ryl669 commented 2 weeks ago

That's not a problem. You can pass a NULL (nullptr or 0) value for the clientID in the constructor and it'll just use what the broker provides.

The documentation in the MQTTClient.hpp states:

@param clientID     A client identifier if you need to provide one. If empty or null, the broker will assign one

I'm not building the doxygen documentation by default when you build the library, so you might miss it.

In that case, I invite you to visit the documentation size for a better description of parameters and what is supported.