12Oct2012MbedLab

Dependents:   Lab3_VoiceMeter

Fork of EthernetNetIf by Donatien Garnier

Committer:
psawant9
Date:
Fri Oct 12 16:02:00 2012 +0000
Revision:
6:22ce63eddd2b
Parent:
5:bc7df6da7589
Done

Who changed what in which revision?

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