home *** CD-ROM | disk | FTP | other *** search
- TABLE OF CONTENTS
-
- pronet.device/--Overview--
- pronet.device/CloseDevice
- pronet.device/CMD_WRITE
- pronet.device/OpenDevice
- pronet.device/ReceivedData
- pronet.device/--Overview-- pronet.device/--Overview--
-
- >> GENERAL INFORMATION <<
-
- The device is able to handle several Units, which are defined in the
- `devs:pronet/.config' file. Each Unit corresponds to a certain driver
- and interface. The Units are subdivided into Ports, which are channels
- between two sides of one Unit. This way two application systems may work
- through the same connection without interfering each other.
-
- pronet.device is *not* a SANA-II compliant networking device, and it is not
- compatible to any other exec device, because it's got some very strange
- behaviour regarding incoming data. Sometimes it is useful, sometimes it is
- not, but I will not change this anyway: CMD_READ is not supported, instead
- of that, when opening the device, you specify a MsgPort to which all
- incoming data will be sent automatically, if you want it or not!
-
- pronet.device v37 is incompatible to ProNET applications written
- earlier, see below. I'm sorry for that, but I've not heard from people
- using this device anyway ;-)
-
- >> ERROR CODES <<
-
- pronet.device v37 can return one of the following error codes after
- OpenDevice():
-
- PNDERR_PORTEXISTS
- You've tried to open up a Port which is already in use.
-
- PNDERR_DRIVERTROUBLE
- The driver of the Unit you requested can not be started.
- You can request a more detailed error message by setting the
- according bit in OpenDevice()/Flags. pnr_Data must then point to
- a buffer provided by you. The string will not exceed 63 characters
- plus the terminating zero. If no error occurs, the buffer will
- not be changed!
-
- PNDERR_UNIT_NOT_DEFINED
- The Unit you requested is missing a definition in the config file.
-
- >> CHANGES SINCE V3 <<
-
- v37: Write doesn't support two chunks anymore, Write can fail
- with PNDERR_DESTINATION_GONE now, no more #?ConfigString() in order
- to keep the configuration file tidy. Structure of received data
- has changed. PNB_ERRORSTRING.
-
- >> WRITING DRIVERS <<
-
- You find information on this subject in the other autodoc file supplied
- with the ProNET distribution.
-
- pronet.device/CloseDevice pronet.device/CloseDevice
-
- NAME
- CloseDevice -- Close a port of a certain ProNET Unit.
-
- SYNOPSIS
- CloseDevice(PNRequest);
- A1
-
- FUNCTION
- This is an exec.library call.
-
- This function terminates access to the corresponding ProNET Unit.
- Since the Unit is not shut down automatically, even if you were
- the last user of it, a RemDevice() would be the right thing to
- do after closing pronet.device.
-
- INPUTS
- PNRequest - A pointer to a previously opened ProNET IO Request.
-
- EXAMPLE
- This code can force a specified device to try and expunge.
- Of course, if the device is in use nothing will happen:
-
- void FlushDevice(name)
- char *name;
- {
- struct Device *result;
-
- Forbid();
- if(result=(struct Device *)FindName(&SysBase->DeviceList,name))
- RemDevice(result);
- Permit();
- }
-
- SEE ALSO
- exec.library/CloseDevice(), exec.library/RemDevice()
-
- pronet.device/CMD_WRITE pronet.device/CMD_WRITE
-
- NAME
- Write -- send output to ProNET Port.
-
- FUNCTION
- This command causes a packet of data to be written out the ProNET
- Port/Unit. The number of characters is specified in pnr_Length.
-
- IO REQUEST
- io_Command - CMD_WRITE
- pnr_Data - pointer to block of data to transmit
- pnr_Length - number of characters to transmit. MUST BE EVEN AND MUST
- NOT BE GREATER THAN 0x4000!
-
- RESULTS
- io_Error - if the Write succeeded, then io_Error will be zero.
- The only other possible error code is PNDERR_DESTINATION_GONE.
-
- pronet.device/OpenDevice pronet.device/OpenDevice
-
- NAME
- OpenDevice -- Open up a new port of a certain ProNET Unit.
-
- SYNOPSIS
- error = OpenDevice("pronet.device", unit, ioRequest, flags);
- D0 A0 D0 A1 D1
-
- BYTE OpenDevice(STRPTR, ULONG, struct PNRequest*, ULONG);
-
- FUNCTION
- This is an exec.library call.
-
- Hey, what do you think it does?!??
-
- INPUTS
- unit - This number must be defined in the `DEVS:ProNET/.config' file,
- otherwise OpenDevice() will return PNDERR_UNIT_NOT_DEFINED.
- ioRequest - A pointer to an initialized (see below) PNRequest block.
- flags - As described in the overview page, you have the option
- to get extensive error messages when setting a bit here.
- The bit is defined as PNB_ERRORSTRING (the PNF_ definition also
- exists).
-
- Two components of the PNRequest must be initialized before calling
- OpenDevice():
-
- pnr_MsgPort - pointer to a MsgPort where incoming data is sent to.
- pnr_NetSourcePort - The port number you want to open.
-
- RESULT
- error - zero if everything went o.k., otherwise an error code
- as defined in exec/errors.h or devices/pronet.h.
-
- NOTES
- The *one and only* valid port numbers are 0x0001 to 0x7fff. If you
- want a special number above 0x7fff reserved for your application,
- please contact me!
-
- If you don't have any special preferences for your port number,
- you can use PNP_NEXTFREE to let pronet.device assign you the next
- free one (it will be put into pnr_NetSourcePort then).
-
- pronet.device/ReceivedData pronet.device/ReceivedData
-
- Received data will be sent to the MsgPort you specified in pnr_MsgPort
- when opening the device. You can not change it after opening.
- mn_Length, as opposed to pre-v37, contains the length of the whole Message
- structure. The first word of mn_Node.ln_Name contains the source ProNET
- Port, the second word contains the destination port. The data comes behind
- the Message structure.
-
- This Message must be replied as soon as there is no use for it any more.
-
- If there is incoming data but pronet.device can't allocate the Message
- structure, the packet is lost!
-
-