Program the control the fischertechnik robo interface or intelligent interface via tcp socket or via a java gui.

Dependencies:   mbed ConfigFile

Committer:
networker
Date:
Wed May 04 15:42:13 2011 +0000
Revision:
1:2c9d412ad471
Parent:
0:7f26f0680202
first publication (mbed challenge submission)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
networker 0:7f26f0680202 1
networker 0:7f26f0680202 2 /*
networker 0:7f26f0680202 3 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
networker 0:7f26f0680202 4
networker 0:7f26f0680202 5 Permission is hereby granted, free of charge, to any person obtaining a copy
networker 0:7f26f0680202 6 of this software and associated documentation files (the "Software"), to deal
networker 0:7f26f0680202 7 in the Software without restriction, including without limitation the rights
networker 0:7f26f0680202 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
networker 0:7f26f0680202 9 copies of the Software, and to permit persons to whom the Software is
networker 0:7f26f0680202 10 furnished to do so, subject to the following conditions:
networker 0:7f26f0680202 11
networker 0:7f26f0680202 12 The above copyright notice and this permission notice shall be included in
networker 0:7f26f0680202 13 all copies or substantial portions of the Software.
networker 0:7f26f0680202 14
networker 0:7f26f0680202 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
networker 0:7f26f0680202 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
networker 0:7f26f0680202 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
networker 0:7f26f0680202 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
networker 0:7f26f0680202 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
networker 0:7f26f0680202 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
networker 0:7f26f0680202 21 THE SOFTWARE.
networker 0:7f26f0680202 22 */
networker 0:7f26f0680202 23
networker 0:7f26f0680202 24 #ifndef IPADDR_H
networker 0:7f26f0680202 25 #define IPADDR_H
networker 0:7f26f0680202 26
networker 0:7f26f0680202 27 #include "netCfg.h"
networker 0:7f26f0680202 28 #if NET_LWIP_STACK
networker 0:7f26f0680202 29 typedef struct ip_addr ip_addr_t;
networker 0:7f26f0680202 30 #endif
networker 0:7f26f0680202 31
networker 0:7f26f0680202 32 #include "stdint.h"
networker 0:7f26f0680202 33
networker 0:7f26f0680202 34 ///IP Address container
networker 0:7f26f0680202 35 /**
networker 0:7f26f0680202 36 This class is a container for an IPv4 address.
networker 0:7f26f0680202 37 */
networker 0:7f26f0680202 38 class IpAddr //Basically a C++ frontend to ip_addr_t
networker 0:7f26f0680202 39 {
networker 0:7f26f0680202 40 public:
networker 0:7f26f0680202 41 #if NET_LWIP_STACK
networker 0:7f26f0680202 42 IpAddr(ip_addr_t* pIp);
networker 0:7f26f0680202 43 #endif
networker 0:7f26f0680202 44
networker 0:7f26f0680202 45 ///Initializes IP address with provided values
networker 0:7f26f0680202 46 IpAddr(uint8_t ip0, uint8_t ip1, uint8_t ip2, uint8_t ip3);
networker 0:7f26f0680202 47
networker 0:7f26f0680202 48 ///Initializes IP address with null values
networker 0:7f26f0680202 49 IpAddr();
networker 0:7f26f0680202 50
networker 0:7f26f0680202 51 #if NET_LWIP_STACK
networker 0:7f26f0680202 52 ip_addr_t getStruct() const;
networker 0:7f26f0680202 53 #endif
networker 0:7f26f0680202 54
networker 0:7f26f0680202 55 ///Returns IP address byte #
networker 0:7f26f0680202 56 uint8_t operator[](unsigned int i) const;
networker 0:7f26f0680202 57
networker 0:7f26f0680202 58 ///Compares too addresses
networker 0:7f26f0680202 59 /**
networker 0:7f26f0680202 60 @return true if the two addresses are equal
networker 0:7f26f0680202 61 */
networker 0:7f26f0680202 62 bool isEq(const IpAddr& b) const;
networker 0:7f26f0680202 63
networker 0:7f26f0680202 64 ///Compares too addresses
networker 0:7f26f0680202 65 /**
networker 0:7f26f0680202 66 @return true if the two addresses are equal
networker 0:7f26f0680202 67 */
networker 0:7f26f0680202 68 bool operator==(const IpAddr& b) const;
networker 0:7f26f0680202 69
networker 0:7f26f0680202 70 ///Compares too addresses
networker 0:7f26f0680202 71 /**
networker 0:7f26f0680202 72 @return true if the two addresses are different
networker 0:7f26f0680202 73 */
networker 0:7f26f0680202 74 bool operator!=(const IpAddr& b) const;
networker 0:7f26f0680202 75
networker 0:7f26f0680202 76 ///Checks whether the address is null
networker 0:7f26f0680202 77 /**
networker 0:7f26f0680202 78 @return true if the address is null
networker 0:7f26f0680202 79 */
networker 0:7f26f0680202 80 bool isNull() const;
networker 0:7f26f0680202 81
networker 0:7f26f0680202 82 ///Checks whether the address is a broadcast address
networker 0:7f26f0680202 83 /**
networker 0:7f26f0680202 84 @return true if the address is a broadcast address
networker 0:7f26f0680202 85 */
networker 0:7f26f0680202 86 bool isBroadcast() const;
networker 0:7f26f0680202 87
networker 0:7f26f0680202 88 ///Checks whether the address is a multicast address
networker 0:7f26f0680202 89 /**
networker 0:7f26f0680202 90 @return true if the address is a multicast address
networker 0:7f26f0680202 91 */
networker 0:7f26f0680202 92 bool isMulticast() const;
networker 0:7f26f0680202 93
networker 0:7f26f0680202 94 private:
networker 0:7f26f0680202 95 uint8_t m_ip[4];
networker 0:7f26f0680202 96 };
networker 0:7f26f0680202 97
networker 0:7f26f0680202 98 #endif