pubsub.h
Go to the documentation of this file.
100 bool kprv_publisher_read(const pubsub_conn * conn, void * buffer, int buffer_size, uint8_t port);
110 bool kprv_subscriber_read(const pubsub_conn * conn, void * buffer, int buffer_size, uint8_t port);
bool kprv_subscriber_connect(pubsub_conn *conn, uint8_t address, uint8_t port)
Used by a telemetry subscriber to connect to the publishing server.
bool kprv_subscriber_socket_connect(pubsub_conn *conn, uint8_t address, uint8_t port)
Used by a client to connect to a server using a tcp socket.
bool kprv_send_csp(const pubsub_conn *conn, const void *data, uint16_t length)
Wrapper function for sending data via a csp connection.
csp_socket_t * kprv_server_setup(uint8_t port, uint8_t num_connections)
Performs the neccesary setup for the telemetry server to begin receiving subscriber connections...
void kprv_subscriber_socket_close(pubsub_conn *conn)
Performs shutdown and cleanup of tcp socket based connections.
bool kprv_server_accept(csp_socket_t *socket, pubsub_conn *conn)
Attempts to accept a subscriber connection.
bool kprv_subscriber_read(const pubsub_conn *conn, void *buffer, int buffer_size, uint8_t port)
Attempts to receive data over the specified pubsub_conn.
bool kprv_publisher_read(const pubsub_conn *conn, void *buffer, int buffer_size, uint8_t port)
Attempts to receive data over the specified pubsub_conn.
bool kprv_server_socket_accept(csp_socket_t *socket, pubsub_conn *conn)
Attempts to accept a subscriber connection over a tcp socket.