1.5.8 • Published 7 years ago

cordova-plugin-mqtt-pahojs v1.5.8

Weekly downloads
12
License
MIT
Repository
github
Last release
7 years ago

Pure JavaScript MQTT client library. Wrapper for paho.js by BeeToo

Installation

For Cordova CLI users:

cordova plugin add cordova-plugin-mqtt-pahojs

Usage example

new window.plugins.mqtt({
            uri: MQTT_URI,
            keepAliveInterval: 120,
            clientId: MQTT_CLIENT_ID,
            reportConnectionStatus: false,
            reconnectDelay: [1000, 5000, 10000, -1]
        });
        btc.connect();

var connection = new window.plugins.mqtt({
    uri: 'ws://192.168.2.107:8080',
    keepAliveInterval: 120,
    clientId: 'BeeToo_MQTT',
    reportConnectionStatus: true,
    reconnectDelay: [1000, 5000, 10000, -1] //three tries to reconnect will take place. If -1 met, then reconnect process will stop.
});
connection.on('connected', function () {
    connection.subscribe('/russia/moscow/beetoo_status', {qos: 2});
    connection.publish('/russia/moscow/beetoo', 'hi, gyus!', {qos: 1, retained: true});
    connection.on('/russia/moscow/beetoo_status', function (value) {
        console.log('Yay! Value is: ' + value);
    });
});

connection.connect();

The MIT License (MIT)

1.5.8

7 years ago

1.5.7

7 years ago

1.5.6

7 years ago

1.5.5

7 years ago

1.5.4

7 years ago

1.5.3

7 years ago

1.5.2

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.4

7 years ago

1.3.2

7 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.1

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago