This commit is contained in:
parent
04223022a2
commit
2f4124c0cd
6 changed files with 57 additions and 55 deletions
|
@ -225,14 +225,7 @@ 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.
|
||||
*/
|
||||
typedef struct UdpConnection UdpConnection;
|
||||
typedef struct UdpSocket UdpSocket;
|
||||
|
||||
/**
|
||||
* A 2D grid of values.
|
||||
|
@ -298,7 +291,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 +311,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 +340,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 +1213,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 +1228,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 +1243,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 +1262,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 +1276,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 +1285,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue