Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type
- MQTTByte = uint8
- proc MQTTByte(x: uint8): MQTTByte =
- result = MQTTByte()
- result.cont = x and 1 #Extract continue bit
- result.bit = x and uint8.high - 1 #Get data bits
- ...
- var varValue = 276
- varValue = (varValue / 128).uint8.MQTTByte #redefinition of 'MQTTByte';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement