WIMP messages are broadcast by MTerm or broadcast to MTerm. This document describes the interface.
MTerm WIMP message interface
(revision 1)
(doc: r1 24-09-97)
WIMPmsgs
MTerm responds to the BudgieSoft Wimp_Message (&16F00).
Codes allocated to MTerm are 100 to 119. Other codes are for BBS door messages, CastAVote etc etc.
Details assume a data block called wimp%. Message formats and control information range from wimp%!0 to wimp%!16. wimp%!20 is always the required code, and the data for that code begins at wimp%!24.
Message block is NOT cleared to nulls when updated, so don't rely upon anything not documented.
When it says "Returns: Doesn't", you will get back your own message if you broadcast it. MTerm does not claim messages, it only reads them and, if necessary, replies.
Code Explanation
100 Request status
~~~~~~~~~~~~~~
Just returns some information on MTerm.
Entry : Nothing.
Returns: wimp%?24 - 1 if carrier detected else 0.
wimp%?25 - 1 if carrierdet enabled, else 0.
wimp%?26 - 0 if NOT local input, else file
handle of local input file.
$(wimp%+28) - Blockdriver name, zero terminated.
wimp%!40 - DTE rate.
wimp%?44 - Port.
101 Redraw screen
~~~~~~~~~~~~~
Forces a redraw/reload of the MTerm screen.
Entry : $(wimp%+24) - Path for sprite to load in as
new screen.
If redraw ONLY required, set wimp%?24 to 0.
Returns: Doesn't.
102 Export screen
~~~~~~~~~~~~~
Gets MTerm to export the current screen for you to
process.
Note: Contents may change between export and reload.
Entry : wimp%!24 - 0.
$(wimp%+28) - Path to save sprite as.
Returns: wimp%!24 - &45464153.
$(wimp%+28) - Path, as on entry.
Returns with "SAFE" in the first word so
that you know your requested sprite is ready.
103 Send bytes
~~~~~~~~~~
Send a number of bytes to the serial port.
Entry : wimp%!24 - Number of bytes contained.
wimp%?28++ - Bytes to send.
Returns: Doesn't.
This could be used to implement an autodialler/login, by
sending the appropriate strings to the serial port.
As it does not return, you will need to periodically
check the carrier detect status, or await a carrier
detect message.
Example ArcTic BBS logon attachment:
1. Ensure off-line, else complain.
2. Send "ATZ" and wait a few seconds.
3. Send "ATS2=43DT14101819031309".
4. Loop checking carrier detect for thirty seconds. If
not carrier detect by then, drop carrier and "ATZ".
Finish with message. Otherwise...
5. Send two ESCs and wait ten seconds.
6. Send username, wait a second.
7. Send password, then end.
:-)
104 Drop carrier
~~~~~~~~~~~~
Forces a carrier drop using the configured method.
MTerm also broadcasts status messages for 'helper tasks' to
pick up on. You must NOT claim any message. Just read and
pass on.
110 Fetched resource
~~~~~~~~~~~~~~~~
Sent when an MTerm resource fetch has been completed.
MTerm usually places resources into the directory
"Transients.Incoming", and looks for output in
"Transients" (then "Transients.Incoming" if not found).
Data : wimp%!24 - Filetype of resource.
wimp%!28 - Filesize of resource (0 if Xmodem).
wimp%?32 - Reserved.
$(wimp%+36) - Path/fileid of resource.
111 Carrier detected
~~~~~~~~~~~~~~~~
Sent when carrier is detected.
Data : $(wimp%+24) - Name of BBS, if known.
112 Carrier lost
~~~~~~~~~~~~
Sent when carrier is lost.
113 System integrity violation
~~~~~~~~~~~~~~~~~~~~~~~~~~
Undocumented.
114 External task call
~~~~~~~~~~~~~~~~~~
Sent when an external task is called.
Data : $(wimp%+24) - Parameters to "SYS_ENQ" command.
You cannot currently stop an external task from loading.
However the protocol now defines that tasks must look for
the system variable "MTerm$SysEnq$Disable", and if "Yes"
then don't run. MTermRX sets this variable to "No", then
broadcasts this message.