OC-Minitel/Embedded/microtel
Izaya 73694b480f improved the minifier significantly, added miniprompt, and fixed some bugs in microtel 2018-05-19 13:37:37 +10:00
..
README.md documented socket objects 2018-03-30 14:21:59 +11:00
microtel-3.lua hopefully fixed routing in microtel-3, and made it smaller while I was at it 2018-03-30 22:22:57 +11:00
microtel-3.lua.min improved the minifier significantly, added miniprompt, and fixed some bugs in microtel 2018-05-19 13:37:37 +10:00
microtel-3.lua.min-old improved the minifier significantly, added miniprompt, and fixed some bugs in microtel 2018-05-19 13:37:37 +10:00
microtel-4.lua moved microtel into its own dir 2018-03-30 00:42:02 +11:00
microtel-4.lua.min added .min files for microtel 2018-05-17 16:32:11 +10:00
microtel-5-core.lua improved the minifier significantly, added miniprompt, and fixed some bugs in microtel 2018-05-19 13:37:37 +10:00
microtel-5-core.lua.min improved the minifier significantly, added miniprompt, and fixed some bugs in microtel 2018-05-19 13:37:37 +10:00
microtel-5-flisten.lua moved microtel into its own dir 2018-03-30 00:42:02 +11:00
microtel-5-flisten.lua.min added .min files for microtel 2018-05-17 16:32:11 +10:00
microtel-5-listen.lua moved microtel into its own dir 2018-03-30 00:42:02 +11:00
microtel-5-listen.lua.min added .min files for microtel 2018-05-17 16:32:11 +10:00
microtel-5-open.lua improved the minifier significantly, added miniprompt, and fixed some bugs in microtel 2018-05-19 13:37:37 +10:00
microtel-5-open.lua.min added .min files for microtel 2018-05-17 16:32:11 +10:00
minify.sh added .min files for microtel 2018-05-17 16:32:11 +10:00
old-microtel-3.lua moved microtel into its own dir 2018-03-30 00:42:02 +11:00
strip.lua moved microtel into its own dir 2018-03-30 00:42:02 +11:00

README.md

Microtel

Minitel for embedded devices.

API

microtel-3

net.send(dest,vport,data,packetType,packetID)

Sends a packet to dest on vport, containing data, optionally with packet type and ID as specified in packetType and packetID (defaults to 1 and randomly generated)

microtel-4

net.lsend(dest,vport,data)

Sends an arbitrary length of data, reliably and in order, to dest on port.

microtel-5-core

net.socket(address,port,sclose)

Creates a socket object connected to address on port, with the close message as sclose. Shouldn't be used by programs.

microtel-5-open

net.open(address,port)

Tries to connect a socket to address on port.

microtel-5-listen

net.listen(port)

Listens for socket connections on port, in a blocking manner, and returns a socket object on success.

microtel-5-flisten

net.flisten(port,handler)

Adds a hook to run a handler function when a client tries to initiate a socket connection on port, giving the handler a socket object.

Socket objects

Sockets have a few simple functions, which are the same as the normal Minitel version, despite using different names for functions.

socket:r(length)

Reads length bytes from the socket.

socket:w(data)

Writes data to the socket, sending it to the other machine.

socket:c()

Closes the socket, and sends the close signal to the other machine.

Configuration

microtel-3

net.port

Setting net.port changes which physical network port the Microtel stack listens on. If changed after initial loading of Microtel, you'll need to open the ports on the modems yourself. Defaults to 4096.

net.hostname

The name of this minitel node. Defaults to the first 8 characters of the computer address, so, for example, 15744e80.

net.route

Boolean controlling whether to forward packets.

net.hook

Table containing functions to run on receiving an event.

microtel-4

net.mtu

This controls the maximum size of the data portion of packets for net.lsend. Defaults to 4096, half the default physical MTU.

microtel-5-open

net.timeout

The maximum time the machine will wait to initialize a connection. Defaults to 60. Not actually functional right now.