LogoLogo
Thinger.io
  • IOTMP
    • Protocol
    • Message Structure
      • Message Header
      • Message Body
    • Messages
      • Ok
      • Error
      • Connect
      • Disconnect
      • Keep Alive
      • Run Resource
      • Describe Resources
      • Resource Streams
        • Start Stream
        • Stop Stream
        • Stream Data
    • Definitions
  • Thinger.io IOTMP
    • Features
      • REST API
      • Remote Desktop
      • Remote Proxies
      • Remote Webservices
      • Remote Terminal
      • Remote Filesystem
      • MQTT Interoperability
    • Implemenation
      • Messages
        • Connect
    • SDKs
      • Linux IOTMP
      • Arduino IOTMP
      • NodeJS IOTMP
      • Web IOTMP
      • Python SDK
Powered by GitBook
On this page
  • Data Types
  • Varint
  • Any
  • Stream
  • Stream Identifier
  • Resources
  • Field Identifier
  • Resource Parameters

Was this helpful?

Edit on GitHub
  1. IOTMP

Definitions

Data Types

Varint

To understand IOTMP, you first need to understand varints. Varints are a method of serializing integers using one or more bytes. Smaller numbers take a smaller number of bytes.

Each byte in a varint, except the last byte, has the most significant bit (msb) set – this indicates that there are further bytes to come. The lower 7 bits of each byte are used to store the two's complement representation of the number in groups of 7 bits, least significant group first.

So, for example, here is the number 1 – it's a single byte, so the msb is not set:

0000 0001

And here is 300 – this is a bit more complicated:

1010 1100 0000 0010

How do you figure out that this is 300? First you drop the msb from each byte, as this is just there to tell us whether we've reached the end of the number (as you can see, it's set in the first byte as there is more than one byte in the varint):

 1010 1100 0000 0010
→ 010 1100  000 0010

You reverse the two groups of 7 bits because, as you remember, varints store numbers with the least significant group first. Then you concatenate them to get your final value:

000 0010  010 1100
→  000 0010 ++ 010 1100
→  100101100
→  256 + 32 + 8 + 4 = 300

Any

Stream

A "stream" is an independent, bidirectional sequence of messages exchanged between the client and server within an IOTMP connection. Streams have several important characteristics:

  • A single IOTMP connection can contain multiple concurrently open streams, with either endpoint interleaving frames from multiple streams.

  • Streams can be established and used unilaterally or shared by either the client or server.

  • Streams can be closed by either endpoint, or closed automatically depending on the message type.

  • The order in which frames are sent on a stream is significant. Recipients process frames in the order they are received.

  • Streams are identified by an integer. Stream identifiers are assigned to streams by the endpoint initiating the stream.

Stream Identifier

Resources

Recurs

Field Identifier

Resource Parameters

Last updated 3 years ago

Was this helpful?

In a message field value, Any, means that it can store anything. It can be encoded with the default supported by IOTMP, or also encoded with the mechanism negotiated in the message.

wire-types
Connect