JS::WebSerial class of PicoRuby

Singleton methods

_close_port

JS::WebSerial._close_port(JS::Object js_port) -> nil

_close_port_promise

JS::WebSerial._close_port_promise(JS::Object js_port) -> JS::Object

_open_port

JS::WebSerial._open_port(JS::Object js_port, JS::Object options) -> JS::Object

_request_port

JS::WebSerial._request_port() -> JS::Object

_set_on_disconnect

JS::WebSerial._set_on_disconnect(JS::Object js_port, Integer callback_id) -> nil

_start_reading

JS::WebSerial._start_reading(JS::Object js_port, Integer callback_id) -> nil

_take_last_connected_port

JS::WebSerial._take_last_connected_port() -> JS::Object?

_watch_connect_events

JS::WebSerial._watch_connect_events() -> nil

binary_capture_read

JS::WebSerial.binary_capture_read(JS::Object js_port, Integer max_bytes) -> String

binary_capture_start

JS::WebSerial.binary_capture_start(JS::Object js_port) -> nil

binary_capture_stop

JS::WebSerial.binary_capture_stop(JS::Object js_port) -> nil

capture_peek

JS::WebSerial.capture_peek(JS::Object js_port) -> String

capture_start

JS::WebSerial.capture_start(JS::Object js_port) -> nil

capture_stop

JS::WebSerial.capture_stop(JS::Object js_port) -> String

connect

JS::WebSerial.connect(?baud_rate: Integer, ?data_bits: Integer, ?stop_bits: Integer, ?parity: String) -> JS::WebSerial
JS::WebSerial.connect(?baud_rate: Integer, ?data_bits: Integer, ?stop_bits: Integer, ?parity: String) { (JS::WebSerial) -> void } -> JS::WebSerial

new

JS::WebSerial.new(JS::Object js_port) -> void

request_port

JS::WebSerial.request_port(?filters: Array[untyped]) -> JS::WebSerial?
JS::WebSerial.request_port(?filters: Array[untyped]) { (JS::WebSerial?) -> void } -> JS::WebSerial?

supported?

JS::WebSerial.supported?() -> boolish

Instance methods

close

instance.close() -> nil

drain

instance.drain() -> JS::Object

on_disconnect

instance.on_disconnect() { () -> void } -> nil

on_receive

instance.on_receive() { (String data) -> void } -> nil

open

instance.open(?baud_rate: Integer, ?data_bits: Integer, ?stop_bits: Integer, ?parity: String) -> JS::WebSerial
instance.open(?baud_rate: Integer, ?data_bits: Integer, ?stop_bits: Integer, ?parity: String) { (JS::WebSerial) -> void } -> JS::WebSerial

opened?

instance.opened?() -> bool

start_terminal_read

instance.start_terminal_read() -> nil

write

instance.write(String str) -> nil

write_bytes

instance.write_bytes(String bytes, ?chunk_size: Integer) -> JS::Object
Tags: class