A device’s input/output control/IO_Ctrl() function is used to implement miscellaneous functionality such as setting and getting the link state. An optional void pointer to a data variable is passed into the function and may be used to get device parameters from the caller, or to return device parameters to the caller.
Files
Every Wireless Manager layer net_wifi_mgr.c
Prototype
static void NetWiFiMgr_IO_Ctrl (NET_IF *p_if, CPU_INT08U opt, void *p_data, NET_ERR *p_err);
Note that since every Wireless Manager’s IO_Ctrl()
function is accessed only by function pointer via the Wireless Manager’s API structure, it doesn’t need to be globally available and should therefore be declared as ‘static
’.
Arguments
p_if
Pointer to the interface to handle network device I/O operations.
opt
I/O operation to perform.
p_data
A pointer to a variable containing the data necessary to perform the operation or a pointer to a variable to store data associated with the result of the operation.
p_err
Pointer to variable that will receive the return error code from this function.
Returned Values
None.
Required Configuration
None.
Notes/Warnings
μC/TCP-IP defines the following default options:
NET_DEV_LINK_STATE_GET_INFO
NET_DEV_LINK_STATE_UPDATE
The NET_DEV_LINK_STATE_GET_INFO
option expects p_data
to point to a variable of type NET_DEV_LINK_WIFI
for the case of an Ethernet driver. This variable has one field, link state, which are filled in by the device driver API. μC/TCP-IP internally uses this option code in order to periodically poll the driver for linkstate.