Mistake on this page?
Report an issue in GitHub or email us
NanostackEthernetInterface.h
1 /*
2  * Copyright (c) 2016 ARM Limited. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  * Licensed under the Apache License, Version 2.0 (the License); you may
5  * not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef NANOSTACKETHERNETINTERFACE_H
18 #define NANOSTACKETHERNETINTERFACE_H
19 
20 #include "EthInterface.h"
21 #include "MeshInterfaceNanostack.h"
22 #include "NanostackEthernetPhy.h"
23 
25 public:
26  virtual nsapi_error_t bringup(bool dhcp, const char *ip,
27  const char *netmask, const char *gw,
28  nsapi_ip_stack_t stack = DEFAULT_STACK,
29  bool blocking = true);
30  virtual nsapi_error_t bringdown();
31 
32 private:
33  friend class Nanostack;
34  friend class NanostackEthernetInterface;
36  nsapi_error_t initialize();
37 protected:
38  NanostackEthernetPhy &get_phy() const
39  {
40  return static_cast<NanostackEthernetPhy &>(Interface::get_phy());
41  }
42 };
43 
44 /** Ethernet interface for Nanostack.
45  *
46  * Configure Nanostack to use Ethernet connectivity.
47  */
48 class NanostackEthernetInterface : public InterfaceNanostack, public EthInterface, private mbed::NonCopyable<NanostackEthernetInterface> {
49 public:
51  //NanostackEthernetInterface(NanostackEthernetPhy *phy);
52 
53  nsapi_error_t initialize(NanostackEthernetPhy *phy);
54 
55 protected:
56  Nanostack::EthernetInterface *get_interface() const
57  {
58  return static_cast<Nanostack::EthernetInterface *>(_interface);
59  }
60  virtual nsapi_error_t do_initialize();
61 
62 };
63 
64 #endif // NANOSTACKETHERNETINTERFACE_H
virtual nsapi_error_t bringdown()
Disconnect interface from the network.
signed int nsapi_error_t
Type used to represent error codes.
Definition: nsapi_types.h:95
Prevents generation of copy constructor and copy assignment operator in derived classes.
Definition: NonCopyable.h:169
Ethernet interface for Nanostack.
Ethernet PHY driver class for Nanostack.
virtual nsapi_error_t bringup(bool dhcp, const char *ip, const char *netmask, const char *gw, nsapi_ip_stack_t stack=DEFAULT_STACK, bool blocking=true)
Connect the interface to the network.
Common interface between Ethernet hardware.
Definition: EthInterface.h:29
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.