Microchip® Advanced Software Framework

cptime.h File Reference
#include "compiler.h"
#include "FreeRTOS.h"
#include "shell.h"
#include "datalog.h"

Enumerations

enum  eSchedCmdId {
  CPTIME_SCHEDCMDID_SETLEDM1VAL,
  CPTIME_SCHEDCMDID_SETLEDM2VAL,
  CPTIME_SCHEDCMDID_SETLEDB1VAL,
  CPTIME_SCHEDCMDID_SETLEDB2VAL,
  CPTIME_SCHEDCMDID_SETLCDVAL
}
 

Functions

eExecStatus e_cptime_cmd_get_config (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The get time config command: get the config fields value of the time module Takes no parameter. More...
 
eExecStatus e_cptime_cmd_set_config (eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The set time config command: set each config field value of the time module. Takes one parameter : field=value. More...
 
eExecStatus e_cptime_RecordScheduledCmd (char *pcDate, int CmdId, void(*pfScheduledCmd)(int, void *), void *pvCmdParams, signed portCHAR **ppcStringReply)
 Record a scheduled command. More...
 
void v_cptime_ExecuteScheduledCmd (void)
 Execute a scheduled command if expiration date is up. More...
 
void v_cptime_GetDateInFatStringFormat (char *pcDate)
 Get the current time in the "YYYYMMDDHHMMSSMS" string format. More...
 
void v_cptime_Init (void)
 Init the time module. More...
 
void v_cptime_UpdateLocalTime (void)
 Update the local time. More...
 

Enumerator
CPTIME_SCHEDCMDID_SETLEDM1VAL 
CPTIME_SCHEDCMDID_SETLEDM2VAL 
CPTIME_SCHEDCMDID_SETLEDB1VAL 
CPTIME_SCHEDCMDID_SETLEDB2VAL 
CPTIME_SCHEDCMDID_SETLCDVAL 

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

The get time config command: get the config fields value of the time module Takes no parameter.

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 NULL, pvPortMalloc(), SHELL_ERRMSG_MEMALLOC, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, sprintf(), and xcptime_LocalTime.

Referenced by e_syscmds_cmd_get_config().

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

The set time config command: set each config field value of the time module. Takes one parameter : 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 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 CPTIME_ERRMSG_SETCFG_INVALIDDATE, CPTIME_ERRMSG_SETCFG_SYNTAXERROR, CPTIME_ERRMSG_SETCFG_UNKNOWNFIELD, CPTIME_MAX_NB_SCHED_CMDS, NAKED_TRACE_COM2, NbSchedCmd, NULL, prv_v_ShiftScheduledCmdsArray(), SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK, xcptime_LocalTime, and st_scheduled_cmd::xScheduledTime.

Referenced by e_syscmds_cmd_set_config().

eExecStatus e_cptime_RecordScheduledCmd ( char *  pcDate,
int  CmdId,
void(*)(int, void *)  pfScheduledCmd,
void pvCmdParams,
signed portCHAR **  ppcStringReply 
)

Record a scheduled command.

Parameters
pcDateInput. The date the cmd is scheduled at. Format: seconds OR mm/dd/yy hh:mm:ss
CmdIdScheduled command id.
pfScheduledCmdpointer on fct to be called at expiration date
pvCmdParamspointer on struct to give as param to pfScheduledCmd
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 st_scheduled_cmd::CmdId, CPTIME_ERRMSG_SETVAL_INVALIDTIME, CPTIME_ERRMSG_SETVAL_UNAVAILSCHEDSLOT, CPTIME_MAX_NB_SCHED_CMDS, NbSchedCmd, st_scheduled_cmd::pfScheduledCmd, st_scheduled_cmd::pxParam, SHELL_EXECSTATUS_KO, SHELL_EXECSTATUS_OK_NO_FREE, xcptime_LocalTime, and st_scheduled_cmd::xScheduledTime.

Referenced by e_actuator_ScheduleCmdSet().

void v_cptime_ExecuteScheduledCmd ( void  )

Execute a scheduled command if expiration date is up.

References NbSchedCmd, st_scheduled_cmd::pfScheduledCmd, prv_v_ShiftScheduledCmdsArray(), xcptime_LocalTime, and st_scheduled_cmd::xScheduledTime.

Referenced by portTASK_FUNCTION().

void v_cptime_GetDateInFatStringFormat ( char *  pcDate)

Get the current time in the "YYYYMMDDHHMMSSMS" string format.

Parameters
pcDateInput/Output. Input allocated array. Output is the current time expressed in the "YYYYMMDDHHMMSSMS" string format.

References sprintf(), and xcptime_LocalTime.

Referenced by b_mmi_mkdir_aLOG(), b_mmi_mkdir_bLOG(), config_file_set_value(), e_fscmds_shell_mkdir(), e_fscmds_touch(), prv_append(), prv_vsave_logs(), and prv_xopen_current_logfile().

void v_cptime_Init ( void  )

Init the time module.

References xcptime_LocalTime.

Referenced by main().

void v_cptime_UpdateLocalTime ( void  )