Liking cljdoc? Tell your friends :D

mqtt.decoder


decode-fixed-headerclj

(decode-fixed-header in)
(decode-fixed-header packet in)

Decode the first byte of a packet. Checks that message-type is not nil.

Decode the first byte of a packet. Checks that message-type is not nil.
raw docstring

make-decoderclj

(make-decoder & {:keys [error-fn] :or {error-fn identity}})

parse-remaining-lengthclj

(parse-remaining-length in)
(parse-remaining-length in multiplier value)

Decode the remaining length field of a packet. This can be more than one byte long. Algorithm from the MQTT 3.1 Spec: http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html under the 'Remaining Length' section.

multiplier = 1 value = 0 do digit = 'next digit from stream' value += (digit AND 127) * multiplier multiplier *= 128 while ((digit AND 128) != 0)

Decode the remaining length field of a packet. This can be more than one
byte long. Algorithm from the MQTT 3.1 Spec:
http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html
under the 'Remaining Length' section.

multiplier = 1
value = 0
do
  digit = 'next digit from stream'
  value += (digit AND 127) * multiplier
  multiplier *= 128
while ((digit AND 128) != 0)
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close