misc mod and doc changes

This commit is contained in:
Vinzenz Schroeter 2025-05-06 21:25:36 +02:00
parent 4f0eca3ea0
commit 32d39f8006
11 changed files with 55 additions and 50 deletions

View file

@ -845,15 +845,15 @@ BrightnessGrid *sp_brightness_grid_load(size_t width,
*
* # Examples
* ```C
* UdpConnection connection = sp_udp_open("127.0.0.1:2342");
* UdpSocket *connection = sp_udp_open("127.0.0.1:2342");
* if (connection == NULL)
* return 1;
*
* BrightnessGrid grid = sp_brightness_grid_new(2, 2);
* BrightnessGrid *grid = sp_brightness_grid_new(2, 2);
* sp_brightness_grid_set(grid, 0, 0, 0);
* sp_brightness_grid_set(grid, 1, 1, 10);
*
* TypedCommand command = sp_command_char_brightness(grid);
* TypedCommand *command = sp_command_char_brightness(grid);
* sp_udp_free(connection);
* ```
*/
@ -1013,6 +1013,12 @@ BitmapCommand */*notnull*/ sp_cmd_bitmap_clone(BitmapCommand */*notnull*/ comman
void sp_cmd_bitmap_free(BitmapCommand */*notnull*/ command);
/**
* Move the provided [Bitmap] into a new [BitmapCommand],
* leaving other fields as their default values.
*
* Rust equivalent: [`<BitmapCommand as From<Bitmap>>::from`]
*/
BitmapCommand */*notnull*/ sp_cmd_bitmap_from_bitmap(Bitmap */*notnull*/ bitmap);
/**
@ -1475,19 +1481,19 @@ bool sp_u16_to_command_code(uint16_t code,
CommandCode *result);
/**
* Closes and deallocates a [UdpConnection].
* Closes and deallocates a [UdpSocket].
*/
void sp_udp_free(UdpSocket */*notnull*/ connection);
/**
* Creates a new instance of [UdpConnection].
* Creates a new instance of [UdpSocket].
*
* returns: NULL if connection fails, or connected instance
*
* # Examples
*
* ```C
* UdpConnection connection = sp_udp_open("172.23.42.29:2342");
* UdpSocket connection = sp_udp_open("172.23.42.29:2342");
* if (connection != NULL)
* sp_udp_send_command(connection, sp_command_clear());
* ```
@ -1495,14 +1501,14 @@ void sp_udp_free(UdpSocket */*notnull*/ connection);
UdpSocket *sp_udp_open(char */*notnull*/ host);
/**
* Creates a new instance of [UdpConnection].
* Creates a new instance of [UdpSocket].
*
* returns: NULL if connection fails, or connected instance
*
* # Examples
*
* ```C
* UdpConnection connection = sp_udp_open_ipv4(172, 23, 42, 29, 2342);
* UdpSocket connection = sp_udp_open_ipv4(172, 23, 42, 29, 2342);
* if (connection != NULL)
* sp_udp_send_command(connection, sp_command_clear());
* ```
@ -1514,7 +1520,7 @@ UdpSocket *sp_udp_open_ipv4(uint8_t ip1,
uint16_t port);
/**
* Sends a [TypedCommand] to the display using the [UdpConnection].
* Sends a [TypedCommand] to the display using the [UdpSocket].
*
* The passed `command` gets consumed.
*
@ -1530,7 +1536,7 @@ bool sp_udp_send_command(UdpSocket */*notnull*/ connection,
TypedCommand */*notnull*/ command);
/**
* Sends a [Header] to the display using the [UdpConnection].
* Sends a [Header] to the display using the [UdpSocket].
*
* returns: true in case of success
*
@ -1543,7 +1549,7 @@ bool sp_udp_send_command(UdpSocket */*notnull*/ connection,
bool sp_udp_send_header(UdpSocket */*notnull*/ udp_connection, Header header);
/**
* Sends a [Packet] to the display using the [UdpConnection].
* Sends a [Packet] to the display using the [UdpSocket].
*
* The passed `packet` gets consumed.
*