From ca12d74cf4fcac56ac21d176086283cdc0b6494f Mon Sep 17 00:00:00 2001 From: Oliver Lorenz Date: Wed, 6 May 2015 22:29:34 +0200 Subject: [PATCH] added a useful readme --- README.md | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c79f5ce..2d2b385 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,39 @@ -# reactMqtt +# ReactPHP MQTT -reactMqtt is a mqtt client library PHP. Its based on the reactPHP socket-client and added the mqtt protocol specific functions +reactMqtt is a mqtt client library PHP. Its based on the reactPHP socket-client and added the mqtt protocol specific functions. I hope its a better starting point that the existing php mqtt libraries. ### Notice - (May 6th, 2015) +This is the first initial commit. Only some things work already: +* Connect +* Connection Ack +* publish + +I will add more features if I need them. If you need features: please give feedback or contribute to get this library running. + +## Goal + +Goal of this project is easy to use mqtt client for PHP in a modern architecture. Currently, only protocol version 4 (mqtt 3.1.1) is implemented. +* Protocol specifications: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/csprd02/mqtt-v3.1.1-csprd02.html + +## Example publish +```php +createCached('8.8.8.8', $loop); + +$version = new oliverlorenz\reactphpmqtt\protocol\Version4(); +$connector = new oliverlorenz\reactphpmqtt\Connector($loop, $resolver, $version); + +$connector->create('yourmqttserver.tdl', 1883); +$connector->onConnected(function() use ($connector) { + $connector->publish('a/b', 'example message'); +}); +$loop->run(); + + +``` \ No newline at end of file