The stack library includes code to perform system initialization based on the configuration. Initialization of the scheduling routines is performed by a network control layer called NETCTRL.
More...
The stack library includes code to perform system initialization based on the configuration. Initialization of the scheduling routines is performed by a network control layer called NETCTRL.
§ NC_PRIORITY_LOW
#define NC_PRIORITY_LOW OS_SCHEDULER_LOWPRI |
§ NC_PRIORITY_HIGH
#define NC_PRIORITY_HIGH OS_SCHEDULER_HIGHPRI |
§ NC_OPMODE_POLLING
#define NC_OPMODE_POLLING 1 |
§ NC_OPMODE_INTERRUPT
#define NC_OPMODE_INTERRUPT 2 |
§ NC_OPEN_SUCCESS
#define NC_OPEN_SUCCESS 0 |
§ NC_OPEN_ILLEGAL_PRIORITY
#define NC_OPEN_ILLEGAL_PRIORITY -1 |
§ NC_OPEN_ILLEGAL_OPMODE
#define NC_OPEN_ILLEGAL_OPMODE -2 |
§ NC_OPEN_MEMINIT_FAILED
#define NC_OPEN_MEMINIT_FAILED -3 |
Memory initialization failure
§ NC_OPEN_EVENTINIT_FAILED
#define NC_OPEN_EVENTINIT_FAILED -4 |
Event initialization failure
§ NC_SystemOpen()
int NC_SystemOpen |
( |
int |
Priority, |
|
|
int |
OpMode |
|
) |
| |
Initiate a system session.
This is the first function that should be called when using the stack. It initializes the stack's memory manager, and the OS (or OS adaptation layer). It also configures the network event scheduler's task priority and operating mode.
- Parameters
-
[in] | Priority | Network event scheduler task priority |
[in] | OpMode | Network event scheduler operating mode |
- Returns
- Success: 0
-
Failure:
- See also
- NC_SystemClose()
§ NC_SystemClose()
Shutdown the system.
This is the last function that should be called when using the stack. It shuts down the memory manager and performs a final memory analysis.
- See also
- NC_SystemOpen()
§ NC_NetStart()
int NC_NetStart |
( |
void * |
hCfg, |
|
|
void(*)() |
NetStartCb, |
|
|
void(*)() |
NetStopCb, |
|
|
void(*)(uint32_t, uint32_t, uint32_t) |
NetIPCb |
|
) |
| |
Start network.
This function is called to boot up the network using the network configuration supplied in hCfg
. Along with the network configuration, three callback function pointers are provided. These callback functions are called at distinct times.
NetStartCb
is called when the system is first ready for the creation of application supplied network tasks.
NetStopCb
is called when the network is about to shut down.
NetIPCb
is called when an IP address is added or removed from the system.
If any of these callback functions are not required, the function pointers can be set to NULL.
- Parameters
-
[in] | hCfg | Handle to network configuration |
[in] | NetStartCb | Optional pointer to callback function called when network stack is started |
[in] | NetStopCb | Optional pointer to callback function called when network is stopped |
[in] | NetIPCb | Optional pointer to callback function called when an IP address is added or removed from the system |
- Returns
- The integer passed to NC_NetStop()
- See also
- NC_NetStop()
§ NC_NetStop()
void NC_NetStop |
( |
int |
rc | ) |
|
Stop the network.
This function is called to shut down a network initiated with NC_NetStart(). The return value supplied in the StopCode parameter becomes the return value for NC_NetStart(). See the description of NC_NetStart() for more detail.
- Parameters
-
- See also
- NC_NetStart()