|
ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
|
ACIP client-side protocol library. More...
Go to the source code of this file.
Functions | |
| asciichat_error_t | acip_client_receive_and_dispatch (acip_transport_t *transport, const acip_client_callbacks_t *callbacks) |
| Receive packet from server and dispatch to callbacks. | |
| asciichat_error_t | acip_send_image_frame (acip_transport_t *transport, const void *pixel_data, uint32_t width, uint32_t height, uint32_t pixel_format) |
| Send image frame to server (client → server) | |
| asciichat_error_t | acip_send_client_join (acip_transport_t *transport, uint8_t capabilities) |
| Announce client join to server (client → server) | |
| asciichat_error_t | acip_send_client_leave (acip_transport_t *transport) |
| Notify server of client leaving (client → server) | |
| asciichat_error_t | acip_send_stream_start (acip_transport_t *transport, uint8_t stream_types) |
| Request to start media streaming (client → server) | |
| asciichat_error_t | acip_send_stream_stop (acip_transport_t *transport, uint8_t stream_types) |
| Request to stop media streaming (client → server) | |
| asciichat_error_t | acip_send_capabilities (acip_transport_t *transport, const void *cap_data, size_t cap_len) |
| Send terminal capabilities to server (client → server) | |
| asciichat_error_t | acip_send_protocol_version (acip_transport_t *transport, const protocol_version_packet_t *version) |
| Send protocol version to server (client → server) | |
ACIP client-side protocol library.
ACIP client-side protocol API.
Client-side ACIP (ASCII-Chat IP Protocol) implementation for:
ACIP Protocol Overview:
Primary Use Case: Connecting to ACDS (ASCII-Chat Discovery Service) servers for session discovery and WebRTC peer coordination.
Integration: This library is part of libasciichat and can be used by any application needing ACIP/ACDS integration.
Client-side API for ascii-chat protocol. Provides functions for:
Definition in file lib/network/acip/client.h.
| asciichat_error_t acip_client_receive_and_dispatch | ( | acip_transport_t * | transport, |
| const acip_client_callbacks_t * | callbacks | ||
| ) |
Receive packet from server and dispatch to callbacks.
High-level receive function for client side. Receives a single packet from the transport, handles decryption, and dispatches to appropriate callback handler.
| transport | Transport instance |
| callbacks | Callback structure for handling received packets |
Definition at line 28 of file lib/network/acip/client.c.
References acip_handle_client_packet(), packet_envelope_t::allocated_buffer, packet_envelope_t::allocated_size, buffer_pool_free(), acip_transport::crypto_ctx, packet_envelope_t::data, ERROR_CRYPTO, ERROR_INVALID_PARAM, ERROR_NETWORK, acip_transport_methods_t::get_socket, INVALID_SOCKET_VALUE, acip_transport_methods_t::is_connected, packet_envelope_t::len, acip_transport::methods, PACKET_RECV_EOF, PACKET_RECV_SECURITY_VIOLATION, PACKET_RECV_SUCCESS, receive_packet_secure(), SET_ERRNO, and packet_envelope_t::type.
| asciichat_error_t acip_send_capabilities | ( | acip_transport_t * | transport, |
| const void * | cap_data, | ||
| size_t | cap_len | ||
| ) |
Send terminal capabilities to server (client → server)
Reports client's terminal capabilities (color support, dimensions, etc.)
| transport | Transport instance |
| cap_data | Capability data buffer |
| cap_len | Capability data length |
Definition at line 157 of file lib/network/acip/client.c.
References ERROR_INVALID_PARAM, packet_send_via_transport(), PACKET_TYPE_CLIENT_CAPABILITIES, and SET_ERRNO.
| asciichat_error_t acip_send_client_join | ( | acip_transport_t * | transport, |
| uint8_t | capabilities | ||
| ) |
Announce client join to server (client → server)
Notifies server that client is ready to participate in session.
| transport | Transport instance |
| capabilities | Client capability bitmask (video, audio, etc.) |
Definition at line 119 of file lib/network/acip/client.c.
References ERROR_INVALID_PARAM, packet_send_via_transport(), PACKET_TYPE_CLIENT_JOIN, and SET_ERRNO.
| asciichat_error_t acip_send_client_leave | ( | acip_transport_t * | transport | ) |
Notify server of client leaving (client → server)
Clean disconnect notification to server.
| transport | Transport instance |
Definition at line 128 of file lib/network/acip/client.c.
References ERROR_INVALID_PARAM, packet_send_via_transport(), PACKET_TYPE_CLIENT_LEAVE, and SET_ERRNO.
| asciichat_error_t acip_send_image_frame | ( | acip_transport_t * | transport, |
| const void * | pixel_data, | ||
| uint32_t | width, | ||
| uint32_t | height, | ||
| uint32_t | pixel_format | ||
| ) |
Send image frame to server (client → server)
Sends webcam video frame as RGB24 pixel data.
| transport | Transport instance |
| pixel_data | RGB24 pixel data (width * height * 3 bytes) |
| width | Frame width in pixels |
| height | Frame height in pixels |
| pixel_format | Pixel format (e.g., RGB24) |
Definition at line 78 of file lib/network/acip/client.c.
References ASCIICHAT_OK, buffer_pool_alloc(), buffer_pool_free(), image_frame_packet_t::checksum, image_frame_packet_t::compressed_size, ERROR_INVALID_PARAM, ERROR_MEMORY, image_frame_packet_t::height, HOST_TO_NET_U32, packet_send_via_transport(), PACKET_TYPE_IMAGE_FRAME, image_frame_packet_t::pixel_format, SET_ERRNO, image_frame_packet_t::timestamp, and image_frame_packet_t::width.
| asciichat_error_t acip_send_protocol_version | ( | acip_transport_t * | transport, |
| const protocol_version_packet_t * | version | ||
| ) |
Send protocol version to server (client → server)
Negotiates protocol version with server.
| transport | Transport instance |
| version | Protocol version structure |
Definition at line 165 of file lib/network/acip/client.c.
References ERROR_INVALID_PARAM, packet_send_via_transport(), PACKET_TYPE_PROTOCOL_VERSION, and SET_ERRNO.
| asciichat_error_t acip_send_stream_start | ( | acip_transport_t * | transport, |
| uint8_t | stream_types | ||
| ) |
Request to start media streaming (client → server)
Notifies server that client wants to start sending video/audio.
| transport | Transport instance |
| stream_types | Stream type bitmask (video, audio, etc.) |
Definition at line 137 of file lib/network/acip/client.c.
References ERROR_INVALID_PARAM, HOST_TO_NET_U32, packet_send_via_transport(), PACKET_TYPE_STREAM_START, and SET_ERRNO.
| asciichat_error_t acip_send_stream_stop | ( | acip_transport_t * | transport, |
| uint8_t | stream_types | ||
| ) |
Request to stop media streaming (client → server)
Notifies server that client wants to stop sending video/audio.
| transport | Transport instance |
| stream_types | Stream type bitmask (video, audio, etc.) |
Definition at line 147 of file lib/network/acip/client.c.
References ERROR_INVALID_PARAM, HOST_TO_NET_U32, packet_send_via_transport(), PACKET_TYPE_STREAM_STOP, and SET_ERRNO.