Java Code Examples for org.eclipse.paho.client.mqttv3.MqttConnectOptions#MQTT_VERSION_3_1
The following examples show how to use
org.eclipse.paho.client.mqttv3.MqttConnectOptions#MQTT_VERSION_3_1 .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConnectMQTT.java From helloiot with GNU General Public License v3.0 | 5 votes |
@Override public void loadConfig(SubProperties configprops) { host.setText(configprops.getProperty("host", "localhost")); port.setText(configprops.getProperty("port", "1883")); ssl.setSelected(Boolean.parseBoolean(configprops.getProperty("ssl", "false"))); websockets.setSelected(Boolean.parseBoolean(configprops.getProperty("websockets", "false"))); protocol.getSelectionModel().select(SSLProtocol.valueOfDefault(configprops.getProperty("protocol", "TLSv12"))); keystore.setText(configprops.getProperty("keystore", "")); keystorepassword.setText(configprops.getProperty("keystorepassword", "")); truststore.setText(configprops.getProperty("truststore", "")); truststorepassword.setText(configprops.getProperty("truststorepassword", "")); username.setText(configprops.getProperty("username", "")); password.setText(configprops.getProperty("password", "")); clientid.setText(configprops.getProperty("clientid", CryptUtils.generateID())); timeout.setText(configprops.getProperty("connectiontimeout", Integer.toString(MqttConnectOptions.CONNECTION_TIMEOUT_DEFAULT))); keepalive.setText(configprops.getProperty("keepaliveinterval", Integer.toString(MqttConnectOptions.KEEP_ALIVE_INTERVAL_DEFAULT))); maxinflight.setText(configprops.getProperty("maxinflight", Integer.toString(MqttConnectOptions.MAX_INFLIGHT_DEFAULT))); switch (Integer.parseInt(configprops.getProperty("version", Integer.toString(MqttConnectOptions.MQTT_VERSION_DEFAULT)))) { case MqttConnectOptions.MQTT_VERSION_3_1_1: version311.setSelected(true); break; case MqttConnectOptions.MQTT_VERSION_3_1: version31.setSelected(true); break; default: versiondefault.setSelected(true); } switch (configprops.getProperty("broker", "0")) { case "1": brokermosquitto.setSelected(true); break; default: brokernone.setSelected(true); } topicsys = configprops.getProperty("topicsys"); }
Example 2
Source File: ConnectMQTT.java From helloiot with GNU General Public License v3.0 | 5 votes |
public int getVersion() { if (version311.isSelected()) { return MqttConnectOptions.MQTT_VERSION_3_1_1; } else if (version31.isSelected()) { return MqttConnectOptions.MQTT_VERSION_3_1; } else { return MqttConnectOptions.MQTT_VERSION_DEFAULT; } }