trunk roundhouse kick

This commit is contained in:
Thomas Göttgens
2023-01-21 14:34:29 +01:00
parent 6cf18b7d07
commit 51b2c431d9
234 changed files with 4989 additions and 5101 deletions

View File

@@ -2,34 +2,30 @@
#include "configuration.h"
#include <Arduino.h>
template<typename T>
template <typename T>
ServerAPI<T>::ServerAPI(T &_client) : StreamAPI(&client), concurrency::OSThread("ServerAPI"), client(_client)
{
LOG_INFO("Incoming wifi connection\n");
}
template<typename T>
ServerAPI<T>::~ServerAPI()
template <typename T> ServerAPI<T>::~ServerAPI()
{
client.stop();
}
template<typename T>
void ServerAPI<T>::close()
template <typename T> void ServerAPI<T>::close()
{
client.stop(); // drop tcp connection
StreamAPI::close();
}
/// Check the current underlying physical link to see if the client is currently connected
template<typename T>
bool ServerAPI<T>::checkIsConnected()
template <typename T> bool ServerAPI<T>::checkIsConnected()
{
return client.connected();
}
template<class T>
int32_t ServerAPI<T>::runOnce()
template <class T> int32_t ServerAPI<T>::runOnce()
{
if (client.connected()) {
return StreamAPI::runOncePart();
@@ -40,17 +36,14 @@ int32_t ServerAPI<T>::runOnce()
}
}
template<class T, class U>
APIServerPort<T, U>::APIServerPort(int port) : U(port), concurrency::OSThread("ApiServer") {}
template <class T, class U> APIServerPort<T, U>::APIServerPort(int port) : U(port), concurrency::OSThread("ApiServer") {}
template<class T, class U>
void APIServerPort<T, U>::init()
template <class T, class U> void APIServerPort<T, U>::init()
{
U::begin();
}
template<class T, class U>
int32_t APIServerPort<T, U>::runOnce()
template <class T, class U> int32_t APIServerPort<T, U>::runOnce()
{
auto client = U::available();
if (client) {