Network Developers Kit API  3.75.00.20
netctrl.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2020, Texas Instruments Incorporated
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
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * */
32 /*
33  * ======== netctrl.h ========
34  *
35  * Shell functions for simplified net startup and shutdown
36  *
37  * The idea behind this API is to hide the user callable HAL/STACK functions
38  *
39  */
51 #ifndef _C_NETCTRL_INC
52 #define _C_NETCTRL_INC
53 
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 /* NETCTRL is used to initialize the stack and maintain services. To */
62 /* accomplish this, it makes use of the configuration manager provided */
63 /* in the NETTOOLS library. Note that the configuration definitions and */
64 /* structures defined here are specific to NETCTRL, not CONFIG. */
65 
66 /* NETCTRL Access Functions */
67 
102 extern int NC_SystemOpen( int Priority, int OpMode );
103 
104 #define NC_PRIORITY_LOW OS_SCHEDULER_LOWPRI
105 #define NC_PRIORITY_HIGH OS_SCHEDULER_HIGHPRI
106 
107 #define NC_OPMODE_POLLING 1
108 #define NC_OPMODE_INTERRUPT 2
109 
110 #define NC_OPEN_SUCCESS 0
111 #define NC_OPEN_ILLEGAL_PRIORITY -1
112 #define NC_OPEN_ILLEGAL_OPMODE -2
113 #define NC_OPEN_MEMINIT_FAILED -3
114 #define NC_OPEN_EVENTINIT_FAILED -4
126 extern void NC_SystemClose();
127 
207 extern int NC_NetStart(void *hCfg, void (*NetStartCb)(),
208  void (*NetStopCb)(), void (*NetIPCb)(uint32_t, uint32_t, uint32_t));
209 
222 extern void NC_NetStop( int rc );
223 
226 /* Called when Boot thread has completed */
227 extern void NC_BootComplete();
228 
229 /* Called when IP address is added or removed */
230 extern void NC_IPUpdate( uint32_t IPAddr, uint32_t IfIdx, uint32_t fAdd );
231 
232 /* Called to set the user function that's called when link goes up/down */
233 extern void NC_setLinkHook( void (*LinkHook)(int) );
234 
238 #ifdef __cplusplus
239 }
240 #endif /* extern "C" */
241 
242 #endif
int NC_NetStart(void *hCfg, void(*NetStartCb)(), void(*NetStopCb)(), void(*NetIPCb)(uint32_t, uint32_t, uint32_t))
Start network.
void NC_NetStop(int rc)
Stop the network.
int NC_SystemOpen(int Priority, int OpMode)
Initiate a system session.
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale