Liking cljdoc? Tell your friends :D

mqtt.encoder


encode-fixed-headerclj

(encode-fixed-header packet out)

encode-remaining-lengthclj

(encode-remaining-length packet out)
(encode-remaining-length packet out x)

Encode MQTT's funky multi-byte remaining-length field. It needs to use the algorithm from the MQTT 3.1 Spec: http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html

do digit = X MOD 128 X = X DIV 128 // if there are more digits to encode, set the top bit of this digit if ( X > 0 ) digit = digit OR 0x80 endif 'output' digit while ( X> 0 )

Encode MQTT's funky multi-byte remaining-length field. It needs to use the
algorithm from the MQTT 3.1 Spec:
http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html

do
  digit = X MOD 128
  X = X DIV 128
  // if there are more digits to encode, set the top bit of this digit
  if ( X > 0 )
    digit = digit OR 0x80
  endif
  'output' digit
while ( X> 0 )
raw docstring

make-encoderclj

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

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

× close