Mbed OS Reference
Loading...
Searching...
No Matches
NanostackRfPhy.h
1/*
2 * Copyright (c) 2016-2017, 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_RF_PHY_H_
19#define NANOSTACK_RF_PHY_H_
20
21#include "NanostackMACPhy.h"
22
23/** Radio PHY driver class for Nanostack */
25public:
26
27 /** Return the default on-board NanostackRfPhy
28 *
29 * Returns the default on-board NanostackRfPhy - this will be target-specific, and
30 * may not be available on all targets.
31 */
33
34 /** Register this physical interface with Nanostack
35 *
36 * @return Device driver ID or a negative error
37 * code on failure
38 */
39 virtual int8_t rf_register() = 0;
40
41 /** Unregister this physical interface
42 *
43 */
44 virtual void rf_unregister() = 0;
45
46 /** Register this physical interface with Nanostack
47 *
48 * @return Device driver ID or a negative error
49 * code on failure
50 */
51 int8_t phy_register() override
52 {
53 return rf_register();
54 }
55
56 /** Unregister this physical interface
57 *
58 */
59 virtual void unregister()
60 {
62 }
63};
64
65#endif /* NANOSTACK_RF_PHY_H_ */
MAC PHY driver class for Nanostack.
Radio PHY driver class for Nanostack.
int8_t phy_register() override
Register this physical interface with Nanostack.
static NanostackRfPhy & get_default_instance()
Return the default on-board NanostackRfPhy.
virtual void rf_unregister()=0
Unregister this physical interface.
virtual int8_t rf_register()=0
Register this physical interface with Nanostack.
virtual void unregister()
Unregister this physical interface.