Mbed OS Reference
Loading...
Searching...
No Matches
NanostackPhy.h
1/*
2 * Copyright (c) 2016, Arm Limited and affiliates.
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#ifndef NANOSTACK_PHY_H_
19#define NANOSTACK_PHY_H_
20
21class NanostackMACPhy;
22class NanostackPPPPhy;
23
24/** PHY driver class for Nanostack */
26public:
27
28 /** Register this physical interface with Nanostack
29 *
30 * @return Device driver ID or a negative error
31 * code on failure
32 */
33 virtual int8_t phy_register() = 0;
34
35 /** Return pointer to a NanostackMACPhy.
36 *
37 * @return Pointer to requested phy type or NULL if this
38 * class doesn't implement the phy.
39 */
41 {
42 return nullptr;
43 }
44
45 /** Return pointer to a NanostackPPPPhy.
46 *
47 * @return Pointer to requested phy type or NULL if this
48 * class doesn't implement the phy.
49 */
51 {
52 return nullptr;
53 }
54
55protected:
56 NanostackPhy() = default;
57 virtual ~NanostackPhy() = default;
58};
59
60#endif /* NANOSTACK_INTERFACE_H_ */
MAC PHY driver class for Nanostack.
PPP PHY driver class for Nanostack.
PHY driver class for Nanostack.
Definition: NanostackPhy.h:25
virtual NanostackMACPhy * nanostack_mac_phy()
Return pointer to a NanostackMACPhy.
Definition: NanostackPhy.h:40
virtual int8_t phy_register()=0
Register this physical interface with Nanostack.
virtual NanostackPPPPhy * nanostack_ppp_phy()
Return pointer to a NanostackPPPPhy.
Definition: NanostackPhy.h:50