PL::StreamServer class
-
class StreamServer : public PL::Server
Stream server class.
Public Functions
Creates a stream server.
- Parameters:
stream – stream
-
~StreamServer()
Note
Every derived class must call StopTask as the first statement of its own destructor so that TaskCode does not call HandleRequest on a partially destroyed object; the base destructor aborts if this was not done.
-
virtual esp_err_t Lock(TickType_t timeout = portMAX_DELAY) override
Locks the object.
- Parameters:
timeout – timeout in FreeRTOS ticks
- Returns:
error code
-
virtual esp_err_t Unlock() override
Unlocks the object.
- Returns:
error code
-
virtual esp_err_t Enable() override
Enables the server.
- Returns:
error code
-
virtual esp_err_t Disable() override
Disables the server.
- Returns:
error code
-
virtual bool IsEnabled() override
Checks if the server is enabled.
- Returns:
true if the server is enabled
Sets the stream.
- Parameters:
stream – stream
- Returns:
error code
-
esp_err_t SetTaskParameters(const TaskParameters &taskParameters)
Sets the server task parameters.
- Parameters:
taskParameters – task parameters
- Returns:
error code
-
std::string GetName()
Gets the server name.
- Returns:
name
-
void SetName(const std::string &name)
Sets the server name.
- Parameters:
name – name
Public Members
Public Static Attributes
-
static const TaskParameters defaultTaskParameters
Default server task parameters.
Protected Functions
-
esp_err_t StopTask()
Stops the server task and waits for it to exit.
Note
Must be called as the first statement of the destructor of every derived class so that TaskCode does not call HandleRequest on a partially destroyed object. Aborts if called from the server task itself, since it cannot wait for its own task to exit.
- Returns:
error code