#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#include "usbsys.h"
#include "conf_usb.h"
#include "usb_drv.h"
#include "usb_task.h"
#include "device_mass_storage_task.h"
#include "host_mass_storage_task.h"
#include "shell.h"
Macros | |
#define | MSG_BUS_POWERED "Device is bus-powered"CRLF |
#define | MSG_COPY_CFG_TO_LOCAL "Copying the /CFG directory from the USB key"CRLF |
#define | MSG_COPY_LOGS_TO_KEY "Copying the log files to the USB key"CRLF |
#define | MSG_COPY_WEB_TO_LOCAL "Copying the /WEB directory from the USB key"CRLF |
#define | MSG_DEVICE_FULL_SPEED "Device is full-speed"CRLF |
#define | MSG_DEVICE_LOW_SPEED "Device is low-speed"CRLF |
#define | MSG_KO "KO"CRLF |
#define | MSG_MOVE_LOGS_TO_KEY "Moving the log files to the USB key"CRLF |
#define | MSG_NO_DEVICE "No supported device connected"CRLF |
#define | MSG_OK "OK"CRLF |
#define | MSG_REMOTE_WAKEUP_KO "Device does not support remote wake-up"CRLF |
#define | MSG_REMOTE_WAKEUP_OK "Device supports remote wake-up"CRLF |
#define | MSG_SELF_POWERED "Device is self-powered"CRLF |
#define | MSG_USB_SUSPENDED "USB is suspended!"CRLF |
Functions | |
bool | b_usbsys_start (void) |
eExecStatus | e_usbsys_cp_cfg_to_local (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply) |
In host mode, copy the /CFG directory content of the USB MS key to the Control Panel /CFG directory. No parameters. Format: cp_cfg_to_local. More... | |
eExecStatus | e_usbsys_cp_logs_to_key (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply) |
In host mode, copy the /LOG directory to the USB MS key. No parameters. Format: cp_logs_to_ukey. More... | |
eExecStatus | e_usbsys_cp_web_to_local (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply) |
In host mode, copy the /WEB directory content of the USB MS key to the Control Panel /WEB directory. No parameters. Format: cp_web_to_local. More... | |
eExecStatus | e_usbsys_lsusb (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply) |
In host mode, display basic low-level information about the connected device. The device should be supported by the host (configured). No parameters. Format: lsusb. More... | |
eExecStatus | e_usbsys_mv_logs_to_key (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply) |
In host mode, move the /LOG directory content to the USB MS key. No parameters. Format: mv_logs_to_ukey. More... | |
static eExecStatus | prv_e_usbsys_sync_cp_ukey (eModId xModId, signed short FsNavId, signed portCHAR **ppcStringReply, signed portCHAR *pcStringMsgAction, U8 sync_direction, const char *pcdir_name, bool bDeleteSrc) |
Common synchronization function between the Control Panel and a USB key. More... | |
int | sprintf (char *out, const char *format,...) |
#define MSG_BUS_POWERED "Device is bus-powered"CRLF |
Referenced by e_usbsys_lsusb().
#define MSG_COPY_CFG_TO_LOCAL "Copying the /CFG directory from the USB key"CRLF |
Referenced by e_usbsys_cp_cfg_to_local().
#define MSG_COPY_LOGS_TO_KEY "Copying the log files to the USB key"CRLF |
Referenced by e_usbsys_cp_logs_to_key().
#define MSG_COPY_WEB_TO_LOCAL "Copying the /WEB directory from the USB key"CRLF |
Referenced by e_usbsys_cp_web_to_local().
#define MSG_DEVICE_FULL_SPEED "Device is full-speed"CRLF |
Referenced by e_usbsys_lsusb().
#define MSG_DEVICE_LOW_SPEED "Device is low-speed"CRLF |
Referenced by e_usbsys_lsusb().
#define MSG_KO "KO"CRLF |
#define MSG_MOVE_LOGS_TO_KEY "Moving the log files to the USB key"CRLF |
Referenced by e_usbsys_mv_logs_to_key().
#define MSG_NO_DEVICE "No supported device connected"CRLF |
Detailed description of the module: TODO
Referenced by e_usbsys_lsusb(), prv_e_usbsys_sync_cp_ukey(), ushell_cmdusb_resume(), and ushell_cmdusb_suspend().
#define MSG_OK "OK"CRLF |
Referenced by prv_e_usbsys_sync_cp_ukey().
#define MSG_REMOTE_WAKEUP_KO "Device does not support remote wake-up"CRLF |
Referenced by e_usbsys_lsusb().
#define MSG_REMOTE_WAKEUP_OK "Device supports remote wake-up"CRLF |
Referenced by e_usbsys_lsusb().
#define MSG_SELF_POWERED "Device is self-powered"CRLF |
Referenced by e_usbsys_lsusb().
#define MSG_USB_SUSPENDED "USB is suspended!"CRLF |
Referenced by e_usbsys_lsusb().
bool b_usbsys_start | ( | void | ) |
Start the USB modules.
References device_mass_storage_task_init(), host_mass_storage_task_init(), and usb_task_init().
Referenced by portTASK_FUNCTION().
eExecStatus e_usbsys_cp_cfg_to_local | ( | eModId | xModId, |
signed short | FsNavId, | ||
int | ac, | ||
signed portCHAR * | av[], | ||
signed portCHAR ** | ppcStringReply | ||
) |
In host mode, copy the /CFG directory content of the USB MS key to the Control Panel /CFG directory. No parameters. Format: cp_cfg_to_local.
xModId | Input. The module that is calling this function. |
FsNavId | Input. The file system navigator id to use. |
ac | Input. The argument counter. Ignored. |
av | Input. The argument vector. Ignored |
ppcStringReply | Input/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string may be performed here; the caller must thus free this string. |
References DEVICE_TO_HOST, MSG_COPY_CFG_TO_LOCAL, and prv_e_usbsys_sync_cp_ukey().
eExecStatus e_usbsys_cp_logs_to_key | ( | eModId | xModId, |
signed short | FsNavId, | ||
int | ac, | ||
signed portCHAR * | av[], | ||
signed portCHAR ** | ppcStringReply | ||
) |
In host mode, copy the /LOG directory to the USB MS key. No parameters. Format: cp_logs_to_ukey.
xModId | Input. The module that is calling this function. |
FsNavId | Input. The file system navigator id to use. |
ac | Input. The argument counter. Ignored. |
av | Input. The argument vector. Ignored |
ppcStringReply | Input/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string may be performed here; the caller must thus free this string. |
References HOST_TO_DEVICE, MSG_COPY_LOGS_TO_KEY, and prv_e_usbsys_sync_cp_ukey().
eExecStatus e_usbsys_cp_web_to_local | ( | eModId | xModId, |
signed short | FsNavId, | ||
int | ac, | ||
signed portCHAR * | av[], | ||
signed portCHAR ** | ppcStringReply | ||
) |
In host mode, copy the /WEB directory content of the USB MS key to the Control Panel /WEB directory. No parameters. Format: cp_web_to_local.
xModId | Input. The module that is calling this function. |
FsNavId | Input. The file system navigator id to use. |
ac | Input. The argument counter. Ignored. |
av | Input. The argument vector. Ignored |
ppcStringReply | Input/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string may be performed here; the caller must thus free this string. |
References DEVICE_TO_HOST, MSG_COPY_WEB_TO_LOCAL, and prv_e_usbsys_sync_cp_ukey().
eExecStatus e_usbsys_lsusb | ( | eModId | xModId, |
signed short | FsNavId, | ||
int | ac, | ||
signed portCHAR * | av[], | ||
signed portCHAR ** | ppcStringReply | ||
) |
In host mode, display basic low-level information about the connected device. The device should be supported by the host (configured). No parameters. Format: lsusb.
In host mode, display basic low-level information about the connected device. No parameters. Format: lsusb.
xModId | Input. The module that is calling this function. |
FsNavId | Ignored. |
ac | Input. The argument counter. Ignored. |
av | Input. The argument vector. Ignored |
ppcStringReply | Input/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. |
References CRLF, Get_altset_nb, Get_class, Get_ep_nbr, Get_interface_number, Get_maxpower, Get_nb_ep, Get_nb_supported_interface, Get_PID, Get_protocol, Get_subclass, Get_VID, i, Is_device_self_powered, Is_device_supports_remote_wakeup, Is_host_ready, Is_host_suspended, Is_usb_full_speed_mode, j, MSG_BUS_POWERED, MSG_DEVICE_FULL_SPEED, MSG_DEVICE_LOW_SPEED, MSG_NO_DEVICE, MSG_REMOTE_WAKEUP_KO, MSG_REMOTE_WAKEUP_OK, MSG_SELF_POWERED, MSG_USB_SUSPENDED, NULL, pvPortMalloc(), SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, SHELL_MAX_MSGOUT_LEN, sprintf(), v_shell_Print_String_To_Requester_Stream(), and vPortFree().
eExecStatus e_usbsys_mv_logs_to_key | ( | eModId | xModId, |
signed short | FsNavId, | ||
int | ac, | ||
signed portCHAR * | av[], | ||
signed portCHAR ** | ppcStringReply | ||
) |
In host mode, move the /LOG directory content to the USB MS key. No parameters. Format: mv_logs_to_ukey.
xModId | Input. The module that is calling this function. |
FsNavId | Input. The file system navigator id to use. |
ac | Input. The argument counter. Ignored. |
av | Input. The argument vector. Ignored |
ppcStringReply | Input/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string may be performed here; the caller must thus free this string. |
References HOST_TO_DEVICE, MSG_MOVE_LOGS_TO_KEY, and prv_e_usbsys_sync_cp_ukey().
|
static |
Common synchronization function between the Control Panel and a USB key.
xModId | Input. The module that is calling this function. |
FsNavId | Input. The file system navigator id to use. |
ppcStringReply | Input/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string may be performed here; the caller must thus free this string. |
pcStringMsgAction | Input. The message to display when performing the action. |
sync_direction | Input. The direction of the synchonization(DEVICE_TO_HOST or HOST_TO_DEVICE) |
pcdir_name | Input. The name of the directory to synchronize. |
bDeleteSrc | Input. Flag to perform a copy(false) or a move(true). |
References host_mass_storage_task_sync_drives(), Is_host_ready, Is_host_suspended, MSG_KO, MSG_NO_DEVICE, MSG_OK, NULL, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, and v_shell_Print_String_To_Requester_Stream().
Referenced by e_usbsys_cp_cfg_to_local(), e_usbsys_cp_logs_to_key(), e_usbsys_cp_web_to_local(), and e_usbsys_mv_logs_to_key().
int sprintf | ( | char * | out, |
const char * | format, | ||
... | |||
) |