servicepoint-binding-c/example/src/random_stuff.c
2025-06-23 19:43:23 +02:00

24 lines
599 B
C

#include <stdio.h>
#include "servicepoint.h"
#include "helpers.h"
int main(void) {
sock_init();
Bitmap *pixels = sp_bitmap_new(PIXEL_WIDTH, PIXEL_HEIGHT);
if (pixels == NULL)
return 1;
sp_bitmap_fill(pixels, true);
Packet *packet = sp_bitmap_try_into_packet(pixels, 0, 0, COMPRESSION_CODE_UNCOMPRESSED);
if (packet == NULL)
return 1;
Header *header = sp_packet_get_header_mut(packet);
printf("[%d, %d, %d, %d, %d]\n", header->command_code, header->a, header->b, header->c, header->d);
sp_udpsocket_send_packet(sock, packet);
return 0;
}