Skip to main content

Crate boppo_websocket

Crate boppo_websocket 

Source
Expand description

§WebSocket client library for Boppo tablets.

WebSocket client library for the Boppo Tablet for off-device programmable activities and control.

§client

Use client::connect to get a client::BoppoSender / client::BoppoReceiver pair. Because each connection is independent, you can connect to multiple tablets simultaneously without any global state.

§Globals Setup

connect_and_setup_globals and setup_globals wire one client connection into boppo_core’s global HAL, enabling high-level APIs like Button::B0.set_color(...) and the top-level functions in this crate (audio::play, audio::stop_all_sounds, etc.).

Most functions outside of client require setup_globals to have been called first and panic otherwise.

§Examples

Two examples are in the examples/ directory:

  • simple — buttons light up blue on press and play a snare
  • features — all buttons wired to lights, music, sound effects, and playback control

Modules§

audio
Audio playback functions
client
Direct WebSocket connection to a Boppo tablet.
color
Color constants and functions
commands
Shell command execution on the tablet.
executor
An async executor for activities
internal
Internal module for device and framework implementers.
interpolation
Utilities for interpolation between two values.
language
Obtain the current system language with system_language()
lights_plane
Utilities based on laying out the button lights on a cartesian plane.
log
A lightweight logging facade.
update_loop
Provides the Updatable trait for calling a function at a fixed interval.

Structs§

ButtonEvent
A notification that a top button has been pressed or released
ButtonEvents
A stream of top button press and release events.
Buttons
A selection of multiple Buttons.
Framebuffer
On “off-screen” buffer storing a color for each light on the tablet.
Lights
A selection of button lights on the tablet. There are 10 buttons with 4 lights each for a total of 40 lights.
MainFramebuffer
The colors that are displaying on the button lights or will be displayed after the next flush. All light color changes in this crate go through this Framebuffer.
ShortDuration
An unsigned duration with millisecond precision.

Enums§

Button
One of the 10 top buttons.
Column
A column of Buttons. When the side buttons face the user, Column::C0 is the leftmost column, and Column::C4 is the rightmost column.
Easing
An Easing function affects how a value transitions (from 0.0 to 1.0)
Error
Errors returned by this library.
LightDir
The directions lights are positioned around the buttons.
Row
A row of Buttons.

Functions§

connect_and_setup_globals
Connect to a tablet and initialize boppo_core globals in one step.
setup_globals
Wire a tablet connection into boppo_core globals.