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