public interface MqttClientListener
Modifier and Type | Method and Description |
---|---|
void |
connectComplete(Object userContext,
boolean reconnect)
the event to indicate that the MQTT server is connected successfully.
|
void |
connectionLost(Object userContext)
the event to indicate that when the connection to the server is lost
|
void |
messageArrived(Object userContext,
String topic,
byte[] payload)
the event to indicate that there is a topic update from server
|
void |
onMqttConnectFailure(Object userContext,
int cause)
the event to indicate that the MQTT CONNACT message failed
|
void |
onMqttConnectSuccess(Object userContext)
the event to indicate that the MQTT CONNACT message successfully
|
void |
publishCompleted(Object userContext,
int msgId,
String topic,
int result)
the event to indicate the result of the topic publish
|
void |
subscribeCompleted(Object userContext,
int msgId,
String topic,
int result)
the event to indicate the result of the topic subscribe
|
void |
unsubscribeCompleted(Object userContext,
int msgId,
String topic,
int result)
the event to indicate the result of the topic unsubscribe
|
void connectComplete(Object userContext, boolean reconnect)
userContext
- pre-configured user contextreconnect
- If true, the connection was the result of automatic reconnect.void connectionLost(Object userContext)
userContext
- pre-configured user contextvoid messageArrived(Object userContext, String topic, byte[] payload)
userContext
- pre-configured user contexttopic
- the topic namepayload
- the new data of the topicvoid onMqttConnectFailure(Object userContext, int cause)
userContext
- context for event callbackcause
- the failure error codevoid onMqttConnectSuccess(Object userContext)
userContext
- pre-configured user contextvoid publishCompleted(Object userContext, int msgId, String topic, int result)
userContext
- pre-configured user contextmsgId
- the message id of this publish operationtopic
- the topic nameresult
- the publish result, 0 - failure 1 -successfullyvoid subscribeCompleted(Object userContext, int msgId, String topic, int result)
userContext
- pre-configured user contextmsgId
- the message id of this publish operationtopic
- the topic nameresult
- the publish result, 0 - failure 1 -successfullyvoid unsubscribeCompleted(Object userContext, int msgId, String topic, int result)
userContext
- pre-configured user contextmsgId
- the message id of this publish operationtopic
- the topic nameresult
- the publish result, 0 - failure 1 -successfully