RCKit
ESP8266Transceiver.h
1
// ESP8266Transceiver.h
2
//
3
// RCRx transceiver device for ESP8266 devices
4
// Copyright (C) 2018 Mike McCauley
5
// $Id: ESP8266Transceiver.h,v 1.1 2018/09/17 23:09:57 mikem Exp mikem $
6
7
#ifndef ESP8266Transceiver_h
8
#define ESP8266Transceiver_h
9
10
#include "Transceiver.h"
11
#include "
RCOIP.h
"
12
13
/////////////////////////////////////////////////////////////////////
14
/// \class ESP8266Transceiver ESP8266Transceiver.h <ESP8266Transceiver.h>
15
/// \brief Defines a WiSHield RCOIP Transceiver
16
///
17
/// This is one of several types of Transceiver that RCRx can use to communicate with
18
/// an RCOIP transmitter.
19
/// It works with the WiFi device on an ESP8266 based device
20
///
21
/// The default WiFi configuration is:
22
/// - IP Address: 169.254.1.100
23
/// - Gateway and transmitter address: 169.254.1.1
24
/// - SSID: RCArduino
25
/// - WiFi security type: NONE (i.e. an open unencrypted, no password WiFi network)
26
/// - WiFi mode: ad-hoc (ie direct node-to-node communications)
27
/// You can change these default settings by editing ESP8266Transceiver.cpp. (I know thats ugly, but
28
/// it is a consequence of the way the WiShield library is built).
29
///
30
/// There is only permitted to be one instance of ESP8266Transceiver. This is because of the low level
31
/// C code that glues the WiShield code to ESP8266Transceiver, and the fact there can also be only one instance of
32
/// the WiShield object.
33
class
ESP8266Transceiver
:
public
Transceiver
34
{
35
public
:
36
/// Constructor.
37
/// Creates a new ESP8266Transceiver object.
38
ESP8266Transceiver
();
39
40
/// Initialise the WiShield using the WiFi configuration in ESP8266Transceiver.cpp
41
/// Call this once before using the Transceiver
42
virtual
void
init
();
43
44
/// Poll the object for activity.
45
/// This is expected to be called frequently in the main loop.
46
/// It processes the WiFi stack, checking for received messages.
47
/// During processing, and RCOIP message received by the preconfigured port and address
48
/// will be given to the RCRx object pointed to by _delegate
49
virtual
void
run
();
50
51
/// Send an RCOIP reply message to the sender of the current received message.
52
/// \param[in] msg Pointer to the RCOP message.
53
/// \param[in] len Length of the RCOIP message in bytes.
54
virtual
void
sendReply
(uint8_t* msg, uint16_t len);
55
};
56
57
#endif
RCOIP_DEFAULT_RECEIVER_UDP_PORT
#define RCOIP_DEFAULT_RECEIVER_UDP_PORT
Definition:
RCOIP.h:180
RCOIP.h
ESP8266Transceiver
Defines a WiSHield RCOIP Transceiver.
Definition:
ESP8266Transceiver.h:33
ESP8266Transceiver::init
virtual void init()
ESP8266Transceiver::sendReply
virtual void sendReply(uint8_t *msg, uint16_t len)
ESP8266Transceiver::run
virtual void run()
Transceiver
Abstract base class for a transceiver device that will send and receive messages on behalf of RCRx cl...
Definition:
Transceiver.h:25
ESP8266Transceiver::ESP8266Transceiver
ESP8266Transceiver()
Transceiver::receivedRequest
virtual void receivedRequest(uint8_t *msg, uint16_t len, uint16_t rssi=0)
Definition:
Transceiver.cpp:18
Generated by
1.8.17