Crates.io | servicepoint_binding_c |
lib.rs | servicepoint_binding_c |
version | 0.10.0 |
source | src |
created_at | 2024-05-28 20:01:53.274546 |
updated_at | 2024-10-16 18:08:48.216065 |
description | C bindings for the servicepoint crate. |
homepage | https://docs.rs/crate/servicepoint_binding_c |
repository | https://github.com/cccb/servicepoint |
max_upload_size | |
id | 1254763 |
size | 60,039 |
In CCCB, there is a big pixel matrix hanging on the wall. It is called "Service Point Display" or "Airport Display".
This crate contains C bindings for the servicepoint
library, enabling users to parse, encode and send packets to this display via UDP.
#include <stdio.h>
#include "servicepoint.h"
int main(void) {
SPConnection *connection = sp_connection_open("172.23.42.29:2342");
if (connection == NULL)
return 1;
SPBitmap *pixels = sp_bitmap_new(SP_PIXEL_WIDTH, SP_PIXEL_HEIGHT);
sp_bitmap_fill(pixels, true);
SPCommand *command = sp_command_bitmap_linear_win(0, 0, pixels, Uncompressed);
while (sp_connection_send_command(connection, sp_command_clone(command)));
sp_command_free(command);
sp_connection_free(connection);
return 0;
}
A full example including Makefile is available as part of this crate.
This library is still in early development. You can absolutely use it, and it works, but expect minor breaking changes with every version bump. Please specify the full version including patch in your Cargo.toml until 1.0 is released.
Copy the header to your project and compile against.
You have the choice of linking statically (recommended) or dynamically.
staticlib
variant.cdylib
at runtime in the same version, as there are no API/ABI guarantees yet.sp_
<struct_name> <rust name>.Look at the main project README for further information.