TI-OpenThread  1.08.06.06
CC1352R1_LAUNCHXL/thread/cli_ftd/otstack.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  @file otstack.h
4 
5  @brief OpenThread network parameter definitions.
6 
7  Group: CMCU, LPC
8  Target Device: cc13xx_cc26xx
9 
10  ******************************************************************************
11 
12  Copyright (c) 2017-2022, Texas Instruments Incorporated
13  All rights reserved.
14 
15  Redistribution and use in source and binary forms, with or without
16  modification, are permitted provided that the following conditions
17  are met:
18 
19  * Redistributions of source code must retain the above copyright
20  notice, this list of conditions and the following disclaimer.
21 
22  * Redistributions in binary form must reproduce the above copyright
23  notice, this list of conditions and the following disclaimer in the
24  documentation and/or other materials provided with the distribution.
25 
26  * Neither the name of Texas Instruments Incorporated nor the names of
27  its contributors may be used to endorse or promote products derived
28  from this software without specific prior written permission.
29 
30  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
32  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
34  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
35  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
37  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
38  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
39  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
40  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 
42  ******************************************************************************
43 
44 
45  *****************************************************************************/
46 
47 #ifndef _OTSTACK_H_
48 #define _OTSTACK_H_
49 
50 #ifdef __cplusplus
51 extern "C"
52 {
53 #endif
54 /******************************************************************************
55  Includes
56  *****************************************************************************/
57 #include <openthread/config.h>
58 
59 /******************************************************************************
60  Typedefs
61  *****************************************************************************/
62 
63 /* OT Stack event Callback function typedef */
64 typedef void (*OtStack_EventsCallback_t)(uint8_t event, void *aContext);
65 
66 /******************************************************************************
67  Constants and definitions
68  *****************************************************************************/
69 
73 #define OT_STACK_EVENT_NWK_NOT_JOINED 0x01
74 #define OT_STACK_EVENT_NWK_JOIN_IN_PROGRESS 0x02
75 #define OT_STACK_EVENT_NWK_JOINED 0x03
76 #define OT_STACK_EVENT_NWK_JOINED_FAILURE 0x04
77 #define OT_STACK_EVENT_NWK_DATA_CHANGED 0x05
78 #define OT_STACK_EVENT_DEV_ROLE_CHANGED 0x06
79 
80 /******************************************************************************
81  External functions
82  *****************************************************************************/
83 
92 extern void handleNetifStateChanged(uint32_t aFlags, void *aContext);
93 
101 
108 extern uint8_t OtStack_joinState(void);
109 
117 extern void OtStack_joinNetwork(const char* pskd);
118 
125 extern void OtStack_joinConfiguredNetwork(void);
126 
135 extern bool OtStack_setupNetwork(void);
136 
145 extern bool OtStack_setupInterfaceAndNetwork(void);
146 
147 #ifdef __cplusplus
148 }
149 #endif
150 
151 #endif /* _OTSTACK_H_ */
bool OtStack_setupNetwork(void)
Allows the application to setup the thread network(thread protocol operation) after the device has su...
Definition: CC1352P_2_LAUNCHXL/thread/cli_ftd/otstack.c:246
uint8_t OtStack_joinState(void)
Returns the current network join event of the OpenThread stack.
Definition: CC1352P_2_LAUNCHXL/thread/cli_ftd/otstack.c:214
void OtStack_registerCallback(OtStack_EventsCallback_t appCB)
Allows the application to register callback for ot stack events.
Definition: CC1352P_2_LAUNCHXL/thread/cli_ftd/otstack.c:208
void(* OtStack_EventsCallback_t)(uint8_t event, void *aContext)
Definition: CC1352R1_LAUNCHXL/thread/cli_ftd/otstack.h:64
bool OtStack_setupInterfaceAndNetwork(void)
Allows the application to attempt to bring up the interface and setup the thread network (thread prot...
Definition: CC1352P_2_LAUNCHXL/thread/cli_ftd/otstack.c:266
void handleNetifStateChanged(uint32_t aFlags, void *aContext)
Callback function registered with the netif.
Definition: CC1352P_2_LAUNCHXL/thread/cli_ftd/otstack.c:188
void OtStack_joinConfiguredNetwork(void)
Allows the application to start the network join process via the commissioner using the pre-configure...
Definition: CC1352P_2_LAUNCHXL/thread/cli_ftd/otstack.c:233
void OtStack_joinNetwork(const char *pskd)
Allows the application to start the network join process via the commissioner.
Definition: CC1352P_2_LAUNCHXL/thread/cli_ftd/otstack.c:220
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale