Releases: mdjurfeldt/guile-mqtt
guile-mqtt-0.2.1
Guile MQTT provides bindings for the libmosquitto MQTT client library.
The bindings are written in GOOPS and rely on lower-level bindings
created by NYACC directly and automatically from mosquitto.h.
Changes compared to v0.2.0:
-
Bugfix: Removed last reference to (nyacc foreign cdata) in (ffi
mosquitto) such that (mosquitto client) gets independent of NYACC -
Cleanups
The bindings align with GOOPS style, which means short method
names. (The specialization is done through the arguments.)
The user can extend the client class by inheritance.
This is beta software.
The following example, as well as the Guile libmosquitto bindings themselves,
are inspired by the Chicken Scheme mosquitto bindings by Dmitrii Kosenkov.
(use-modules (mosquitto client))
(let ((client (make-client #:on-connect
(lambda (client err)
(if (not (eq? err MOSQ_ERR_SUCCESS))
(abort err)
(display "Yay, we are connected!\n"))))))
(set! (disconnect-callback client)
(lambda (client err)
(if (not (eq? err MOSQ_ERR_SUCCESS))
(display "Unexpected disconnect...\n"))))
(set! (message-callback client)
(lambda (cl msg)
(display (string->append "Topic: " (topic msg)
"Payload:" (payload msg)))
(publish client "topic2" "message received, thanks!")))
(connect client "localhost" #:username "mqtt-admin" #:password "mypass")
(subscribe client "topic1")
(loop-forever client))
See further examples under the directory examples.
Guile MQTT is free software and is released under the LGPL v3 license.
guile-mqtt-0.2.0
Guile MQTT provides bindings for the libmosquitto MQTT client
library. The bindings are written in
GOOPS
and rely on lower-level bindings created by NYACC directly and
automatically from mosquitto.h.
Changes compared to v0.1.0:
-
All functionality of Chicken Scheme mosquitto bindings now
implemented and documented. -
Distribute own copy of (... foreign cdata). NYACC is now not
required if building from a tar archive (as opposed to building from
a git repository clone). -
Support make in separate build directory.
-
Bugfix: unsubscribe now works.
The bindings align with GOOPS style, which means short method
names. (The specialization is done through the arguments.)
The user can extend the client class by inheritance.
This is beta software.
The following example, as well as the Guile libmosquitto bindings themselves,
are inspired by the Chicken Scheme mosquitto
bindings by Dmitrii
Kosenkov.
(use-modules (mosquitto client))
(let ((client (make-client #:on-connect
(lambda (client err)
(if (not (eq? err MOSQ_ERR_SUCCESS))
(abort err)
(display "Yay, we are connected!"))))))
(set! (disconnect-callback client)
(lambda (client err)
(if (not (eq? err MOSQ_ERR_SUCCESS))
(display "Unexpected disconnect..."))))
(set! (message-callback client)
(lambda (cl msg)
(display (string->append "Topic: " (topic msg)
"Payload:" payload msg))
(publish client "topic2" "message received, thanks!")))
(connect client "localhost" #:username "mqtt-admin" #:password "mypass")
(subscribe client "topic1")
(loop-forever client))
See further examples under the directory examples.
Guile MQTT is free software and is released under the LGPL v3 license.
guile-mqtt-0.1.1
Guile MQTT provides bindings for the libmosquitto MQTT client
library. The bindings are written in
GOOPS
and rely on lower-level bindings created by NYACC directly and
automatically from mosquitto.h.
This release adds support for new options in connect
:
#:bind-address #:tls-cafile #:tls-capath #:tls-certfile #:tls-keyfile
The bindings align with GOOPS style, which means short method
names. (The specialization is done through the arguments.)
The user can extend the client class by inheritance.
This is still very much beta software. Also, not all method options in
this README are yet implemented. See the reference manual for better
indication of what is implemented.
This example, as well as the Guile libmosquitto bindings themselves,
are inspired by the Chicken Scheme mosquitto
bindings by Dmitrii
Kosenkov.
(use-modules (mosquitto client))
(let ((client (make-client #:on-connect
(lambda (client err)
(if (not (eq? err MOSQ_ERR_SUCCESS))
(abort err)
(display "Yay, we are connected!"))))))
(set! (disconnect-callback client)
(lambda (client err)
(if (not (eq? err MOSQ_ERR_SUCCESS))
(display "Unexpected disconnect..."))))
(set! (message-callback client)
(lambda (cl msg)
(display (string->append "Topic: " (topic msg)
"Payload:" payload msg))
(publish client "topic2" "message received, thanks!")))
(connect client "localhost" #:username "mqtt-admin" #:password "mypass")
(subscribe client "topic1")
(loop-forever client))
See further examples under the directory examples.
Guile MQTT is free software and is released under the LGPL v3 license.
guile-mqtt-v0.1.0
Guile MQTT provides bindings for the libmosquitto MQTT client
library. The bindings are written in
GOOPS
and rely on lower-level bindings created by NYACC directly and
automatically from mosquitto.h.
The bindings align with GOOPS style, which means short method
names. (The specialization is done through the arguments.)
The user can extend the client class by inheritance.
This is still very much beta software. Also, not all method options in
this README are yet implemented. See the reference manual for better
indication of what is implemented.
This example, as well as the Guile libmosquitto bindings themselves,
are inspired by the Chicken Scheme mosquitto
bindings by Dmitrii
Kosenkov.
(use-modules (mosquitto client))
(let ((client (make-client #:on-connect
(lambda (client err)
(if (not (eq? err MOSQ_ERR_SUCCESS))
(abort err)
(display "Yay, we are connected!"))))))
(set! (disconnect-callback client)
(lambda (client err)
(if (not (eq? err MOSQ_ERR_SUCCESS))
(display "Unexpected disconnect..."))))
(set! (message-callback client)
(lambda (cl msg)
(display (string->append "Topic: " (topic msg)
"Payload:" payload msg))
(publish client "topic2" "message received, thanks!")))
(connect client "localhost" #:username "mqtt-admin" #:password "mypass")
(subscribe client "topic1")
(loop-forever client))
See further examples under the directory examples.
Guile MQTT is free software and is released under the LGPL v3 license.