# Methods

The MQTT Device supports the following methods:

Method | Description
--- | ---
bool Publish(string topic, string payload) | Publish to the MQTT server: topic: the topic path name that clients can subscribe on. payload: the data to publish Returns true if connected otherwise false
bool PublishBytes(string topic, byte[] payload) | Publish to the MQTT server: topic: the topic path name that clients can subscribe on payload: the data to publish Returns true if connected otherwise false.
ReconnectWithNewId(string newId) | Provide an option for User to programmatically provide ID for MQTT Device and reconnect to broker with that ID.
bool Subscribe(string topicFilter) | Subscribe to data published to topics that match the topicFilter. returns true if connected otherwise false.
bool Unsubscribe(string topicFilter) | Unsubscribe from topics that match the topicFilter.