-
Notifications
You must be signed in to change notification settings - Fork 86
mqtt connected
Matthias Görges edited this page Mar 16, 2015
·
1 revision
mqtt-connected? checks if a MQTT instance is connected to a data broker.
Parameter | Description |
---|---|
t | MQTT instance |
Example 1: Check if a MQTT broker connection exists before publishing a topic. Example is extracted from modules/mqtt/mqtt.scm
(define (mqtt-publish t topic msg qos retain)
(mqtt:log 2 "mqtt-publish " t " " topic " " msg " " qos " " retain)
(let ((connected (mqtt-connected? t)))
(if connected
(begin
(mqtt:publish (table-ref t 'handle #f) topic qos retain (mqtt:encode msg))
#t
)
#f
)
))
-
- accelerometer
- alist
- audio
- audioaux
- base64
- btle-scan
- camera
- cdb
- cgi
- config
- csv
- curl
- digest
- dmtx
- download
- eventloop
- fcgi
- fft
- generalized-arrays
- gps
- graph
- gyro
- hidapi
- hpdf
- html
- httpsclient
- hybridapp
- json
- lmdb
- ln_core
- ln_glcore
- ln_glgui
- ln_store
- localization
- localization_gui
- localnotification
- magnetometer
- mdns
- mqtt
- mqtt-store
- multitouch
- oauth
- orientation
- p256ecdsa
- png
- portaudio
- pregexp
- pressure
- prime
- pushnotification
- redcap
- rsa
- rtaudio
- rupi
- rotation
- sanestring
- scheduler
- serial
- sets
- settings
- simplexnoise
- sqlite
- ssax
- syntax-case
- timestamp
- ttf
- uiform
- url
- uuid
- vibrate
- videoplayer
- watchdog
- website
- xml
- zip