-
Notifications
You must be signed in to change notification settings - Fork 7
Freebird Events
- 'ncEnabled' Emitted when a netcore is enabled.
- 'ncDisabled' Emitted when a netcore is disabled.
- 'ncStarted' Emitted when a netcore is started.
- 'ncStopped' Emitted when a netcore is stopped.
- 'ncPermitJoin' Emitted when a netcore is (dis)allowing devices joining.
- 'devIncoming' Emitted when a new device is incoming.
- 'devLeaving' Emitted when a device is leaving.
- 'devReporting' Emitted when a report message of device attribute(s) is coming.
- 'devNetChanged' Emitted when network information of a device has changed.
- 'devStatusChanged' Emitted when status of a device has changed.
- 'devPropsChanged' Emitted when meta-property(ies) of a device has changed.
- 'devAttrsChanged' Emitted when attribute(s) on a device has changed.
- 'gadIncoming' Emitted when a new gadget is incoming.
- 'gadLeaving' Emitted when a gadget is leaving.
- 'gadReporting' Emitted when a report message of gadget attribute(s) is coming.
- 'gadPanelChanged' Emitted when panel information of a gadget has changed.
- 'gadPropsChanged' Emitted when meta-property(ies) of a gadget has changed.
- 'gadAttrsChanged' Emitted when attribue(s) on a gadget has changed.
- 'bannedDevIncoming' Emitted when a banned device is trying to join the network.
- 'bannedDevReporting' Emitted when a banned device is trying to report its attributes.
- 'bannedGadIncoming' Emitted when a banned gadget is trying to join the network.
- 'bannedGadReporting' Emitted when a banned gadget is trying to report its attributes.
Emitted when freebird is ready.
Listener: function (msg) {}
freebird.on('ready', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ netcore: 'mqtt-core' }
Emitted when freebird error occurs.
Listener: function (err) {}
freebird.on('error', function (err) {
// ...
});
Listener Arguments:
-
err
(Object): An error object
Emitted when a netcore is enabled.
Listener: function (msg) {}
freebird.on('ncEnabled', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core' }
Emitted when a netcore is disabled.
Listener: function (msg) {}
freebird.on('ncDisabled', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core' }
Emitted when a netcore is started.
Listener: function (msg) {}
freebird.on('ncStarted', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core' }
Emitted when a netcore is stopped.
Listener: function (msg) {}
freebird.on('ncStopped', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core' }
Emitted when a netcore is now allowing or disallowing devices to join the network, where timeLeft
is number of seconds left to allow devices to join the network.
Listener: function (msg) {}
freebird.on('ncPermitJoin', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', timeLeft: 60 }
Emitted when a new device is incoming.
Listener: function (msg) {}
freebird.on('devIncoming', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', id: 5, device: device }
Emitted when a device is leaving.
Listener: function (msg) {}
freebird.on('devIncoming', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', id: 5 }
Emitted when a report message of certain attribute(s) on a device is coming. data
property is partial changes of devAttrsObj
Listener: function (msg) {}
freebird.on('devReporting', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', id: 5, data: devAttrs }
Emitted when network information of a device has changed. data
property is partial changes of netInfoObj, _data property is the old netInfoObj value that before changed.
Listener: function (msg) {}
freebird.on('devNetChanged', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', id: 5, data: netInfoObj, _data: oldValue }
Emitted when status of a device has changed. The status can be 'online', 'sleep', 'offline', and 'unknown'.
Listener: function (msg) {}
freebird.on('devStatusChanged', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', id: 5, data: 'offline' }
Emitted when meta-property(ies) of a device has changed. data
property is partial changes of devPropsObj, _data property is the old devPropsObj value that before changed.
Listener: function (msg) {}
freebird.on('devPropsChanged', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', id: 5, data: delta, _data: oldValue }
Emitted when attribute(s) on a device has changed. data
property is partial changes of devAttrsObj, _data property is the old devAttrsObj value that before changed.
Listener: function (msg) {}
freebird.on('devAttrsChanged', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', id: 5, data: delta, _data: oldValue }
Emitted when a new gadget is incoming.
Listener: function (msg) {}
freebird.on('gadIncoming', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', auxId: 'magnetometer/0', id: 5, gadget: gadget }
Emitted when a gadget is leaving.
Listener: function (msg) {}
freebird.on('gadLeaving', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', auxId: 'magnetometer/0', id: 5 }
Emitted when a report message of certain attribute(s) on a gadget is coming. data
property is partial changes of gadAttrsObj.
Listener: function (msg) {}
freebird.on('gadReporting', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', auxId: 'magnetometer/0', id: 5, data: delta }
Emitted when panel information of a gadget has changed. data
property is partial changes of panelInfoObj, _data property is the old panelInfoObj value that before changed.
Listener: function (msg) {}
freebird.on('gadPanelChanged', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', auxId: 'magnetometer/0', id: 5, data: delta, _delta: oldVal }
Emitted when meta-property(ies) of a gadget has changed. data
property is partial changes of gadPropsObj, _data property is the old gadPropsObj value that before changed.
Listener: function (msg) {}
freebird.on('gadPropsChanged', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', auxId: 'magnetometer/0', id: 5, data: delta, _delta: oldVal }
Emitted when attribue(s) on a gadget has changed. data
property is partial changes of gadAttrsObj, _data property is the old gadAttrsObj value that before changed.
Listener: function (msg) {}
freebird.on('gadAttrsChanged', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', auxId: 'magnetometer/0', id: 5, data: delta }
Emitted when a banned device is trying to join the network.
Listener: function (msg) {}
freebird.on('bannedDevIncoming', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c' }
Emitted when a banned device is trying to report its attributes.
Listener: function (msg) {}
freebird.on('bannedDevReporting', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c' }
Emitted when a banned gadget is trying to join the network.
Listener: function (msg) {}
freebird.on('bannedGadIncoming', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', auxId: 'magnetometer/0' }
Emitted when a banned gadget is trying to report its attributes.
Listener: function (msg) {}
freebird.on('bannedGadReporting', function (msg) {
// ...
});
Listener Arguments:
-
msg
(Object):{ ncName: 'mqtt-core', permAddr: '00:0c:29:ff:ed:7c', auxId: 'magnetometer/0' }
Overview
APIs & Events
- APIs
- Events
Advanced Topics
- Remote Process Comm. (RPC)
- Plugin System
Appendix
- Device data object format
- Gadget data object format