|
arduino-audio-tools
|
RTSPServerBase - Shared logic for RTSPServer and RTSPServerTaskless. More...
#include <RTSPServerBase.h>
Public Member Functions | |
| RTSPServerBase (RTSPAudioStreamerBase< Platform > &streamer, int port=8554) | |
| Constructor. | |
| ~RTSPServerBase () | |
| Destructor. | |
| virtual bool | begin () |
| Start server. | |
| bool | begin (const char *ssid, const char *password) |
| Start server and connect to WiFi (ESP32 only) | |
| int | clientCount () |
| Get number of connected clients. | |
| void | end () |
| Stop server and clean up. | |
| operator bool () | |
| Returns true if any client is connected. | |
| void | setOnSessionPath (bool(*cb)(const char *path, void *ref), void *ref=nullptr) |
| Set callback for session path. | |
| void | setSessionTimeoutMs (unsigned long ms) |
| Set session timeout in milliseconds. | |
Protected Member Functions | |
| void | acceptClient () |
| Accept new client if none is active. | |
| void | handleSession () |
| Handle requests session if active. | |
Protected Attributes | |
| Platform::TcpClientType | client |
| int | client_count = 0 |
| unsigned long | lastRequestTime = 0 |
| bool(* | onSessionPathCb )(const char *, void *) = nullptr |
| void * | onSessionPathRef = nullptr |
| int | port = 554 |
| RtspSession< Platform > * | rtspSession = nullptr |
| Platform::TcpServerType * | server = nullptr |
| unsigned long | sessionTimeoutMs = 60000 |
| RTSPAudioStreamerBase< Platform > * | streamer = nullptr |
RTSPServerBase - Shared logic for RTSPServer and RTSPServerTaskless.
This class contains all protocol, session, and connection logic, but no task/timer code. Derived classes implement scheduling: either with tasks (RTSPServer) or manual loop (RTSPServerTaskless).
| Platform | Target hardware platform (e.g., Arduino, ESP32) |
|
inlinevirtual |
Start server.
Reimplemented in RTSPServer< Platform >, and RTSPServerTaskless< Platform >.