mqtt-hs-1.0.0: A MQTT client library.

CopyrightLukas Braun 2014
LicenseGPL-3
Maintainerkoomi+mqtt@hackerspace-bamberg.de
Safe HaskellNone
LanguageHaskell2010

Network.MQTT.Encoding

Contents

Description

Binary encoding for MQTT messages.

Synopsis

Documentation

writeTo :: Handle -> Message t -> IO () Source #

Directly write a Message to the buffer of a Handle.

putMessage :: Message t -> Builder Source #

Generate a Builder for any Message.

Fixed Header

putMqttHeader :: MqttHeader -> Word8 -> Builder Source #

Build a MqttHeader for the given message type.

encodeRemaining :: Int64 -> Builder Source #

Encode the remaining length field.

Body

putBody :: MessageBody t -> Builder Source #

Build the MessageBody for any message type.

Utility functions

putMqttText :: MqttText -> Builder Source #

Build a length-prefixed MqttText.

fromQoS :: Num a => QoS -> a Source #

Encode a QoS.

toBit :: Num a => Bool -> a Source #

Convert a Bool to 0 or 1.

msgType :: Num a => MessageBody t -> a Source #

Encode the type of a MessageBody.