Channels ================================= This page describes everthing about the `core/channel.js` file, which provides classes to connect to a device with different protocols. BIPES uses `Web Serial API `_, `Web Bluetooth API `_ and `WebSocket API `_, in which we handle inside the ``webserial``, ``webbluetooth`` and ``websocket`` classes respectively. All of them inside the `core/channel.js` along side the ``mux`` class, a `'multiplexer' `_ between these protocols. Web Serial API and Web Bluetooth API require `HTTPS `_ for the server version, while the WebSocket API depends on the connection type of the device. For now, MicroPython firmware only does unsecure connection (see `MicroPython WebREPL `_ repository for more information), therefore BIPES connection with WebSocket API can only be done via HTTP. The Multiplexer ----------------------------- To send data to a device, the 'no ui' way, just do: .. code-block:: javascript Channel.mux.currentChannel = 'webserial'|'webbluetooth'|'websocket' Channel.mux.connect(); mux.bufferPush (code_); That's it, BIPES will connect to the device, append the code to a buffer in the connected protocol's class and send it. More info about the class: .. js:autoclass:: channel.mux :short-name: :members: :private-members: WebSerial ----------------------------- With the use of `Web Serial API `_ , data can be sent via a serial port, with the help of the ``webserial`` class. .. js:autoclass:: channel.webserial :short-name: :members: :private-members: WebBluetooth ----------------------------- With the use of `Web Bluetooth API `_ , data can be sent via Bluetooth with the help of the ``webbluetooth`` class. .. js:autoclass:: channel.webbluetooth :short-name: :members: :private-members: WebSockets ----------------------------- With the use of `WebSocket API `_ , data can be sent via TCP/IP, with the help of the ``websocket`` class. .. js:autoclass:: channel.websocket :short-name: :members: :private-members: