Device

NodeDescriptionInputsOutputs
ble_connectConnects to a BLE device by address and discovers its services.address Texthandle Text
ble_disconnectDisconnects from a BLE device and releases the connection.handle Textdisconnected Boolean
ble_list_servicesLists GATT services and characteristics on a connected BLE device.handle Textservices Json
ble_readReads data from a BLE characteristic.handle Text, service Text, characteristic Textdata Text, bytes_read Number
ble_scanScans for nearby Bluetooth Low Energy devices.duration_ms Numberdevices Json
ble_writeWrites data to a BLE characteristic.handle Text, service Text, characteristic Text, data Textbytes_written Number
disconnect_allCloses all serial ports and BLE connections opened by this app (does not affect system devices like headsets, mice, etc.).closed Boolean
gpio_readReads the state of a GPIO pin from a connected microcontroller via serial.handle Text, pin Number, timeout_ms Numbervalue Boolean, raw Number
gpio_setSets a GPIO pin high or low on a connected microcontroller via serial.handle Text, pin Number, value Booleansent Boolean
i2c_readReads data from an I2C device via a serial-connected microcontroller using Firmata protocol.handle Text, address Number, register Number, num_bytes Number, timeout_ms Numberdata Text, bytes_read Number
i2c_writeWrites data to an I2C device via a serial-connected microcontroller using Firmata protocol.handle Text, address Number, register Number, data Textsent Boolean
list_portsLists all available serial and USB ports on the system.ports Json
print_labelPrints an image to a TSPL2-compatible label printer (e.g. Nelko P21) over serial.handle Text, image Image, width_px Number, height_px Number, width_mm Number, height_mm Number, gap_mm Number, density Number, copies Number, rotate Number, invert Booleanprinted Boolean
print_receiptPrints an image to a thermal receipt printer via ESC/POS protocol over serial or BLE.handle Text, image Image, width Number, service Text, characteristic Textprinted Boolean
serial_closeCloses an open serial connection and releases the port.handle Textclosed Boolean
serial_openOpens a serial port connection and returns a handle for read/write operations.port Text, baud_rate Number, timeout_ms Numberhandle Text
serial_readReads data from an open serial connection with a configurable timeout.handle Text, timeout_ms Number, max_bytes Numberdata Text, bytes_read Number
serial_writeSends text data over an open serial connection.handle Text, data Textbytes_written Number

ble_connect

Connects to a BLE device by address and discovers its services.

Inputs:

Output: handle (Text) — connection handle

ble_disconnect

Disconnects from a BLE device and releases the connection.

Inputs:

Output: disconnected (Boolean) — true if disconnected

ble_list_services

Lists GATT services and characteristics on a connected BLE device.

Inputs:

Output: services (Json) — array of services, each with uuid and characteristics array

ble_read

Reads data from a BLE characteristic.

Inputs:

Outputs:

ble_scan

Scans for nearby Bluetooth Low Energy devices.

Inputs:

Output: devices (Json) — array of discovered devices

ble_write

Writes data to a BLE characteristic.

Inputs:

Output: bytes_written (Number) — number of bytes sent

disconnect_all

Closes all serial ports and BLE connections opened by this app (does not affect system devices like headsets, mice, etc.).

Output: closed (Boolean) — true when all connections are released

gpio_read

Reads the state of a GPIO pin from a connected microcontroller via serial.

Inputs:

Outputs:

Notes: Sends Firmata REPORT_DIGITAL (0xD0) command.

gpio_set

Sets a GPIO pin high or low on a connected microcontroller via serial.

Inputs:

Output: sent (Boolean) — true if command sent

Notes: Sends Firmata SET_DIGITAL_PIN (0xF5) command.

i2c_read

Reads data from an I2C device via a serial-connected microcontroller using Firmata protocol.

Inputs:

Outputs:

Notes: Sends Firmata I2C_REQUEST (0x76) read command.

i2c_write

Writes data to an I2C device via a serial-connected microcontroller using Firmata protocol.

Inputs:

Output: sent (Boolean) — true if sent

Notes: Sends Firmata I2C_REQUEST (0x76) write command.

list_ports

Lists all available serial and USB ports on the system.

Output: ports (Json) — array of available ports with name and type info

Prints an image to a TSPL2-compatible label printer (e.g. Nelko P21) over serial.

Inputs:

Output: printed (Boolean) — true if sent successfully

Prints an image to a thermal receipt printer via ESC/POS protocol over serial or BLE.

Inputs:

Output: printed (Boolean) — true if sent successfully

serial_close

Closes an open serial connection and releases the port.

Inputs:

Output: closed (Boolean) — true if closed

serial_open

Opens a serial port connection and returns a handle for read/write operations.

Inputs:

Output: handle (Text) — connection handle

serial_read

Reads data from an open serial connection with a configurable timeout.

Inputs:

Outputs:

serial_write

Sends text data over an open serial connection.

Inputs:

Output: bytes_written (Number) — number of bytes sent