a bunch of options for the Makefile

This commit is contained in:
Vinzenz Schroeter 2025-04-24 22:47:27 +02:00
parent bdfe4439a1
commit 406ec84577
7 changed files with 126 additions and 88 deletions

View file

@ -226,13 +226,9 @@ typedef struct SPBitVec SPBitVec;
typedef struct TypedCommand TypedCommand;
/**
* A connection using the UDP protocol.
*
* Use this when sending commands directly to the display.
*
* Requires the feature "`protocol_udp`" which is enabled by default.
* This is a type only used by cbindgen to have a type for pointers.
*/
typedef struct UdpConnection UdpConnection;
typedef struct UdpSocket UdpSocket;
/**
* A 2D grid of values.
@ -298,7 +294,7 @@ typedef struct {
* grid.set(1, 1, Brightness::MIN);
*
* # let connection = FakeConnection;
* connection.send(BrightnessGridCommand {
* connection.send_command(BrightnessGridCommand {
* origin: Origin::new(3, 7),
* grid
* }).unwrap()
@ -318,7 +314,7 @@ typedef ValueGrid_Brightness BrightnessGrid;
*
* let b = Brightness::try_from(7).unwrap();
* # let connection = FakeConnection;
* let result = connection.send(GlobalBrightnessCommand::from(b));
* let result = connection.send_command(GlobalBrightnessCommand::from(b));
* ```
*/
typedef uint8_t Brightness;
@ -347,7 +343,7 @@ typedef uint8_t Brightness;
*
* # let connection = FakeConnection;
* let command = CharGridCommand { origin: Origin::ZERO, grid };
* connection.send(command).unwrap()
* connection.send_command(command).unwrap()
* ```
*/
typedef ValueGrid_char CharGrid;
@ -1220,7 +1216,7 @@ bool sp_u16_to_command_code(uint16_t code,
/**
* Closes and deallocates a [UdpConnection].
*/
void sp_udp_free(UdpConnection */*notnull*/ connection);
void sp_udp_free(UdpSocket */*notnull*/ connection);
/**
* Creates a new instance of [UdpConnection].
@ -1235,7 +1231,7 @@ void sp_udp_free(UdpConnection */*notnull*/ connection);
* sp_udp_send_command(connection, sp_command_clear());
* ```
*/
UdpConnection *sp_udp_open(char */*notnull*/ host);
UdpSocket *sp_udp_open(char */*notnull*/ host);
/**
* Creates a new instance of [UdpConnection].
@ -1250,11 +1246,11 @@ UdpConnection *sp_udp_open(char */*notnull*/ host);
* sp_udp_send_command(connection, sp_command_clear());
* ```
*/
UdpConnection *sp_udp_open_ipv4(uint8_t ip1,
uint8_t ip2,
uint8_t ip3,
uint8_t ip4,
uint16_t port);
UdpSocket *sp_udp_open_ipv4(uint8_t ip1,
uint8_t ip2,
uint8_t ip3,
uint8_t ip4,
uint16_t port);
/**
* Sends a [TypedCommand] to the display using the [UdpConnection].
@ -1269,7 +1265,7 @@ UdpConnection *sp_udp_open_ipv4(uint8_t ip1,
* sp_udp_send_command(connection, sp_command_brightness(5));
* ```
*/
bool sp_udp_send_command(UdpConnection */*notnull*/ connection,
bool sp_udp_send_command(UdpSocket */*notnull*/ connection,
TypedCommand */*notnull*/ command);
/**
@ -1283,8 +1279,7 @@ bool sp_udp_send_command(UdpConnection */*notnull*/ connection,
* sp_udp_send_header(connection, sp_command_brightness(5));
* ```
*/
bool sp_udp_send_header(UdpConnection */*notnull*/ udp_connection,
Header header);
bool sp_udp_send_header(UdpSocket */*notnull*/ udp_connection, Header header);
/**
* Sends a [Packet] to the display using the [UdpConnection].
@ -1293,7 +1288,7 @@ bool sp_udp_send_header(UdpConnection */*notnull*/ udp_connection,
*
* returns: true in case of success
*/
bool sp_udp_send_packet(UdpConnection */*notnull*/ connection,
bool sp_udp_send_packet(UdpSocket */*notnull*/ connection,
Packet */*notnull*/ packet);
#ifdef __cplusplus