0.01.00
link.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, The OpenThread Authors.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * 3. Neither the name of the copyright holder nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
28 
35 #ifndef OPENTHREAD_LINK_H_
36 #define OPENTHREAD_LINK_H_
37 
38 #include <openthread/types.h>
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
63 typedef void (OTCALL *otHandleActiveScanResult)(otActiveScanResult *aResult, void *aContext);
64 
78 OTAPI otError OTCALL otLinkActiveScan(otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration,
79  otHandleActiveScanResult aCallback, void *aCallbackContext);
80 
89 
98 typedef void (OTCALL *otHandleEnergyScanResult)(otEnergyScanResult *aResult, void *aContext);
99 
113 OTAPI otError OTCALL otLinkEnergyScan(otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration,
114  otHandleEnergyScanResult aCallback, void *aCallbackContext);
115 
125 
138 
152 
162 OTAPI uint8_t OTCALL otLinkGetChannel(otInstance *aInstance);
163 
180 OTAPI otError OTCALL otLinkSetChannel(otInstance *aInstance, uint8_t aChannel);
181 
190 
204 OTAPI otError OTCALL otLinkSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtAddress);
205 
214 
224 
232 OTAPI void OTCALL otLinkSetMaxTransmitPower(otInstance *aInstance, int8_t aPower);
233 
244 
262 
272 OTAPI uint32_t OTCALL otLinkGetPollPeriod(otInstance *aInstance);
273 
285 OTAPI void OTCALL otLinkSetPollPeriod(otInstance *aInstance, uint32_t aPollPeriod);
286 
295 
315 
337 
360 OTAPI otError OTCALL otLinkFilterAddAddress(otInstance *aInstance, const otExtAddress *aExtAddress);
361 
383 OTAPI otError OTCALL otLinkFilterRemoveAddress(otInstance *aInstance, const otExtAddress *aExtAddress);
384 
402 
427  otMacFilterIterator *aIterator, otMacFilterEntry *aEntry);
428 
453 OTAPI otError OTCALL otLinkFilterAddRssIn(otInstance *aInstance, const otExtAddress *aExtAddress, int8_t aRss);
454 
478 OTAPI otError OTCALL otLinkFilterRemoveRssIn(otInstance *aInstance, const otExtAddress *aExtAddress);
479 
497 
523  otMacFilterIterator *aIterator, otMacFilterEntry *aEntry);
524 
534 uint8_t otLinkConvertRssToLinkQuality(otInstance *aInstance, int8_t aRss);
535 
545 int8_t otLinkConvertLinkQualityToRss(otInstance *aInstance, uint8_t aLinkQuality);
546 
555 
568 typedef void (*otLinkPcapCallback)(const otRadioFrame *aFrame, void *aContext);
569 
579 void otLinkSetPcapCallback(otInstance *aInstance, otLinkPcapCallback aPcapCallback, void *aCallbackContext);
580 
590 bool otLinkIsPromiscuous(otInstance *aInstance);
591 
605 otError otLinkSetPromiscuous(otInstance *aInstance, bool aPromiscuous);
606 
612 #ifdef __cplusplus
613 } // extern "C"
614 #endif
615 
616 #endif // OPENTHREAD_LINK_H_
This struct represents an energy scan result.
Definition: types.h:542
This type represents all the static / global variables used by OpenThread allocated in one place...
Definition: openthread-instance.h:59
This file defines the types and structures used in the OpenThread library API.
This file defines the radio interface for OpenThread.
otMacFilterAddressMode
Defines address mode of the mac filter.
Definition: types.h:889
uint16_t otPanId
This type represents the IEEE 802.15.4 PAN ID.
Definition: types.h:388
This structure represents an IEEE 802.15.4 radio frame.
Definition: radio.h:99
uint16_t otShortAddress
This type represents the IEEE 802.15.4 Short Address.
Definition: types.h:394
uint8_t otMacFilterIterator
Used to iterate through mac filter entries.
Definition: types.h:884
This struct represents a received IEEE 802.15.4 Beacon.
Definition: types.h:522
This type represents the IEEE 802.15.4 Extended Address.
Definition: types.h:402
This structure represents a Mac Filter entry.
Definition: types.h:900
This structure represents the MAC layer counters.
Definition: types.h:1011
#define OTCALL
Compiler-specific modifier to export functions in a DLL.
Definition: toolchain.h:217
#define OTAPI
Compiler-specific modifier for public API declarations.
Definition: toolchain.h:216
otError
This enumeration represents error codes used throughout OpenThread.
Definition: types.h:107