Atmel Software Framework

avr32/applications/evk1100-control-panel/network/ethernet.h File Reference
#include "supervisor.h"
#include "shell.h"

Functions

eExecStatus e_ethernet_cmd_get_config (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The set sensor config command: set the value of a config field of a sensor. Takes three parameters. The first parameter is the sensor's name, the second parameter is the config field name, the third parameter is the value. Format: set_sensor_config sensorname field=value. More...
 
eExecStatus e_ethernet_cmd_set_config (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The get sensor config command: get the config fields value of a sensor. Takes one parameter, that is the sensor's name. Format: get_sensor_config sensorname. More...
 
eExecStatus e_ip_stat (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The development only ip statck stats: display the TCP/IP stack stats on COM2. No parameters. Format: ipstat. More...
 
 portTASK_FUNCTION (vStartEthernetTask, pvParameters)
 configure lwIP and MACB, start lwIP layer, start servers tasks through lwIP services. More...
 
void v_ethernet_stopResources (void)
 Stop the Ethernet module resources. More...
 
void vEthernetGetGWAddr (portCHAR *pcConfig)
 get the current GW address : formatted as follow : XXX.XXX.XXX.XXX More...
 
void vEthernetGetIPAddr (portCHAR *pcConfig)
 get the current IP address : formatted as follow : XXX.XXX.XXX.XXX More...
 
void vEthernetGetMACAddr (portCHAR *pcConfig)
 get the current MAC address : formatted as follow : XX:XX:XX:XX:XX:XX More...
 
void vEthernetGetSubnetMask (portCHAR *pcConfig)
 get the current Subnet mask : formatted as follow : XXX.XXX.XXX.XXX More...
 
void vStartEthernetTaskLauncher (unsigned portBASE_TYPE uxPriority)
 Create the vStartEthernetTask task. More...
 

eExecStatus e_ethernet_cmd_get_config ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The set sensor config command: set the value of a config field of a sensor. Takes three parameters. The first parameter is the sensor's name, the second parameter is the config field name, the third parameter is the value. Format: set_sensor_config sensorname field=value.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdIgnored.
acInput. The argument counter. For this command, should be 3.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References buf, NULL, pvPortMalloc(), SHELL_ERRMSG_MEMALLOC, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, vEthernetGetGWAddr(), vEthernetGetIPAddr(), vEthernetGetMACAddr(), and vEthernetGetSubnetMask().

Referenced by e_syscmds_cmd_get_config().

eExecStatus e_ethernet_cmd_set_config ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The get sensor config command: get the config fields value of a sensor. Takes one parameter, that is the sensor's name. Format: get_sensor_config sensorname.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdIgnored.
acInput. The argument counter. For this command, should be 1.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References config_file_set_value(), ETHERNET_CONFIG_FILE, NULL, pvPortMalloc(), SHELL_ERRMSG_CONFIGERROR, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and SHELL_MSG_REBOOT.

Referenced by e_syscmds_cmd_set_config().

eExecStatus e_ip_stat ( eModId  xModId,
signed short  FsNavId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The development only ip statck stats: display the TCP/IP stack stats on COM2. No parameters. Format: ipstat.

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
FsNavIdIgnored.
acInput. The argument counter. Ignored.
avInput. The argument vector. Ignored
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References NULL, SHELL_EXECSTATUS_OK, and stats_display.

portTASK_FUNCTION ( vStartEthernetTask  ,
pvParameters   
)

configure lwIP and MACB, start lwIP layer, start servers tasks through lwIP services.

configure lwIP and MACB, start lwIP layer, start servers tasks through lwIP services.

Parameters
uxPriorityInput. priority for the task, it should be low

configure lwIP and MACB, start lwIP layer, start servers tasks through lwIP services.

Parameters
pvParametersInput; not used.
uxPriorityInput. priority for the task, it should be low

References CTRLPANEL_SMTP_CLIENT_PRIORITY, CTRLPANEL_SMTP_CLIENT_STACK_SIZE, CTRLPANEL_TFTP_SERVER_PRIORITY, CTRLPANEL_TFTP_SERVER_STACK_SIZE, CTRLPANEL_WEB_SERVER_PRIORITY, CTRLPANEL_WEB_SERVER_STACK_SIZE, gpio_enable_module(), lwipBASIC_SMTP_CLIENT_PRIORITY, lwipBASIC_SMTP_CLIENT_STACK_SIZE, lwipBASIC_TFTP_SERVER_PRIORITY, lwipBASIC_TFTP_SERVER_STACK_SIZE, lwipBASIC_WEB_SERVER_PRIORITY, lwipBASIC_WEB_SERVER_STACK_SIZE, NULL, prvlwIPInit(), sys_thread_new(), and vTaskDelete().

void v_ethernet_stopResources ( void  )

Stop the Ethernet module resources.

References vDisableMACBOperations().

Referenced by e_syscmds_reboot().

void vEthernetGetGWAddr ( portCHAR *  pcConfig)

get the current GW address : formatted as follow : XXX.XXX.XXX.XXX

Parameters
pcConfigInput/Output. The response string. If Input is NULL, no response string will be output. The caller has to allocate this buffer

References netif::gw, MACB_if, ntohl, NULL, and sprintf().

Referenced by e_ethernet_cmd_get_config().

void vEthernetGetIPAddr ( portCHAR *  pcConfig)

get the current IP address : formatted as follow : XXX.XXX.XXX.XXX

Parameters
pcConfigInput/Output. The response string. If Input is NULL, no response string will be output. The caller has to allocate this buffer

References netif::ip_addr, MACB_if, ntohl, NULL, and sprintf().

Referenced by e_ethernet_cmd_get_config(), and prvEthernetConfigureInterface().

void vEthernetGetMACAddr ( portCHAR *  pcConfig)

get the current MAC address : formatted as follow : XX:XX:XX:XX:XX:XX

Parameters
pcConfigInput/Output. The response string. If Input is NULL, no response string will be output. The caller has to allocate this buffer

References netif::hwaddr, MACB_if, NULL, and sprintf().

Referenced by e_ethernet_cmd_get_config().

void vEthernetGetSubnetMask ( portCHAR *  pcConfig)

get the current Subnet mask : formatted as follow : XXX.XXX.XXX.XXX

Parameters
pcConfigInput/Output. The response string. If Input is NULL, no response string will be output. The caller has to allocate this buffer

References MACB_if, netif::netmask, ntohl, NULL, and sprintf().

Referenced by e_ethernet_cmd_get_config().

void vStartEthernetTaskLauncher ( unsigned portBASE_TYPE  uxPriority)

Create the vStartEthernetTask task.

Parameters
uxPriorityInput; priority of the task to create.

References configMINIMAL_STACK_SIZE, NULL, and xTaskCreate.

Referenced by main(), and portTASK_FUNCTION().