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