Wiki Home >> FujiNet-Commands-Reference

FujiNet-Commands-Reference


FujiNet Commands Reference

A comprehensive reference guide for FujiNet commands based on the official fuji_commands.py source file from the FujiNet test suite.

Source: fujinet-tests/unitrix/fuji_commands.py


Table of Contents

  1. Overview
  2. Command Quick Reference
  3. WiFi Management Commands
  4. Host Slot Commands
  5. Device Slot Commands
  6. Directory Commands
  7. Disk Image Commands
  8. App Key Commands
  9. Base64 Encoding/Decoding Commands
  10. Hash Commands
  11. QR Code Commands
  12. Device Control Commands
  13. Clock Commands
  14. Low-Level I/O Commands
  15. System Commands
  16. Argument Type Reference

Overview

FujiNet uses a command-based protocol to communicate between the host computer and the FujiNet device. Commands are identified by a single byte command code and may include arguments and/or return reply data.

Argument Types

TypeDescription
i88-bit signed integer
i1616-bit signed integer
u88-bit unsigned integer
u1616-bit unsigned integer
u3232-bit unsigned integer
bBoolean
sVariable length string/bytes
s7Variable length string with 7-bit length prefix
s8Variable length string with 8-bit length prefix
s16Variable length string with 16-bit length prefix
fNNNFixed length string/bytes, padded to NNN bytes

Command Quick Reference

CodeNameCategory
0xFFRESETSystem
0xFEGET_SSIDWiFi
0xFDSCAN_NETWORKSWiFi
0xFCGET_SCAN_RESULTWiFi
0xFBSET_SSIDWiFi
0xFAGET_WIFISTATUSWiFi
0xF9MOUNT_HOSTHost Slots
0xF8MOUNT_IMAGEDevice Slots
0xF7OPEN_DIRECTORYDirectory
0xF6READ_DIR_ENTRYDirectory
0xF5CLOSE_DIRECTORYDirectory
0xF4READ_HOST_SLOTSHost Slots
0xF3WRITE_HOST_SLOTSHost Slots
0xF2READ_DEVICE_SLOTSDevice Slots
0xF1WRITE_DEVICE_SLOTSDevice Slots
0xF0ENABLE_UDPSTREAMDevice Control
0xEBSET_BAUDRATEDevice Control
0xEAGET_WIFI_ENABLEDWiFi
0xE9UNMOUNT_IMAGEDevice Slots
0xE8GET_ADAPTERCONFIGSystem
0xE7NEW_DISKDisk Image
0xE6UNMOUNT_HOSTHost Slots
0xE5GET_DIRECTORY_POSITIONDirectory
0xE4SET_DIRECTORY_POSITIONDirectory
0xE3SET_HSIO_INDEXDevice Control
0xE2SET_DEVICE_FULLPATHDevice Slots
0xE1SET_HOST_PREFIXHost Slots
0xE0GET_HOST_PREFIXHost Slots
0xDFSET_SIO_EXTERNAL_CLOCKDevice Control
0xDEWRITE_APPKEYApp Key
0xDDREAD_APPKEYApp Key
0xDCOPEN_APPKEYApp Key
0xDBCLOSE_APPKEYApp Key
0xDAGET_DEVICE_FULLPATHDevice Slots
0xD9CONFIG_BOOTDevice Control
0xD8COPY_FILEDisk Image
0xD7MOUNT_ALLDevice Slots
0xD6SET_BOOT_MODEDevice Control
0xD5ENABLE_DEVICEDevice Control
0xD4DISABLE_DEVICEDevice Control
0xD3RANDOM_NUMBERSystem
0xD1DEVICE_ENABLE_STATUSDevice Control
0xD0BASE64_ENCODE_INPUTBase64
0xCFBASE64_ENCODE_COMPUTEBase64
0xCEBASE64_ENCODE_LENGTHBase64
0xCDBASE64_ENCODE_OUTPUTBase64
0xCCBASE64_DECODE_INPUTBase64
0xCBBASE64_DECODE_COMPUTEBase64
0xCABASE64_DECODE_LENGTHBase64
0xC9BASE64_DECODE_OUTPUTBase64
0xC8HASH_INPUTHash
0xC7HASH_COMPUTEHash
0xC6HASH_LENGTHHash
0xC5HASH_OUTPUTHash
0xC4GET_ADAPTERCONFIG_EXTENDEDSystem
0xC3HASH_COMPUTE_NO_CLEARHash
0xC2HASH_CLEARHash
0xC1GET_HEAPSystem
0xBFQRCODE_OUTPUTQR Code
0xBEQRCODE_LENGTHQR Code
0xBDQRCODE_ENCODEQR Code
0xBCQRCODE_INPUTQR Code
0xA7GET_DEVICE8_FULLPATHDevice Slots
0xA6GET_DEVICE7_FULLPATHDevice Slots
0xA5GET_DEVICE6_FULLPATHDevice Slots
0xA4GET_DEVICE5_FULLPATHDevice Slots
0xA3GET_DEVICE4_FULLPATHDevice Slots
0xA2GET_DEVICE3_FULLPATHDevice Slots
0xA1GET_DEVICE2_FULLPATHDevice Slots
0xA0GET_DEVICE1_FULLPATHDevice Slots
0x57WRITELow-Level I/O
0x53STATUSLow-Level I/O
0x52READLow-Level I/O
0x4FOPENLow-Level I/O
0x43CLOSELow-Level I/O
0x3FHSIO_INDEXDevice Control
0x02SEND_ERRORSystem
0x01SEND_RESPONSESystem
0x00DEVICE_READYSystem
0x53 ('S')GET_TIME_SOSClock
0x49 ('I')GET_TIME_ISOClock

WiFi Management Commands

0xFF - RESET

Resets the FujiNet device to its initial state.

PropertyValue
Command0xFF
ArgumentsNone
ReplyNone

0xFE - GET_SSID

Retrieves the currently configured WiFi SSID.

PropertyValue
Command0xFE
ArgumentsNone
Replydata:s8 - SSID string with 8-bit length prefix

0xFD - SCAN_NETWORKS

Initiates a scan for available WiFi networks.

PropertyValue
Command0xFD
ArgumentsNone
Replycount:u8 - Number of networks found

0xFC - GET_SCAN_RESULT

Retrieves information about a discovered WiFi network.

PropertyValue
Command0xFC
Argumentsindex:u8 - Network index (0-based)
Replydata:s8 - Network information with 8-bit length prefix

0xFB - SET_SSID

Sets the WiFi SSID and password for connection.

PropertyValue
Command0xFB
ArgumentsImplementation-specific (SSID + password structure)
ReplyNone

0xFA - GET_WIFISTATUS

Returns the current WiFi connection status.

PropertyValue
Command0xFA
ArgumentsNone
Replystatus:u8 - WiFi status code

Status Codes:
| Value | Status |
|-------|--------|
| 0 | Idle |
| 1 | No SSID available |
| 2 | Scan complete |
| 3 | Connected |
| 4 | Connect failed |
| 5 | Connection lost |
| 6 | Disconnected |


0xEA - GET_WIFI_ENABLED

Checks if WiFi is enabled.

PropertyValue
Command0xEA
ArgumentsNone
Replydata:s8 - WiFi enabled status

Host Slot Commands

FujiNet supports 8 host slots (0-7) for connecting to TNFS servers or other network hosts.

0xF4 - READ_HOST_SLOTS

Reads all eight host slot configurations.

PropertyValue
Command0xF4
ArgumentsNone
Replydata:f256 - 256 bytes containing 8 host slots (32 bytes each)

Data Structure: 8 × 32-byte null-terminated hostname strings.


0xF3 - WRITE_HOST_SLOTS

Writes all eight host slot configurations.

PropertyValue
Command0xF3
Argumentsconfig:f256 - 256 bytes containing 8 host slots
ReplyNone

0xF9 - MOUNT_HOST

Mounts (connects to) a host from the specified slot.

PropertyValue
Command0xF9
Argumentshost_slot:u8 - Host slot number (0-7)
ReplyNone

0xE6 - UNMOUNT_HOST

Unmounts (disconnects from) a host.

PropertyValue
Command0xE6
Argumentshost_slot:u8 - Host slot number (0-7)
ReplyNone

0xE1 - SET_HOST_PREFIX

Sets the current working directory prefix for a host.

PropertyValue
Command0xE1
Argumentshost_slot:u8 - Host slot number (0-7)
prefix:f256 - 256-byte path string
ReplyNone

0xE0 - GET_HOST_PREFIX

Gets the current working directory prefix for a host.

PropertyValue
Command0xE0
Argumentshost_slot:u8 - Host slot number (0-7)
Replyprefix:f256 - 256-byte path string

Device Slot Commands

FujiNet supports 8 device slots (0-7) for virtual disk drives.

0xF2 - READ_DEVICE_SLOTS

Reads all device slot configurations.

PropertyValue
Command0xF2
ArgumentsNone
Replydata:f304 - 304 bytes containing device slot configuration

0xF1 - WRITE_DEVICE_SLOTS

Writes all device slot configurations.

PropertyValue
Command0xF1
Argumentsconfig:f304 - 304 bytes containing device slot configuration
ReplyNone

0xF8 - MOUNT_IMAGE

Mounts a disk image to a device slot.

PropertyValue
Command0xF8
Argumentsdevice_slot:u8 - Device slot (0-7)
mode:u8 - Mount mode flags
ReplyNone

Mode Flags:

  • Bit 0: Read-only if set
  • Bit 1: Create if not exists

0xE9 - UNMOUNT_IMAGE

Unmounts a disk image from a device slot.

PropertyValue
Command0xE9
Argumentsdevice_slot:u8 - Device slot (0-7)
ReplyNone

0xD7 - MOUNT_ALL

Mounts all configured device slots.

PropertyValue
Command0xD7
ArgumentsNone
ReplyNone

0xE2 - SET_DEVICE_FULLPATH

Sets the full path (host, mode, and filename) for a device slot.

PropertyValue
Command0xE2
Argumentsdevice_slot:u8 - Device slot (0-7)
host_slot:u8 - Host slot (0-7)
mode:u8 - Mount mode
filename:f256 - 256-byte filename
ReplyNone

0xDA - GET_DEVICE_FULLPATH

Gets the full path for a device slot.

PropertyValue
Command0xDA
Argumentsdevice_slot:u8 - Device slot (0-7)
Replypath:f256 - 256-byte path string

0xA0-0xA7 - GET_DEVICE[1-8]_FULLPATH

Quick access commands to get full path for specific device slots.

CommandDevice SlotReply
0xA0Device 1path:f256
0xA1Device 2path:f256
0xA2Device 3path:f256
0xA3Device 4path:f256
0xA4Device 5path:f256
0xA5Device 6path:f256
0xA6Device 7path:f256
0xA7Device 8path:f256

Directory Commands

0xF7 - OPEN_DIRECTORY

Opens a directory for listing.

PropertyValue
Command0xF7
Argumentshost_slot:u8 - Host slot (0-7)
path:s8 - Path string with 8-bit length
ReplyNone

0xF6 - READ_DIR_ENTRY

Reads the next directory entry.

PropertyValue
Command0xF6
Argumentsmaxlen:u8 - Maximum entry length
addtl:u8 - Additional flags
Replyentry:s7 - Directory entry with 7-bit length prefix

0xF5 - CLOSE_DIRECTORY

Closes an open directory.

PropertyValue
Command0xF5
ArgumentsNone
ReplyNone

0xE5 - GET_DIRECTORY_POSITION

Gets the current position in the directory listing.

PropertyValue
Command0xE5
ArgumentsNone
Replyposition:u16 - Current position (16-bit)

0xE4 - SET_DIRECTORY_POSITION

Sets the current position in the directory listing.

PropertyValue
Command0xE4
Argumentsposition:u16 - Position to set (16-bit)
ReplyNone

Disk Image Commands

0xE7 - NEW_DISK

Creates a new disk image.

PropertyValue
Command0xE7
Argumentssize:u8 - Disk size code
host_slot:u8 - Host slot (0-7)
device_slot:u8 - Device slot (0-7)
filename:s8 - Filename with 8-bit length
ReplyNone

0xD8 - COPY_FILE

Copies a file between hosts.

PropertyValue
Command0xD8
Argumentssource_slot:u8 - Source host slot
dest_slot:u8 - Destination host slot
copy_spec:s8 - Copy specification with 8-bit length
ReplyNone

App Key Commands

App Keys provide persistent key-value storage for applications.

0xDC - OPEN_APPKEY

Opens an app key for reading or writing.

PropertyValue
Command0xDC
ArgumentsStructure: {creator:u16, app:u8, key:u8, mode:i8, reserved:u8}
ReplyNone

Structure Fields:

  • creator:u16 - Creator ID (16-bit, values 0x00-0xFF reserved for FujiNet)
  • app:u8 - Application ID (8-bit)
  • key:u8 - Key ID (8-bit)
  • mode:i8 - Mode: 0=read, 1=write
  • reserved:u8 - Reserved byte

0xDD - READ_APPKEY

Reads data from an open app key.

PropertyValue
Command0xDD
ArgumentsNone
Replydata:f66 - Up to 66 bytes of data (length varies by platform)

0xDE - WRITE_APPKEY

Writes data to an open app key.

PropertyValue
Command0xDE
Argumentsdata:s16 - Data with 16-bit length prefix
ReplyNone

0xDB - CLOSE_APPKEY

Closes an open app key.

PropertyValue
Command0xDB
ArgumentsNone
ReplyNone

Base64 Encoding/Decoding Commands

Encoding Flow

  1. 0xD0 - BASE64_ENCODE_INPUT - Send data to encode
  2. 0xCF - BASE64_ENCODE_COMPUTE - Perform encoding
  3. 0xCE - BASE64_ENCODE_LENGTH - Get output length
  4. 0xCD - BASE64_ENCODE_OUTPUT - Retrieve encoded data

0xD0 - BASE64_ENCODE_INPUT

Sends data to be Base64 encoded.

PropertyValue
Command0xD0
Argumentslength:u16 - Data length
data:s8 - Data with 8-bit length
ReplyNone

0xCF - BASE64_ENCODE_COMPUTE

Performs the Base64 encoding operation.

PropertyValue
Command0xCF
ArgumentsNone
ReplyNone

0xCE - BASE64_ENCODE_LENGTH

Gets the length of the encoded output.

PropertyValue
Command0xCE
ArgumentsNone
ReplyEncoded data length

0xCD - BASE64_ENCODE_OUTPUT

Retrieves the Base64 encoded data.

PropertyValue
Command0xCD
Argumentslength:u16 - Number of bytes to retrieve
ReplyEncoded data

Decoding Flow

  1. 0xCC - BASE64_DECODE_INPUT - Send encoded data
  2. 0xCB - BASE64_DECODE_COMPUTE - Perform decoding
  3. 0xCA - BASE64_DECODE_LENGTH - Get output length
  4. 0xC9 - BASE64_DECODE_OUTPUT - Retrieve decoded data

0xCC - BASE64_DECODE_INPUT

Sends Base64 encoded data to be decoded.

PropertyValue
Command0xCC
Argumentslength:u16 - Data length
data:s8 - Encoded data with 8-bit length
ReplyNone

0xCB - BASE64_DECODE_COMPUTE

Performs the Base64 decoding operation.

PropertyValue
Command0xCB
ArgumentsNone
ReplyNone

0xCA - BASE64_DECODE_LENGTH

Gets the length of the decoded output.

PropertyValue
Command0xCA
ArgumentsNone
ReplyDecoded data length

0xC9 - BASE64_DECODE_OUTPUT

Retrieves the decoded data.

PropertyValue
Command0xC9
Argumentslength:u16 - Number of bytes to retrieve
ReplyDecoded data

Hash Commands

Hash Computation Flow

  1. 0xC8 - HASH_INPUT - Send data to hash
  2. 0xC7 - HASH_COMPUTE - Compute hash with algorithm
  3. 0xC6 - HASH_LENGTH - Get hash output length
  4. 0xC5 - HASH_OUTPUT - Retrieve hash result

0xC8 - HASH_INPUT

Sends data to be hashed.

PropertyValue
Command0xC8
Argumentsdata:s16 - Data with 16-bit length prefix
ReplyNone

0xC7 - HASH_COMPUTE

Computes the hash using the specified algorithm.

PropertyValue
Command0xC7
Argumentsalgorithm:u8 - Hash algorithm ID
ReplyNone

Algorithm IDs:
| Value | Algorithm |
|-------|-----------|
| 0 | MD5 |
| 1 | SHA-1 |
| 2 | SHA-256 |
| 3 | SHA-512 |


0xC6 - HASH_LENGTH

Gets the length of the hash output.

PropertyValue
Command0xC6
Argumentsas_hex:b - If true, return length of hex string
ReplyHash length

0xC5 - HASH_OUTPUT

Retrieves the computed hash.

PropertyValue
Command0xC5
Argumentsas_hex:b - If true, return hash as hex string
ReplyHash data

0xC3 - HASH_COMPUTE_NO_CLEAR

Computes the hash without clearing the input buffer (allows incremental hashing).

PropertyValue
Command0xC3
ArgumentsNone
ReplyNone

0xC2 - HASH_CLEAR

Clears the hash input buffer.

PropertyValue
Command0xC2
ArgumentsNone
ReplyNone

QR Code Commands

QR Code Generation Flow

  1. 0xBC - QRCODE_INPUT - Send data to encode
  2. 0xBD - QRCODE_ENCODE - Generate QR code
  3. 0xBE - QRCODE_LENGTH - Get output length
  4. 0xBF - QRCODE_OUTPUT - Retrieve QR code data

0xBC - QRCODE_INPUT

Sends data to be encoded as a QR code.

PropertyValue
Command0xBC
Argumentslength:u16 - Data length
data:s8 - Data with 8-bit length
ReplyNone

0xBD - QRCODE_ENCODE

Generates the QR code with specified parameters.

PropertyValue
Command0xBD
Argumentsversion:u8 - QR version (1-40)
ecc_mode:u8 - Error correction level
shorten:u8 - URL shortening flag
ReplyNone

ECC Modes:
| Value | Level | Recovery |
|-------|-------|----------|
| 0 | L | ~7% |
| 1 | M | ~15% |
| 2 | Q | ~25% |
| 3 | H | ~30% |


0xBE - QRCODE_LENGTH

Gets the length of the QR code output.

PropertyValue
Command0xBE
ArgumentsNone
ReplyQR code data length

0xBF - QRCODE_OUTPUT

Retrieves the generated QR code data.

PropertyValue
Command0xBF
Argumentsmode:u8 - Output mode
ReplyQR code data

Device Control Commands

0xD5 - ENABLE_DEVICE

Enables a device.

PropertyValue
Command0xD5
Argumentsdevice:u8 - Device identifier
ReplyNone

0xD4 - DISABLE_DEVICE

Disables a device.

PropertyValue
Command0xD4
Argumentsdevice:u8 - Device identifier
ReplyNone

0xD1 - DEVICE_ENABLE_STATUS

Gets the enable/disable status of devices.

PropertyValue
Command0xD1
ArgumentsNone
ReplyDevice status bitmap

0xD6 - SET_BOOT_MODE

Sets the boot mode.

PropertyValue
Command0xD6
Argumentsmode:u8 - Boot mode value
ReplyNone

0xD9 - CONFIG_BOOT

Enables or disables automatic CONFIG boot.

PropertyValue
Command0xD9
Argumentsenable:u8 - 0=disable, 1=enable
ReplyNone

0xE3 - SET_HSIO_INDEX

Sets the High-Speed I/O index.

PropertyValue
Command0xE3
ArgumentsImplementation-specific
ReplyNone

0x3F - HSIO_INDEX

Gets or sets the High-Speed I/O index.

PropertyValue
Command0x3F
ArgumentsNone
ReplyNone

0xEB - SET_BAUDRATE

Sets the communication baud rate.

PropertyValue
Command0xEB
ArgumentsImplementation-specific
ReplyNone

0xDF - SET_SIO_EXTERNAL_CLOCK

Configures external SIO clock settings.

PropertyValue
Command0xDF
ArgumentsImplementation-specific
ReplyNone

0xF0 - ENABLE_UDPSTREAM

Enables UDP streaming mode (used for MIDIMaze, etc.).

PropertyValue
Command0xF0
ArgumentsImplementation-specific
ReplyNone

Clock Commands

0x53 ('S') - GET_TIME_SOS

Gets the current time in SOS format.

PropertyValue
Command0x53 ('S')
ArgumentsNone
ReplyTime in SOS format

0x49 ('I') - GET_TIME_ISO

Gets the current time in ISO format.

PropertyValue
Command0x49 ('I')
ArgumentsNone
ReplyTime in ISO 8601 format

Low-Level I/O Commands

These commands provide basic I/O operations.

0x4F ('O') - OPEN

Opens a resource.

PropertyValue
Command0x4F ('O')
Argumentsmode:u8 - Open mode
data:s - Resource specification
ReplyNone

0x43 ('C') - CLOSE

Closes a resource.

PropertyValue
Command0x43 ('C')
ArgumentsNone
ReplyNone

0x52 ('R') - READ

Reads data from a resource.

PropertyValue
Command0x52 ('R')
Argumentshandle:u8 - Resource handle
ReplyData

0x57 ('W') - WRITE

Writes data to a resource.

PropertyValue
Command0x57 ('W')
Argumentshandle:u8 - Resource handle
data:s - Data to write
ReplyNone

0x53 ('S') - STATUS

Gets the status of a resource.

PropertyValue
Command0x53 ('S')
ArgumentsNone
Replystatus:u32 - 32-bit status value

System Commands

0xE8 - GET_ADAPTERCONFIG

Gets the network adapter configuration.

PropertyValue
Command0xE8
ArgumentsNone
Replydata:s8 - Configuration data with 8-bit length

0xC4 - GET_ADAPTERCONFIG_EXTENDED

Gets extended network adapter configuration.

PropertyValue
Command0xC4
ArgumentsNone
Replydata:s8 - Extended configuration data with 8-bit length

0xC1 - GET_HEAP

Gets heap memory information (for debugging).

PropertyValue
Command0xC1
ArgumentsNone
ReplyHeap information

0xD3 - RANDOM_NUMBER

Generates a random number.

PropertyValue
Command0xD3
ArgumentsNone
ReplyRandom number

0x00 - DEVICE_READY

Checks if the device is ready.

PropertyValue
Command0x00
ArgumentsNone
ReplyNone

0x01 - SEND_RESPONSE

Sends a response (internal).

PropertyValue
Command0x01
ArgumentsNone
ReplyNone

0x02 - SEND_ERROR

Sends an error (internal).

PropertyValue
Command0x02
ArgumentsNone
ReplyNone

Argument Type Reference

TypeSizeDescription
i81 byte8-bit signed integer (-128 to 127)
i162 bytes16-bit signed integer (-32768 to 32767)
u81 byte8-bit unsigned integer (0 to 255)
u162 bytes16-bit unsigned integer (0 to 65535)
u324 bytes32-bit unsigned integer
b1 byteBoolean (0=false, non-zero=true)
svariableVariable length string/bytes
s7variableString with 7-bit length prefix
s8variableString with 8-bit length prefix
s16variableString with 16-bit length prefix
fNNNNNN bytesFixed-length string, zero-padded

References


This documentation was generated from the official FujiNet test suite source code.
Copyright 2024-2026 Contributors to the FujiNetWIFI project.


Wiki content is mirrored from the FujiNet Github Wiki