Microchip® Advanced Software Framework

cpled.c File Reference
#include <string.h>
#include "compiler.h"
#include "FreeRTOS.h"
#include "datalog.h"
#include "shell.h"
#include "board.h"
#include "supervisor.h"
#include "cptime.h"
#include "actuator.h"
#include "cpled.h"

Functions

bool b_ledb1_get_value (xLogDef *pxLog)
 Get the ledb1 current value. More...
 
bool b_ledb2_get_value (xLogDef *pxLog)
 Get the ledb2 current value. More...
 
bool b_ledm1_get_value (xLogDef *pxLog)
 Get the ledm1 current value. More...
 
bool b_ledm2_get_value (xLogDef *pxLog)
 Get the ledm2 current value. More...
 
eExecStatus e_ledb1_set_value (eModId xModId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The set bicolor ledb1 value command: set the value of the bicolor ledb1. Takes up to six parameters the first parameter is the green parameter, the second parameter is its value in [0,255], the third parameter is the red parameter, the fourth parameter is its value in [0,255], the fifth is the time parameter(optional), the sixth is the time value(optional) expressed in seconds. Format: set_actuator_value actuator=actuatorname green=value red=value [time=date]. More...
 
eExecStatus e_ledb2_set_value (eModId xModId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The set bicolor ledb2 value command: set the value of the bicolor ledb2. Takes up to six parameters the first parameter is the green parameter, the second parameter is its value in [0,255], the third parameter is the red parameter, the fourth parameter is its value in [0,255], the fifth is the time parameter(optional), the sixth is the time value(optional) expressed in seconds. Format: set_actuator_value actuator=actuatorname green=value red=value [time=date]. More...
 
eExecStatus e_ledm1_set_value (eModId xModId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 
eExecStatus e_ledm2_set_value (eModId xModId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply)
 The set monocolor led2 value command: set the value of the monocolor led2. Takes up to four parameters the first parameter is the state parameter, the second parameter is its value(on/off), the third is the time parameter(optional), the fourth is the time value(optional). Format: set_actuator_value actuator=actuatorname state=value [time=date]. More...
 
int sprintf (char *out, const char *format,...)
 

Variables

const signed portCHAR *const CPLED_OFF_STR = (signed portCHAR *)"off"
 
const signed portCHAR *const CPLED_ON_STR = (signed portCHAR *)"on"
 

bool b_ledb1_get_value ( xLogDef pxLog)

Get the ledb1 current value.

Parameters
pxLoga Log structure.
Returns
true upon success, false if error.

References LED_Get_Intensity(), LEDB1G, LEDB1R, NULL, LogDef::pcStringLog, LogDef::pfFreeStringLog, pvPortMalloc(), sprintf(), and vPortFree().

bool b_ledb2_get_value ( xLogDef pxLog)

Get the ledb2 current value.

Parameters
pxLoga Log structure.
Returns
true upon success, false if error.

References LED_Get_Intensity(), LEDB2G, LEDB2R, NULL, LogDef::pcStringLog, LogDef::pfFreeStringLog, pvPortMalloc(), sprintf(), and vPortFree().

bool b_ledm1_get_value ( xLogDef pxLog)

Get the ledm1 current value.

Parameters
pxLoga Log structure.
Returns
true upon success, false if error.

References CPLED_OFF_STR, CPLED_ON_STR, LED_Test(), LEDM1, NULL, LogDef::pcStringLog, and LogDef::pfFreeStringLog.

bool b_ledm2_get_value ( xLogDef pxLog)

Get the ledm2 current value.

Parameters
pxLoga Log structure.
Returns
true upon success, false if error.

References CPLED_OFF_STR, CPLED_ON_STR, LED_Test(), LEDM2, NULL, LogDef::pcStringLog, and LogDef::pfFreeStringLog.

eExecStatus e_ledb1_set_value ( eModId  xModId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The set bicolor ledb1 value command: set the value of the bicolor ledb1. Takes up to six parameters the first parameter is the green parameter, the second parameter is its value in [0,255], the third parameter is the red parameter, the fourth parameter is its value in [0,255], the fifth is the time parameter(optional), the sixth is the time value(optional) expressed in seconds. Format: set_actuator_value actuator=actuatorname green=value red=value [time=date].

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
acInput. The argument counter. For this command, should be at least 4, at most 6.
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 ACTUATOR_ERRMSG_SETVAL_SYNTAXERROR, CPTIME_SCHEDCMDID_SETLEDB1VAL, e_actuator_ScheduleCmdSet(), LED_Set_Intensity(), LEDB1G, LEDB1R, SHELL_EXECSTATUS_KO, and SHELL_EXECSTATUS_OK.

Referenced by vExecScheduledSet().

eExecStatus e_ledb2_set_value ( eModId  xModId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The set bicolor ledb2 value command: set the value of the bicolor ledb2. Takes up to six parameters the first parameter is the green parameter, the second parameter is its value in [0,255], the third parameter is the red parameter, the fourth parameter is its value in [0,255], the fifth is the time parameter(optional), the sixth is the time value(optional) expressed in seconds. Format: set_actuator_value actuator=actuatorname green=value red=value [time=date].

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
acInput. The argument counter. For this command, should be at least 4, at most 6.
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 ACTUATOR_ERRMSG_SETVAL_SYNTAXERROR, CPTIME_SCHEDCMDID_SETLEDB2VAL, e_actuator_ScheduleCmdSet(), LED_Set_Intensity(), LEDB2G, LEDB2R, SHELL_EXECSTATUS_KO, and SHELL_EXECSTATUS_OK.

Referenced by vExecScheduledSet().

eExecStatus e_ledm1_set_value ( eModId  xModId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)
eExecStatus e_ledm2_set_value ( eModId  xModId,
int  ac,
signed portCHAR *  av[],
signed portCHAR **  ppcStringReply 
)

The set monocolor led2 value command: set the value of the monocolor led2. Takes up to four parameters the first parameter is the state parameter, the second parameter is its value(on/off), the third is the time parameter(optional), the fourth is the time value(optional). Format: set_actuator_value actuator=actuatorname state=value [time=date].

Note
This function must be of the type pfShellCmd defined by the shell module.
Parameters
xModIdInput. The module that is calling this function.
acInput. The argument counter. For this command, should be at least 2, at most 4.
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 ACTUATOR_ERRMSG_SETVAL_SYNTAXERROR, CPLED_OFF_STR, CPLED_ON_STR, CPTIME_SCHEDCMDID_SETLEDM2VAL, e_actuator_ScheduleCmdSet(), LED_Off(), LED_On(), LEDM2, SHELL_EXECSTATUS_KO, and SHELL_EXECSTATUS_OK.

Referenced by vExecScheduledSet().

const signed portCHAR* const CPLED_OFF_STR = (signed portCHAR *)"off"
const signed portCHAR* const CPLED_ON_STR = (signed portCHAR *)"on"