move examples into package (include them in published crate)

This commit is contained in:
Vinzenz Schroeter 2024-05-26 13:55:19 +02:00
parent 5514f60c28
commit c92493fad1
22 changed files with 26 additions and 165 deletions

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,19 @@
#include <stdio.h>
#include "servicepoint.h"
int main(void) {
sp_Connection *connection = sp_connection_open("localhost:2342");
if (connection == NULL)
return 1;
sp_PixelGrid *pixels = sp_pixel_grid_new(sp_PIXEL_WIDTH, sp_PIXEL_HEIGHT);
sp_pixel_grid_fill(pixels, true);
sp_Command *command = sp_command_bitmap_linear_win(0, 0, pixels, Uncompressed);
sp_Packet *packet = sp_packet_from_command(command);
if (!sp_connection_send(connection, packet))
return 1;
sp_connection_dealloc(connection);
return 0;
}