MQTT codec is an implementation of the MQTT Codec using scodec. It provides a set of case class and a coder/decoder to extract these clases from binary messages. It implements the MQTT 3.1 protocol specification.
All extracted messages are visible in the Message.scala file.
The project is under the MIT License. See the LICENSE.md file.
Add the following dependency and the bintray host
resolvers += "octalmind maven" at "http://dl.bintray.com/guillaumebreton/maven"
libraryDependencies += "octamind" % "mqtt-codec_2.11" % "1.1.0"
import scodec.bits.ByteVector
import octalmind.mqtt.MykioCodec
val message = hex"32080001740001020202"
val result = MQTTCodec.decode(message.toBitVector)
//result: scodec.Attempt[scodec.DecodeResult[octalmind.mqtt.Frame]] = Successful(DecodeResult(Frame(Header(3,false,QOS1,false),Publish(t,Some(1),ByteVector(3 bytes, 0x020202))),BitVector(empty)))
- Use semantic versioning
- Update scala version and cross compiled version to scala 2.11.6
- First release that implement the complete protocol.
Feel free to use the github issue to submit bugs and features request.