Skip to content

Commit

Permalink
Working on YCommand execution
Browse files Browse the repository at this point in the history
  • Loading branch information
dariosb committed Jun 22, 2020
1 parent 7a9bd03 commit abf8cc6
Show file tree
Hide file tree
Showing 2 changed files with 197 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/YCommand/inc/YCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ typedef struct
*/
YCmd_t YCommand_parse(YCommand *pCmd, char *p, ruint size);

/*
* Yipies Command Execution
*
*
*/
YCmd_t YCommand_exe(YCommand *pCmd);

/* -------------------- External C language linkage end -------------------- */
#ifdef __cplusplus
}
Expand Down
190 changes: 190 additions & 0 deletions src/YCommand/src/YCommandExec.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
/**
* \file YCommandExec.c
* \brief ...
*/

/* -------------------------- Development history -------------------------- */
/*
* 2020.04.17 Daba v1.0.00 Initial version
*/

/* -------------------------------- Authors -------------------------------- */
/*
* DaBa Dario Baliña [email protected]
*/

/* --------------------------------- Notes --------------------------------- */
/* ----------------------------- Include files ----------------------------- */
#include "rkh.h"
#include "YCommand.h"
#include "YCommandExec.h"

/* ----------------------------- Local macros ------------------------------ */
/* ------------------------------- Constants ------------------------------- */
/* ---------------------------- Local data types --------------------------- */
typedef struct YCmdExec
{
rInt (*exec)(YCommand *pcmd);
}YCmdExec;

/* ---------------------------- Global variables --------------------------- */
/* ---------------------------- Local variables ---------------------------- */
static rInt exec_serverIp(YCommand *pcmd);
static rInt exec_serverPort(YCommand *pcmd);
static rInt exec_connectionTime(YCommand *pcmd);
static rInt exec_gpsTime(YCommand *pcmd);
static rInt exec_accLimit(YCommand *pcmd);
static rInt exec_breakLimit(YCommand *pcmd);
static rInt exec_cmdStatus(YCommand *pcmd);
static rInt exec_setOut1(YCommand *pcmd);
static rInt exec_setOut2(YCommand *pcmd);
static rInt exec_setOut3(YCommand *pcmd);
static rInt exec_setOut4(YCommand *pcmd);
static rInt exec_setOut5(YCommand *pcmd);
static rInt exec_setOut6(YCommand *pcmd);
static rInt exec_reset(YCommand *pcmd);
static rInt exec_sampleTime(YCommand *pcmd);
static rInt exec_dataFormat(YCommand *pcmd);

/* ----------------------- Local function prototypes ----------------------- */
static const YCmdExec execTable[YCmdNum] =
{
{ exec_serverIp }, // YCmdServerIp
{ exec_serverPort }, // YCmdServerPort
{ exec_connectionTime }, // YCmdConnectionTime
{ exec_gpsTime }, // YCmdGpsTime
{ exec_accLimit }, // YCmdAccLimit
{ exec_breakLimit }, // YCmdBreakLimit
{ exec_cmdStatus }, // YCmdStatus
{ exec_setOut1 }, // YCmdSetOut1
{ exec_setOut2 }, // YCmdSetOut2
{ exec_setOut3 }, // YCmdSetOut3
{ exec_setOut4 }, // YCmdSetOut4
{ exec_setOut5 }, // YCmdSetOut5
{ exec_setOut6 }, // YCmdSetOut6
{ exec_reset }, // YCmdReset
{ exec_sampleTime }, // YCmdSampleTime
{ exec_dataFormat } // YCmdDataFormat
};


/* ---------------------------- Local functions ---------------------------- */
static
rInt
exec_serverIp(YCommand *pcmd)
{
return 0;
}

static
rInt exec_serverPort(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_connectionTime(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_gpsTime(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_accLimit(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_breakLimit(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_cmdStatus(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_setOut1(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_setOut2(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_setOut3(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_setOut4(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_setOut5(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_setOut6(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_reset(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_sampleTime(YCommand *pcmd)
{
return 0;
}

static
rInt
exec_dataFormat(YCommand *pcmd)
{
return 0;
}

/* ---------------------------- Global functions --------------------------- */
YCmd_t
YCommand_exec(YCommand *pcmd)
{

}

/* ------------------------------ End of file ------------------------------ */

0 comments on commit abf8cc6

Please sign in to comment.