Showing changes from revision #4 to #5:
Added | Removed | Changed
The Acorn Terminal Interface Protocol (Acorn TIP) is used to communicate between a terminal emulator and a protocol module. It is possible to integrate your own terminal emulators and protocol modules with those provided by the TCP/IP Protocol Suite.
The purpose of a Protocol Module is to convert one of the many different protocols computers use for input and output to the Acorn TIP.
It is strongly advised that before developing a Protocol Module, you should first familiarise yourself with how a RISC OS relocatable module works. Your protocol module must conform to the standards specified.
Your Protocol Module must support all service calls detailed.
Your Protocol Module must support various SWIs, and they vary based on the functionality it will provide. These must be at the defined offsets from your module’s SWI base number, which is allocated by RISC OS Open. To support many of these SWIs you will need to send suitable commands over the physical connection to the remote host.
Offset | SWI name | Supports sending of data | Supports sending of data & file transfer | Supports receipt of data | Supports receipt of data & file transfer | Optional |
---|---|---|---|---|---|---|
0 | Protocol_OpenLogicalLink? | ✔ | ✔ | ✔ | ✔ | - |
1 | Protocol_CloseLogicalLink? | ✔ | ✔ | ✔ | ✔ | - |
2 | Protocol_GetProtocolMenu? | ✔ | ✔ | ✔ | ✔ | - |
3 | Protocol_OpenConnection? | ✔ | ✔ | ✔ | ✔ | - |
4 | Protocol_CloseConnection? | ✔ | ✔ | ✔ | ✔ | - |
5 | Protocol_TransmitData? | ✔ | ✔ | - | - | - |
6 | Protocol_DataRequest? | - | - | ✔ | ✔ | - |
7 | Protocol_MenuItemSelected? | ✔ | ✔ | ✔ | ✔ | - |
8 | Protocol_UnknownEvent? | ✔ | ✔ | ✔ | ✔ | - |
9 | Protocol_GetLinkState? | ✔ | ✔ | ✔ | ✔ | - |
10 | Protocol_Break? | ✔ | ✔ | ✔ | ✔ | - |
11 | Protocol_SendFile? | - | ✔ | - | - | - |
12 | Protocol_SendFileData? | - | ✔ | - | - | - |
13 | Protocol_AbortTransfer? | - | ✔ | - | ✔ | - |
14 | Protocol_GetFileInfo? | - | - | - | ✔ | - |
15 | Protocol_GetFileData? | - | - | - | ✔ | - |
17 | Protocol_GetFile? | - | - | - | ✔ | - |
18 | Protocol_DirOp? | - | - | - | ✔ |
Your protocol module must keep two different types of data structure constantly updated, as terminal emulators may directly access these any time they need to. These are:
Offset | Contents |
---|---|
0 | Pointer to protocol name string |
4 | Pointer to protocol version string |
8 | Pointer to protocol copyright string |
12 | Maximum number of connections allowed by module |
16 | Current number of open connections |
The three strings are all null-terminated, and have a maximum length of 30 characters. More information is available on Protocol_OpenLogicalLink? (Offset 0).
Bit | Meaning when set |
---|---|
0 | Data is pending |
1 | File is pending |
2 | Paused operation is to continue |
For more infomation, please see Protocol_OpenConnection?.
All protocol modules must (if physically possible) support multiple logical links, and multiple connections.
There are various functions that your Terminal Emulator will need to support. This section details which SWI calls you need to use for many such functions, and outlines how to use them.
To find what protocols are available and compatible with the needs of your emulator, you must:
For your user to choose a protocol, you’ll probably want to give them a menu of the ones you found to be available. Once they’ve made the choice, you can then issue Service_ProtocolNameToNumber to find the base SWI number of their chosen protocol module. You can then use this base number to call Protocol_OpenLogicalLink?, since its offset from the base number you just found is zero.
You can also use the facilities outlined in the section below entitled Protocol Modules and the Wimp to provide menus so that your user can set up the way the protocol and connection will work.
When a connection is established/opened, you set the address of a poll word. The protocol module sets bits in this word when it needs attention. It’s vital that your emulator regularly examines this word so that the protocol module gets adequate service.
Note: It is good practice to check the poll word each time a null event from Wimp_Poll is received.
Sending data is achieved by Calling Protocol_TransmitData?
When the protocol module receives data over a connection, it will notify your emulator by setting a bit in the poll word. To get the data forwarded to your emulator, call Protocol_DataRequest?.
When the protocol module receives a file over a connection, it will notify your emulator
by setting a bit in the poll word.
Note: To explicitly get a file, call Protocol_GetFile?
There are no SWIs specified in the Acorn TIP to send, receive or get entire directories in one call. Instead, a single SWI call, Protocol_DirOp? is provided. This call allows you to create a directory, move into a directory, and move one level up a directory tree.
Combining this SWI with the ones outlined above allows you to move around a remote file system, creating directories, and sending and getting files at will (subject, to access rights).
Several calls are provided which help interaction between the Wimp and protocol menus. These are necessary because the ‘pick and mix’ nature of protocol modules and terminal emulators means you’ll have to combine menus from each; and because protocol modules are not foreground tasks, and so don’t receive notice of menu selections and Wimp events.