WORKS

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by Maxim nexpaq

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers EthernetInterface.h Source File

EthernetInterface.h

00001 /* LWIP implementation of NetworkInterfaceAPI
00002  * Copyright (c) 2015 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef ETHERNET_INTERFACE_H
00018 #define ETHERNET_INTERFACE_H
00019 
00020 #include "nsapi.h"
00021 #include "rtos.h"
00022 #include "lwip/netif.h"
00023 
00024 // Forward declaration
00025 class NetworkStack;
00026 
00027 
00028 /** EthernetInterface class
00029  *  Implementation of the NetworkStack for LWIP
00030  */
00031 class EthernetInterface : public EthInterface
00032 {
00033 public:
00034     /** Start the interface
00035      *  @return             0 on success, negative on failure
00036      */
00037     virtual int connect();
00038 
00039     /** Stop the interface
00040      *  @return             0 on success, negative on failure
00041      */
00042     virtual int disconnect();
00043 
00044     /** Get the internally stored IP address
00045      *  @return             IP address of the interface or null if not yet connected
00046      */
00047     virtual const char *get_ip_address();
00048 
00049     /** Get the internally stored MAC address
00050      *  @return             MAC address of the interface
00051      */
00052     virtual const char *get_mac_address();
00053 
00054 protected:
00055     /** Provide access to the underlying stack
00056      *
00057      *  @return The underlying network stack 
00058      */
00059     virtual NetworkStack *get_stack();
00060 };
00061 
00062 
00063 #endif