RF24Ethernet - TCP/IP over RF24Network v2.0.3
TMRh20 - Pushing the practical limits of RF24 modules
Loading...
Searching...
No Matches
RF24Server.h
Go to the documentation of this file.
1/*
2 RF24Server.h - Arduino implementation of a uIP wrapper class.
3 Copyright (c) 2014 tmrh20@gmail.com, github.com/TMRh20
4 Copyright (c) 2013 Norbert Truchsess <norbert.truchsess@t-online.de>
5 All rights reserved.
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef RF24SERVER_H
19#define RF24SERVER_H
20
21#include "Server.h"
22#include "RF24Client.h"
23#include "ethernet_comp.h"
24
25class RF24Server : public Server
26{
27
28public:
29 RF24Server(uint16_t);
32 void begin();
33#if defined(ESP32)
34 /* on esp32 this is a pure virtual func */
35 void begin(uint16_t port);
36#endif
37 size_t write(uint8_t);
38 size_t write(const uint8_t* buf, size_t size);
39 using Print::write;
40
41 /**
42 * Set server side timeouts in mS. If data is not succesfully sent or received in this timeframe, disconnect the client.
43 */
44 void setTimeout(uint32_t timeout);
45
46private:
47#if USE_LWIP > 0
48 static struct tcp_pcb* sPcb;
49 static struct tcp_pcb* bindPcb;
50 static uint16_t _port;
51 static EthernetClient::ConnectState* serverState;
52#else
53 uint16_t _port;
54#endif
55};
56
57#endif
size_t write(uint8_t)
void begin()
RF24Server(uint16_t)
RF24Client available()
void setTimeout(uint32_t timeout)