FujiNet Commands Reference - FujiNetWIFI/fujinet-firmware GitHub Wiki

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

Type Description
i8 8-bit signed integer
i16 16-bit signed integer
u8 8-bit unsigned integer
u16 16-bit unsigned integer
u32 32-bit unsigned integer
b Boolean
s Variable length string/bytes
s7 Variable length string with 7-bit length prefix
s8 Variable length string with 8-bit length prefix
s16 Variable length string with 16-bit length prefix
fNNN Fixed length string/bytes, padded to NNN bytes

Command Quick Reference

Code Name Category
0xFF RESET System
0xFE GET_SSID WiFi
0xFD SCAN_NETWORKS WiFi
0xFC GET_SCAN_RESULT WiFi
0xFB SET_SSID WiFi
0xFA GET_WIFISTATUS WiFi
0xF9 MOUNT_HOST Host Slots
0xF8 MOUNT_IMAGE Device Slots
0xF7 OPEN_DIRECTORY Directory
0xF6 READ_DIR_ENTRY Directory
0xF5 CLOSE_DIRECTORY Directory
0xF4 READ_HOST_SLOTS Host Slots
0xF3 WRITE_HOST_SLOTS Host Slots
0xF2 READ_DEVICE_SLOTS Device Slots
0xF1 WRITE_DEVICE_SLOTS Device Slots
0xF0 ENABLE_UDPSTREAM Device Control
0xEB SET_BAUDRATE Device Control
0xEA GET_WIFI_ENABLED WiFi
0xE9 UNMOUNT_IMAGE Device Slots
0xE8 GET_ADAPTERCONFIG System
0xE7 NEW_DISK Disk Image
0xE6 UNMOUNT_HOST Host Slots
0xE5 GET_DIRECTORY_POSITION Directory
0xE4 SET_DIRECTORY_POSITION Directory
0xE3 SET_HSIO_INDEX Device Control
0xE2 SET_DEVICE_FULLPATH Device Slots
0xE1 SET_HOST_PREFIX Host Slots
0xE0 GET_HOST_PREFIX Host Slots
0xDF SET_SIO_EXTERNAL_CLOCK Device Control
0xDE WRITE_APPKEY App Key
0xDD READ_APPKEY App Key
0xDC OPEN_APPKEY App Key
0xDB CLOSE_APPKEY App Key
0xDA GET_DEVICE_FULLPATH Device Slots
0xD9 CONFIG_BOOT Device Control
0xD8 COPY_FILE Disk Image
0xD7 MOUNT_ALL Device Slots
0xD6 SET_BOOT_MODE Device Control
0xD5 ENABLE_DEVICE Device Control
0xD4 DISABLE_DEVICE Device Control
0xD3 RANDOM_NUMBER System
0xD1 DEVICE_ENABLE_STATUS Device Control
0xD0 BASE64_ENCODE_INPUT Base64
0xCF BASE64_ENCODE_COMPUTE Base64
0xCE BASE64_ENCODE_LENGTH Base64
0xCD BASE64_ENCODE_OUTPUT Base64
0xCC BASE64_DECODE_INPUT Base64
0xCB BASE64_DECODE_COMPUTE Base64
0xCA BASE64_DECODE_LENGTH Base64
0xC9 BASE64_DECODE_OUTPUT Base64
0xC8 HASH_INPUT Hash
0xC7 HASH_COMPUTE Hash
0xC6 HASH_LENGTH Hash
0xC5 HASH_OUTPUT Hash
0xC4 GET_ADAPTERCONFIG_EXTENDED System
0xC3 HASH_COMPUTE_NO_CLEAR Hash
0xC2 HASH_CLEAR Hash
0xC1 GET_HEAP System
0xBF QRCODE_OUTPUT QR Code
0xBE QRCODE_LENGTH QR Code
0xBD QRCODE_ENCODE QR Code
0xBC QRCODE_INPUT QR Code
0xA7 GET_DEVICE8_FULLPATH Device Slots
0xA6 GET_DEVICE7_FULLPATH Device Slots
0xA5 GET_DEVICE6_FULLPATH Device Slots
0xA4 GET_DEVICE5_FULLPATH Device Slots
0xA3 GET_DEVICE4_FULLPATH Device Slots
0xA2 GET_DEVICE3_FULLPATH Device Slots
0xA1 GET_DEVICE2_FULLPATH Device Slots
0xA0 GET_DEVICE1_FULLPATH Device Slots
0x57 WRITE Low-Level I/O
0x53 STATUS Low-Level I/O
0x52 READ Low-Level I/O
0x4F OPEN Low-Level I/O
0x43 CLOSE Low-Level I/O
0x3F HSIO_INDEX Device Control
0x02 SEND_ERROR System
0x01 SEND_RESPONSE System
0x00 DEVICE_READY System
0x53 ('S') GET_TIME_SOS Clock
0x49 ('I') GET_TIME_ISO Clock

WiFi Management Commands

0xFF - RESET

Resets the FujiNet device to its initial state.

Property Value
Command 0xFF
Arguments None
Reply None

0xFE - GET_SSID

Retrieves the currently configured WiFi SSID.

Property Value
Command 0xFE
Arguments None
Reply data:s8 - SSID string with 8-bit length prefix

0xFD - SCAN_NETWORKS

Initiates a scan for available WiFi networks.

Property Value
Command 0xFD
Arguments None
Reply count:u8 - Number of networks found

0xFC - GET_SCAN_RESULT

Retrieves information about a discovered WiFi network.

Property Value
Command 0xFC
Arguments index:u8 - Network index (0-based)
Reply data:s8 - Network information with 8-bit length prefix

0xFB - SET_SSID

Sets the WiFi SSID and password for connection.

Property Value
Command 0xFB
Arguments Implementation-specific (SSID + password structure)
Reply None

0xFA - GET_WIFISTATUS

Returns the current WiFi connection status.

Property Value
Command 0xFA
Arguments None
Reply status: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.

Property Value
Command 0xEA
Arguments None
Reply data: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.

Property Value
Command 0xF4
Arguments None
Reply data: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.

Property Value
Command 0xF3
Arguments config:f256 - 256 bytes containing 8 host slots
Reply None

0xF9 - MOUNT_HOST

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

Property Value
Command 0xF9
Arguments host_slot:u8 - Host slot number (0-7)
Reply None

0xE6 - UNMOUNT_HOST

Unmounts (disconnects from) a host.

Property Value
Command 0xE6
Arguments host_slot:u8 - Host slot number (0-7)
Reply None

0xE1 - SET_HOST_PREFIX

Sets the current working directory prefix for a host.

Property Value
Command 0xE1
Arguments host_slot:u8 - Host slot number (0-7)prefix:f256 - 256-byte path string
Reply None

0xE0 - GET_HOST_PREFIX

Gets the current working directory prefix for a host.

Property Value
Command 0xE0
Arguments host_slot:u8 - Host slot number (0-7)
Reply prefix: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.

Property Value
Command 0xF2
Arguments None
Reply data:f304 - 304 bytes containing device slot configuration

0xF1 - WRITE_DEVICE_SLOTS

Writes all device slot configurations.

Property Value
Command 0xF1
Arguments config:f304 - 304 bytes containing device slot configuration
Reply None

0xF8 - MOUNT_IMAGE

Mounts a disk image to a device slot.

Property Value
Command 0xF8
Arguments device_slot:u8 - Device slot (0-7)mode:u8 - Mount mode flags
Reply None

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.

Property Value
Command 0xE9
Arguments device_slot:u8 - Device slot (0-7)
Reply None

0xD7 - MOUNT_ALL

Mounts all configured device slots.

Property Value
Command 0xD7
Arguments None
Reply None

0xE2 - SET_DEVICE_FULLPATH

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

Property Value
Command 0xE2
Arguments device_slot:u8 - Device slot (0-7)host_slot:u8 - Host slot (0-7)mode:u8 - Mount modefilename:f256 - 256-byte filename
Reply None

0xDA - GET_DEVICE_FULLPATH

Gets the full path for a device slot.

Property Value
Command 0xDA
Arguments device_slot:u8 - Device slot (0-7)
Reply path:f256 - 256-byte path string

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

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

Command Device Slot Reply
0xA0 Device 1 path:f256
0xA1 Device 2 path:f256
0xA2 Device 3 path:f256
0xA3 Device 4 path:f256
0xA4 Device 5 path:f256
0xA5 Device 6 path:f256
0xA6 Device 7 path:f256
0xA7 Device 8 path:f256

Directory Commands

0xF7 - OPEN_DIRECTORY

Opens a directory for listing.

Property Value
Command 0xF7
Arguments host_slot:u8 - Host slot (0-7)path:s8 - Path string with 8-bit length
Reply None

0xF6 - READ_DIR_ENTRY

Reads the next directory entry.

Property Value
Command 0xF6
Arguments maxlen:u8 - Maximum entry lengthaddtl:u8 - Additional flags
Reply entry:s7 - Directory entry with 7-bit length prefix

0xF5 - CLOSE_DIRECTORY

Closes an open directory.

Property Value
Command 0xF5
Arguments None
Reply None

0xE5 - GET_DIRECTORY_POSITION

Gets the current position in the directory listing.

Property Value
Command 0xE5
Arguments None
Reply position:u16 - Current position (16-bit)

0xE4 - SET_DIRECTORY_POSITION

Sets the current position in the directory listing.

Property Value
Command 0xE4
Arguments position:u16 - Position to set (16-bit)
Reply None

Disk Image Commands

0xE7 - NEW_DISK

Creates a new disk image.

Property Value
Command 0xE7
Arguments size:u8 - Disk size codehost_slot:u8 - Host slot (0-7)device_slot:u8 - Device slot (0-7)filename:s8 - Filename with 8-bit length
Reply None

0xD8 - COPY_FILE

Copies a file between hosts.

Property Value
Command 0xD8
Arguments source_slot:u8 - Source host slotdest_slot:u8 - Destination host slotcopy_spec:s8 - Copy specification with 8-bit length
Reply None

App Key Commands

App Keys provide persistent key-value storage for applications.

0xDC - OPEN_APPKEY

Opens an app key for reading or writing.

Property Value
Command 0xDC
Arguments Structure: {creator:u16, app:u8, key:u8, mode:i8, reserved:u8}
Reply None

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.

Property Value
Command 0xDD
Arguments None
Reply data:f66 - Up to 66 bytes of data (length varies by platform)

0xDE - WRITE_APPKEY

Writes data to an open app key.

Property Value
Command 0xDE
Arguments data:s16 - Data with 16-bit length prefix
Reply None

0xDB - CLOSE_APPKEY

Closes an open app key.

Property Value
Command 0xDB
Arguments None
Reply None

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.

Property Value
Command 0xD0
Arguments length:u16 - Data lengthdata:s8 - Data with 8-bit length
Reply None

0xCF - BASE64_ENCODE_COMPUTE

Performs the Base64 encoding operation.

Property Value
Command 0xCF
Arguments None
Reply None

0xCE - BASE64_ENCODE_LENGTH

Gets the length of the encoded output.

Property Value
Command 0xCE
Arguments None
Reply Encoded data length

0xCD - BASE64_ENCODE_OUTPUT

Retrieves the Base64 encoded data.

Property Value
Command 0xCD
Arguments length:u16 - Number of bytes to retrieve
Reply Encoded 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.

Property Value
Command 0xCC
Arguments length:u16 - Data lengthdata:s8 - Encoded data with 8-bit length
Reply None

0xCB - BASE64_DECODE_COMPUTE

Performs the Base64 decoding operation.

Property Value
Command 0xCB
Arguments None
Reply None

0xCA - BASE64_DECODE_LENGTH

Gets the length of the decoded output.

Property Value
Command 0xCA
Arguments None
Reply Decoded data length

0xC9 - BASE64_DECODE_OUTPUT

Retrieves the decoded data.

Property Value
Command 0xC9
Arguments length:u16 - Number of bytes to retrieve
Reply Decoded 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.

Property Value
Command 0xC8
Arguments data:s16 - Data with 16-bit length prefix
Reply None

0xC7 - HASH_COMPUTE

Computes the hash using the specified algorithm.

Property Value
Command 0xC7
Arguments algorithm:u8 - Hash algorithm ID
Reply None

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.

Property Value
Command 0xC6
Arguments as_hex:b - If true, return length of hex string
Reply Hash length

0xC5 - HASH_OUTPUT

Retrieves the computed hash.

Property Value
Command 0xC5
Arguments as_hex:b - If true, return hash as hex string
Reply Hash data

0xC3 - HASH_COMPUTE_NO_CLEAR

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

Property Value
Command 0xC3
Arguments None
Reply None

0xC2 - HASH_CLEAR

Clears the hash input buffer.

Property Value
Command 0xC2
Arguments None
Reply None

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.

Property Value
Command 0xBC
Arguments length:u16 - Data lengthdata:s8 - Data with 8-bit length
Reply None

0xBD - QRCODE_ENCODE

Generates the QR code with specified parameters.

Property Value
Command 0xBD
Arguments version:u8 - QR version (1-40)ecc_mode:u8 - Error correction levelshorten:u8 - URL shortening flag
Reply None

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.

Property Value
Command 0xBE
Arguments None
Reply QR code data length

0xBF - QRCODE_OUTPUT

Retrieves the generated QR code data.

Property Value
Command 0xBF
Arguments mode:u8 - Output mode
Reply QR code data

Device Control Commands

0xD5 - ENABLE_DEVICE

Enables a device.

Property Value
Command 0xD5
Arguments device:u8 - Device identifier
Reply None

0xD4 - DISABLE_DEVICE

Disables a device.

Property Value
Command 0xD4
Arguments device:u8 - Device identifier
Reply None

0xD1 - DEVICE_ENABLE_STATUS

Gets the enable/disable status of devices.

Property Value
Command 0xD1
Arguments None
Reply Device status bitmap

0xD6 - SET_BOOT_MODE

Sets the boot mode.

Property Value
Command 0xD6
Arguments mode:u8 - Boot mode value
Reply None

0xD9 - CONFIG_BOOT

Enables or disables automatic CONFIG boot.

Property Value
Command 0xD9
Arguments enable:u8 - 0=disable, 1=enable
Reply None

0xE3 - SET_HSIO_INDEX

Sets the High-Speed I/O index.

Property Value
Command 0xE3
Arguments Implementation-specific
Reply None

0x3F - HSIO_INDEX

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

Property Value
Command 0x3F
Arguments None
Reply None

0xEB - SET_BAUDRATE

Sets the communication baud rate.

Property Value
Command 0xEB
Arguments Implementation-specific
Reply None

0xDF - SET_SIO_EXTERNAL_CLOCK

Configures external SIO clock settings.

Property Value
Command 0xDF
Arguments Implementation-specific
Reply None

0xF0 - ENABLE_UDPSTREAM

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

Property Value
Command 0xF0
Arguments Implementation-specific
Reply None

Clock Commands

0x53 ('S') - GET_TIME_SOS

Gets the current time in SOS format.

Property Value
Command 0x53 ('S')
Arguments None
Reply Time in SOS format

0x49 ('I') - GET_TIME_ISO

Gets the current time in ISO format.

Property Value
Command 0x49 ('I')
Arguments None
Reply Time in ISO 8601 format

Low-Level I/O Commands

These commands provide basic I/O operations.

0x4F ('O') - OPEN

Opens a resource.

Property Value
Command 0x4F ('O')
Arguments mode:u8 - Open modedata:s - Resource specification
Reply None

0x43 ('C') - CLOSE

Closes a resource.

Property Value
Command 0x43 ('C')
Arguments None
Reply None

0x52 ('R') - READ

Reads data from a resource.

Property Value
Command 0x52 ('R')
Arguments handle:u8 - Resource handle
Reply Data

0x57 ('W') - WRITE

Writes data to a resource.

Property Value
Command 0x57 ('W')
Arguments handle:u8 - Resource handledata:s - Data to write
Reply None

0x53 ('S') - STATUS

Gets the status of a resource.

Property Value
Command 0x53 ('S')
Arguments None
Reply status:u32 - 32-bit status value

System Commands

0xE8 - GET_ADAPTERCONFIG

Gets the network adapter configuration.

Property Value
Command 0xE8
Arguments None
Reply data:s8 - Configuration data with 8-bit length

0xC4 - GET_ADAPTERCONFIG_EXTENDED

Gets extended network adapter configuration.

Property Value
Command 0xC4
Arguments None
Reply data:s8 - Extended configuration data with 8-bit length

0xC1 - GET_HEAP

Gets heap memory information (for debugging).

Property Value
Command 0xC1
Arguments None
Reply Heap information

0xD3 - RANDOM_NUMBER

Generates a random number.

Property Value
Command 0xD3
Arguments None
Reply Random number

0x00 - DEVICE_READY

Checks if the device is ready.

Property Value
Command 0x00
Arguments None
Reply None

0x01 - SEND_RESPONSE

Sends a response (internal).

Property Value
Command 0x01
Arguments None
Reply None

0x02 - SEND_ERROR

Sends an error (internal).

Property Value
Command 0x02
Arguments None
Reply None

Argument Type Reference

Type Size Description
i8 1 byte 8-bit signed integer (-128 to 127)
i16 2 bytes 16-bit signed integer (-32768 to 32767)
u8 1 byte 8-bit unsigned integer (0 to 255)
u16 2 bytes 16-bit unsigned integer (0 to 65535)
u32 4 bytes 32-bit unsigned integer
b 1 byte Boolean (0=false, non-zero=true)
s variable Variable length string/bytes
s7 variable String with 7-bit length prefix
s8 variable String with 8-bit length prefix
s16 variable String with 16-bit length prefix
fNNN NNN bytes Fixed-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.