LWIPBP3595Interface library for mbed-os.
Dependents: LWIPBP3595Interface_STA_for_mbed-os
Fork of LWIPBP3595Interface by
LWIPBP3595Interface.h@1:abb17eced903, 2016-05-31 (annotated)
- Committer:
- tousaki
- Date:
- Tue May 31 05:56:27 2016 +0000
- Revision:
- 1:abb17eced903
- Parent:
- 0:a933851e5d22
- Child:
- 2:c7e325599570
Fixed the return type of connect()
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tousaki | 0:a933851e5d22 | 1 | /* LWIPBP3595Interface.h */ |
tousaki | 0:a933851e5d22 | 2 | /* Copyright (C) 2016 Grape Systems, Inc. */ |
tousaki | 0:a933851e5d22 | 3 | /* The base file is LWIPInterface.h. */ |
tousaki | 0:a933851e5d22 | 4 | |
tousaki | 0:a933851e5d22 | 5 | /* LWIPInterface.h */ |
tousaki | 0:a933851e5d22 | 6 | /* LWIP implementation of NetworkInterfaceAPI |
tousaki | 0:a933851e5d22 | 7 | * Copyright (c) 2015 ARM Limited |
tousaki | 0:a933851e5d22 | 8 | * |
tousaki | 0:a933851e5d22 | 9 | * Licensed under the Apache License, Version 2.0 (the "License"); |
tousaki | 0:a933851e5d22 | 10 | * you may not use this file except in compliance with the License. |
tousaki | 0:a933851e5d22 | 11 | * You may obtain a copy of the License at |
tousaki | 0:a933851e5d22 | 12 | * |
tousaki | 0:a933851e5d22 | 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
tousaki | 0:a933851e5d22 | 14 | * |
tousaki | 0:a933851e5d22 | 15 | * Unless required by applicable law or agreed to in writing, software |
tousaki | 0:a933851e5d22 | 16 | * distributed under the License is distributed on an "AS IS" BASIS, |
tousaki | 0:a933851e5d22 | 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
tousaki | 0:a933851e5d22 | 18 | * See the License for the specific language governing permissions and |
tousaki | 0:a933851e5d22 | 19 | * limitations under the License. |
tousaki | 0:a933851e5d22 | 20 | */ |
tousaki | 0:a933851e5d22 | 21 | |
tousaki | 0:a933851e5d22 | 22 | #ifndef LWIP_BP3595_INTERFACE_H |
tousaki | 0:a933851e5d22 | 23 | #define LWIP_BP3595_INTERFACE_H |
tousaki | 0:a933851e5d22 | 24 | |
tousaki | 0:a933851e5d22 | 25 | #include "LWIPInterface.h" |
tousaki | 0:a933851e5d22 | 26 | #include "WiFiInterface.h" |
tousaki | 0:a933851e5d22 | 27 | |
tousaki | 0:a933851e5d22 | 28 | |
tousaki | 0:a933851e5d22 | 29 | /** LWIPBP3595Interface class |
tousaki | 0:a933851e5d22 | 30 | * Implementation of the NetworkInterface for LWIP |
tousaki | 0:a933851e5d22 | 31 | */ |
tousaki | 0:a933851e5d22 | 32 | class LWIPBP3595Interface : public LWIPInterface |
tousaki | 0:a933851e5d22 | 33 | { |
tousaki | 0:a933851e5d22 | 34 | public: |
tousaki | 0:a933851e5d22 | 35 | |
tousaki | 0:a933851e5d22 | 36 | /** Start the interface |
tousaki | 0:a933851e5d22 | 37 | * @param ssid Name of the network to connect to |
tousaki | 0:a933851e5d22 | 38 | * @param pass Security passphrase to connect to the network |
tousaki | 0:a933851e5d22 | 39 | * @param security Type of encryption to connect with |
tousaki | 0:a933851e5d22 | 40 | * @return 0 on success |
tousaki | 0:a933851e5d22 | 41 | */ |
tousaki | 0:a933851e5d22 | 42 | virtual int connect( |
tousaki | 0:a933851e5d22 | 43 | const char *ssid, |
tousaki | 0:a933851e5d22 | 44 | const char *pass, |
tousaki | 0:a933851e5d22 | 45 | nsapi_security_t security = NSAPI_SECURITY_WPA2); |
tousaki | 0:a933851e5d22 | 46 | |
tousaki | 0:a933851e5d22 | 47 | virtual int disconnect(); |
tousaki | 0:a933851e5d22 | 48 | |
tousaki | 0:a933851e5d22 | 49 | /** Get the internally stored IP address |
tousaki | 0:a933851e5d22 | 50 | * @return IP address of the interface or null if not yet connected |
tousaki | 0:a933851e5d22 | 51 | */ |
tousaki | 0:a933851e5d22 | 52 | virtual const char *get_ip_address(); |
tousaki | 0:a933851e5d22 | 53 | |
tousaki | 0:a933851e5d22 | 54 | /** Get the internally stored MAC address |
tousaki | 0:a933851e5d22 | 55 | * @return MAC address of the interface |
tousaki | 0:a933851e5d22 | 56 | */ |
tousaki | 0:a933851e5d22 | 57 | virtual const char *get_mac_address(); |
tousaki | 0:a933851e5d22 | 58 | |
tousaki | 0:a933851e5d22 | 59 | private: |
tousaki | 0:a933851e5d22 | 60 | // Implementation of EthernetInterface |
tousaki | 1:abb17eced903 | 61 | virtual int connect() {return 0;} |
tousaki | 0:a933851e5d22 | 62 | |
tousaki | 0:a933851e5d22 | 63 | }; |
tousaki | 0:a933851e5d22 | 64 | |
tousaki | 0:a933851e5d22 | 65 | |
tousaki | 0:a933851e5d22 | 66 | #endif |