Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SIO Commands for Devices $71-$78 (N: Network)

Devices $71 through $78 provide the N: network device interface. These eight device IDs allow up to eight simultaneous network connections. The N: device supports a variety of protocols (TCP, UDP, HTTP, TNFS, FTP, and others), with a common set of core commands and protocol-specific extensions.

Any command not listed below is considered a special command and is forwarded to the underlying protocol handler. Before issuing a special command, the caller should send command $FF to query whether the protocol supports it.

Core Commands

These commands are available regardless of which protocol is in use.

CommandDescription
'O' ($4F)Open - open a network connection using a devicespec URL
'C' ($43)Close - close the current network connection
'R' ($52)Read - read data from the network connection
'W' ($57)Write - write data to the network connection
'S' ($53)Status - get connection status (bytes waiting, connected, error)
'E' ($45)Error - retrieve the most recent error code
'T' ($54)Set translation - configure end-of-line translation mode
'Z' ($5A)Set PROCEED timer rate - configure the PROCEED interrupt interval

File and Directory Operations

These commands operate on protocols that support filesystem semantics (e.g., TNFS, FTP, SMB).

CommandDescription
$20Rename file
$21Delete file
$25Point - seek to a position in a file
$26Note - report the current position in a file
$2AMake directory
$2BRemove directory
$2CChange directory
$30Get current directory

JSON Operations

These commands provide built-in JSON parsing, allowing Atari programs to extract values from JSON responses without needing a local JSON parser.

CommandDescription
'P' ($50)Parse JSON - parse the received data as JSON
'Q' ($51)Query JSON - query a value using a JSONPath expression
$FBSet JSON parameters - configure JSON query behavior

Channel Configuration

CommandDescription
'H' ($48)Set hash type - select the hash algorithm for the connection
$FCSet channel mode - switch between protocol and JSON modes
$FDSet login - set the username for authenticated protocols
$FESet password - set the password for authenticated protocols

Protocol Query

CommandDescription
$FFQuery special command DSTATS - ask the protocol whether a given command is supported and what its data direction is

TCP-Specific Commands

These commands are available when the connection uses the TCP protocol.

CommandDescription
'A' ($41)Accept - accept an incoming connection on a listening socket
'c' ($63)Close client connection - close a specific accepted client connection

UDP-Specific Commands

These commands are available when the connection uses the UDP protocol.

CommandDescription
'D' ($44)Set UDP destination - set the remote address and port for outgoing datagrams

HTTP-Specific Commands

These commands are available when the connection uses the HTTP protocol.

CommandDescription
'M' ($4D)Set channel mode - configure HTTP-specific channel behavior (e.g., collect headers, set method)

See Also