Ethernet Network Library
Dependencies: NetworkingCoreLib
Dependents: EthernetHTTPClientTest
EthernetNetwork.h
00001 /* EthernetNetwork.h */ 00002 /* 00003 Copyright (C) 2012 ARM Limited. 00004 00005 Permission is hereby granted, free of charge, to any person obtaining a copy of 00006 this software and associated documentation files (the "Software"), to deal in 00007 the Software without restriction, including without limitation the rights to 00008 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 00009 of the Software, and to permit persons to whom the Software is furnished to do 00010 so, subject to the following conditions: 00011 00012 The above copyright notice and this permission notice shall be included in all 00013 copies or substantial portions of the Software. 00014 00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00018 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00019 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00020 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 00021 SOFTWARE. 00022 */ 00023 00024 #ifndef ETHERNETNETWORK_H_ 00025 #define ETHERNETNETWORK_H_ 00026 00027 00028 #include "core/fwk.h" 00029 00030 #include "rtos.h" 00031 00032 #include "LwIPInterface.h" 00033 00034 #include "lwip/netif.h" 00035 00036 /** Interface using Ethernet to connect to an IP-based network 00037 * 00038 */ 00039 class EthernetNetwork : public LwIPInterface 00040 { 00041 public: 00042 EthernetNetwork(); 00043 00044 int init(); //With DHCP 00045 00046 int init(const char* ip, const char* mask, const char* gateway, const char* dns1, const char* dns2); //No DHCP 00047 00048 virtual int connect(); 00049 virtual int disconnect(); 00050 00051 private: 00052 static void phySupervisorCb(void const* ctx); 00053 00054 RtosTimer m_supervisor; 00055 struct netif m_lpcNetif; 00056 bool m_useDHCP; 00057 bool m_linkUp; 00058 }; 00059 00060 #endif /* ETHERNETNETWORK_H_ */
Generated on Fri Jul 15 2022 09:24:11 by 1.7.2