Mbed OS Reference
Loading...
Searching...
No Matches
EthInterface.h
1/*
2 * Copyright (c) 2015 ARM Limited
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/* @file EthInterface.h Common interface between Ethernet hardware */
19/** \addtogroup netinterface */
20/** @{*/
21
22#ifndef ETH_INTERFACE_H
23#define ETH_INTERFACE_H
24
26
27
28/** Common interface between Ethernet hardware.
29 */
30class EthInterface : public virtual NetworkInterface {
31public:
32
33 /** @copydoc NetworkInterface::ethInterface
34 */
36 {
37 return this;
38 }
39
40 /** Get the default Ethernet interface.
41 *
42 * This is provided as a weak method so applications can override it.
43 * Default behavior is to get the target's default interface, if
44 * any.
45 *
46 * @return Pointer to interface, if one exists.
47 */
49
50#if !defined(DOXYGEN_ONLY)
51protected:
52
53 /** Get the target's default Ethernet interface.
54 *
55 * This is provided as a weak method so targets can override it. The
56 * default implementation invokes EthernetInterface with the
57 * default EMAC and default network stack, if DEVICE_EMAC is set.
58 *
59 * @return Pointer to interface, if one exists.
60 */
61 static EthInterface *get_target_default_instance();
62#endif //!defined(DOXYGEN_ONLY)
63};
64
65
66#endif
67
68/** @}*/
Network Interface base class.
Common interface between Ethernet hardware.
Definition: EthInterface.h:30
static EthInterface * get_default_instance()
Get the default Ethernet interface.
EthInterface * ethInterface() final
Return pointer to an EthInterface.
Definition: EthInterface.h:35
Common interface that is shared between network devices.