Expand description
Abstractions for the UDP protocol of the CCCB servicepoint display.
Your starting point is a Connection to the display. With a connection, you can send Commands. When received, the display will update the state of its pixels.
§Examples
§Clear display
use servicepoint::{Connection, Command};
// establish a connection
let connection = Connection::open("127.0.0.1:2342")
.expect("connection failed");
// turn off all pixels on display
connection.send(Command::Clear)
.expect("send failed");
§Set all pixels to on
// turn on all pixels in a grid
let mut pixels = Bitmap::max_sized();
pixels.fill(true);
// create command to send pixels
let command = Command::BitmapLinearWin(
servicepoint::Origin::ZERO,
pixels,
CompressionCode::default()
);
// send command to display
connection.send(command).expect("send failed");
§Send text
// create a text grid
let mut grid = CharGrid::from("Hello\nCCCB?");
// modify the grid
grid.set(grid.width() - 1, 1, '!');
// create the command to send the data
let command = Command::Utf8Data(servicepoint::Origin::ZERO, grid);
// send command to display
connection.send(command).expect("send failed");
Modules§
Structs§
- Bitmap
- A fixed-size 2D grid of booleans.
- Brightness
- A display brightness value, checked for correct value range
- Cp437
Converter - Contains functions to convert between UTF-8 and Codepage 437.
- Header
- A raw header.
- Iter
Grid Rows - An iterator iver the rows in a ValueGrid
- Origin
- An origin marks the top left position of a window sent to the display.
- Packet
- The raw packet.
- Pixels
- Marks something to be measured in number of pixels.
- Tiles
- Marks something to be measured in number of iles.
- Value
Grid - A 2D grid of values.
Enums§
- Command
- A low-level display command.
- Compression
Code - Specifies the kind of compression to use. Availability depends on features.
- Connection
- A connection to the display.
- SetValue
Series Error - Error type for methods that change a whole column or row at once
- TryLoad
Value Grid Error - Errors that can occur when loading a grid
Constants§
- FRAME_
PACING - Actual hardware limit is around 28-29ms/frame. Rounded up for less dropped packets.
- PIXEL_
COUNT - pixel count on whole screen
- PIXEL_
HEIGHT - Display height in pixels
- PIXEL_
WIDTH - Display width in pixels
- TILE_
HEIGHT - Display tile count in the y-direction
- TILE_
SIZE - size of a single tile in one dimension
- TILE_
WIDTH - Display tile count in the x-direction
Traits§
- DataRef
- A trait for getting the underlying raw byte slices of data containers.
- Grid
- A two-dimensional grid of
T
- Value
- A type that can be stored in a ValueGrid, e.g. char, u8.
Type Aliases§
- BitVec
- A byte-packed vector of booleans.
- Brightness
Grid - A grid containing brightness values.
- Byte
Grid - A 2d grid of bytes - see ValueGrid.
- Char
Grid - A grid containing UTF-8 characters.
- Cp437
Grid - A grid containing codepage 437 characters.
- Offset
- Type alias for documenting the meaning of the u16 in enum values
- Payload
- The raw payload.