[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [OASIS Issue Tracker] (MQTT-540) Messages shorter than 256 octets may use the 1-octet format
[ https://issues.oasis-open.org/browse/MQTT-540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=76789#comment-76789 ] Ian Craggs commented on MQTT-540: --------------------------------- It looks to me as though the description is technically correct. The wording could be clearer though, perhaps "messages of length 255 octets or smaller". > Messages shorter than 256 octets may use the 1-octet format > ----------------------------------------------------------- > > Key: MQTT-540 > URL: https://issues.oasis-open.org/browse/MQTT-540 > Project: OASIS Message Queuing Telemetry Transport (MQTT) TC > Issue Type: Improvement > Components: MQTT-SN > Affects Versions: MQTT-SN-1.2 > Reporter: Ian Craggs > Priority: Minor > > 5.2.1 Length > Via Tomoaki Yamaguchi. > The Length field is either 1- or 3-octet long and specifies the total number of octets contained in the message (including the Length field itself). > If the first octet of the Length field is coded â0x01â then the Length field is 3-octet long; in this case, the two following octets specify the total number of octets of the message (most-significant octet first). Otherwise, the Length field is only 1-octet long and specifies itself the total number of octets contained in the message. > The 3-octet format allows the encoding of message lengths up to 65535 octets. Messages with lengths smaller than 256 octets may use the shorter 1-octet format. 5.2.1 Length > The Length field is either 1- or 3-octet long and specifies the total number of octets contained in the message (including the Length field itself). > If the first octet of the Length field is coded â0x01â then the Length field is 3-octet long; in this case, the two following octets specify the total number of octets of the message (most-significant octet first). Otherwise, the Length field is only 1-octet long and specifies itself the total number of octets contained in the message. > The 3-octet format allows the encoding of message lengths up to 65535 octets. Messages with lengths smaller than *256* octets may use the shorter 1-octet format. _*256 should be changed to 255.*_  Â255 + 1 = 256 but the hex value of 256 is 2 octet.  254 + 1 = 255 = 0xff.  Â255 + 3 = 258 = 0x0102 >  -- This message was sent by Atlassian Jira (v8.3.3#803004)
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]