unit fn_sio

SIO library for #FujiNet interface.

author: bocianu bocianu@gmail.com


Set of procedures to communicate with #FujiNet interface on SIO level. https://fujinet.online/
This library is a part of 'blibs' - set of custom Mad-Pascal libraries.
https://gitlab.com/bocianu/blibs

Types:

name:type:description:
FN_StatusStructrecord
  • dataSize: word;
  • connected: byte;
  • errorCode: byte;

end;
Structure used to store Status Command result

Interface:

name:description:
FN_Open

procedure FN_Open(var fn_uri:PChar);


Opens connection to remote host at selected port using declared protocol.
FN_WriteBuffer

procedure FN_WriteBuffer(buf: pointer; len: word);


Writes (sends) data from memory to network device.
    parameters:
  • buf - pointer to starting address of data
  • len - data length (in bytes)
FN_ReadBuffer

procedure FN_ReadBuffer(buf: pointer;len: word);


Reads (receives) data from network device.
    parameters:
  • buf - pointer of buffer to store the incoming data
  • len - data length (in bytes)
FN_ReadStatus

procedure FN_ReadStatus(status: pointer);


Reads network device status and stores information in provided memory location.
    parameters:
  • buf - pointer of buffer to store returned status information
FN_Close

procedure FN_Close;


Closes network connection.
    FN_Command

    procedure FN_Command(cmd, dstats, dbyt, aux1, aux2:byte; dbufa: word);


    Sends SIO command to #FN device
      parameters:
    • cmd - DCB.DCMND byte
    • dstats - DCB.STATS byte
    • dbyt - DCB.DBYT byte
    • aux1 - DCB.DAUX1 byte
    • aux2 - DCB.DAUX2 byte
    • dbufa - DCB.DBUFA word