Extension NetVar - jedimatt42/tipi GitHub Wiki

Network Variable Extension

Network distributed variables for use with myti99.com.

This is registered as 0x21 in RawExtensions.py

So messages beginning with byte 0x21 will be processes as Variable storage requests.

Usage

All request messages should be in the form of:

0x21 namespace 0x1e net-context 0x1e operation 0x1e queue-flag 0x1e [results_var] [ 0x1e key [ 0x1e value ] ]{1:6}

That is the 0x21, and a sequence of values seperated by the byte: 0x1e. Where results_var may be blank, and upto 6 key or key value pairs may be specified.

  • namespace: Think of it as the name of the cookie-jar to store the variables in. This is appended to a unix filename.
  • net-context: ??? I think this is a namespace for network variables on myti99.com. That is not open source, so I don't know. Only applies for operations 'U' and 'T' I think.
  • operation: one of 'R' "RS" 'W' 'U' 'T'
    • R : read a locally stored value from namespace (only first key may be specified)
    • RS : read where response message is just the value string (only first key may be specified)
    • W : write value to locally stored namespace (as many as 6 key value pairs may be specified in one message)
    • U : ??? transmit to variable server via udp
    • T : ??? transmit to variable server via tcp

By convention, the namespace "GLOBAL" is used to share values across multiple client programs such as the keys:

  • REMOTE_HOST : variable server hostname
  • REMOTE_PORT : variable server port number

As well as keys for user credentials to myti99.com... In practice, GLOBAL should be left to clients of myti99.com, as the other variables in that namespace are not documented.

When reading a variable with 'R' the response will be in the form:

'1' 0x1e value

or in the event of an error:

'0' 0x1e "ERROR"

If the variable is a queue, when reading, the head value will be popped off the queue and returned.