Alvaro Cassinelli / Mbed 2 deprecated laserUI

Dependencies:   mbed

Fork of skinGames_forktest by Alvaro Cassinelli

Committer:
mbedalvaro
Date:
Wed Mar 28 14:40:01 2012 +0000
Revision:
0:345b3bc7a0ea
This version (using rigid frame, base and child classes, etc) works, but the blob is strangely smaller. Need to check this.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbedalvaro 0:345b3bc7a0ea 1
mbedalvaro 0:345b3bc7a0ea 2 /*
mbedalvaro 0:345b3bc7a0ea 3 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
mbedalvaro 0:345b3bc7a0ea 4
mbedalvaro 0:345b3bc7a0ea 5 Permission is hereby granted, free of charge, to any person obtaining a copy
mbedalvaro 0:345b3bc7a0ea 6 of this software and associated documentation files (the "Software"), to deal
mbedalvaro 0:345b3bc7a0ea 7 in the Software without restriction, including without limitation the rights
mbedalvaro 0:345b3bc7a0ea 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
mbedalvaro 0:345b3bc7a0ea 9 copies of the Software, and to permit persons to whom the Software is
mbedalvaro 0:345b3bc7a0ea 10 furnished to do so, subject to the following conditions:
mbedalvaro 0:345b3bc7a0ea 11
mbedalvaro 0:345b3bc7a0ea 12 The above copyright notice and this permission notice shall be included in
mbedalvaro 0:345b3bc7a0ea 13 all copies or substantial portions of the Software.
mbedalvaro 0:345b3bc7a0ea 14
mbedalvaro 0:345b3bc7a0ea 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
mbedalvaro 0:345b3bc7a0ea 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
mbedalvaro 0:345b3bc7a0ea 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
mbedalvaro 0:345b3bc7a0ea 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
mbedalvaro 0:345b3bc7a0ea 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
mbedalvaro 0:345b3bc7a0ea 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
mbedalvaro 0:345b3bc7a0ea 21 THE SOFTWARE.
mbedalvaro 0:345b3bc7a0ea 22 */
mbedalvaro 0:345b3bc7a0ea 23
mbedalvaro 0:345b3bc7a0ea 24 #ifndef NETIF_H
mbedalvaro 0:345b3bc7a0ea 25 #define NETIF_H
mbedalvaro 0:345b3bc7a0ea 26
mbedalvaro 0:345b3bc7a0ea 27 #include "core/ipaddr.h"
mbedalvaro 0:345b3bc7a0ea 28 /*
mbedalvaro 0:345b3bc7a0ea 29 #include "nettcpsocket.h"
mbedalvaro 0:345b3bc7a0ea 30 #include "netudpsocket.h"
mbedalvaro 0:345b3bc7a0ea 31 #include "netdnsrequest.h"
mbedalvaro 0:345b3bc7a0ea 32 */
mbedalvaro 0:345b3bc7a0ea 33 class NetTcpSocket;
mbedalvaro 0:345b3bc7a0ea 34 class NetUdpSocket;
mbedalvaro 0:345b3bc7a0ea 35 class NetDnsRequest;
mbedalvaro 0:345b3bc7a0ea 36
mbedalvaro 0:345b3bc7a0ea 37 #if 0
mbedalvaro 0:345b3bc7a0ea 38 enum NetifEvent
mbedalvaro 0:345b3bc7a0ea 39 {
mbedalvaro 0:345b3bc7a0ea 40 NETIF_CONNECTED, //Connected, can create & use sockets now
mbedalvaro 0:345b3bc7a0ea 41 NETIF_DNSREPLY,
mbedalvaro 0:345b3bc7a0ea 42 NETIF_DISCONNECTED
mbedalvaro 0:345b3bc7a0ea 43 };
mbedalvaro 0:345b3bc7a0ea 44 #endif
mbedalvaro 0:345b3bc7a0ea 45
mbedalvaro 0:345b3bc7a0ea 46 class NetIf
mbedalvaro 0:345b3bc7a0ea 47 {
mbedalvaro 0:345b3bc7a0ea 48 public:
mbedalvaro 0:345b3bc7a0ea 49 NetIf();
mbedalvaro 0:345b3bc7a0ea 50 virtual ~NetIf();
mbedalvaro 0:345b3bc7a0ea 51 virtual NetTcpSocket* tcpSocket() = 0; //Create a new tcp socket
mbedalvaro 0:345b3bc7a0ea 52 virtual NetUdpSocket* udpSocket() = 0; //Create a new udp socket
mbedalvaro 0:345b3bc7a0ea 53 virtual void poll() = 0;
mbedalvaro 0:345b3bc7a0ea 54 virtual NetDnsRequest* dnsRequest(const char* hostname) = 0; //Create a new NetDnsRequest object
mbedalvaro 0:345b3bc7a0ea 55 virtual NetDnsRequest* dnsRequest(Host* pHost) = 0; //Create a new NetDnsRequest object
mbedalvaro 0:345b3bc7a0ea 56
mbedalvaro 0:345b3bc7a0ea 57 //!Returns the IP of the interface once it's connected
mbedalvaro 0:345b3bc7a0ea 58 IpAddr getIp() const;
mbedalvaro 0:345b3bc7a0ea 59
mbedalvaro 0:345b3bc7a0ea 60 protected:
mbedalvaro 0:345b3bc7a0ea 61 IpAddr m_ip;
mbedalvaro 0:345b3bc7a0ea 62 };
mbedalvaro 0:345b3bc7a0ea 63
mbedalvaro 0:345b3bc7a0ea 64 #endif