command_handler.hpp File Reference
#include "vector.hpp"
#include "str.hpp"
#include "char_dev.hpp"
Include dependency graph for command_handler.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  CommandProcessor
 

Macros

#define CMD_HANDLER_FUNC(name)   bool name(str& cmdParams, CharDev& output, void* pDataParam)
 

Typedefs

typedef bool(* CmdHandlerFuncPtr) (str &cmdParams, CharDev &output, void *pDataParam)
 

Macro Definition Documentation

#define CMD_HANDLER_FUNC (   name)    bool name(str& cmdParams, CharDev& output, void* pDataParam)

This macro can be used to declare and/or define a handler function.

See also
Parameters of CmdHandlerFuncPtr() Example:
1 CMD_HANDLER_FUNC(myHandler);
2 
3 CMD_HANDLER_FUNC(myHandler)
4 {
5  ...
6 }

Typedef Documentation

typedef bool(* CmdHandlerFuncPtr) (str &cmdParams, CharDev &output, void *pDataParam)

SocialLedge.com - Copyright (C) 2013

This file is part of free software framework for embedded processors. You can use it and/or distribute it as long as this copyright header remains unmodified. The code is free for personal use and requires permission to use in a commercial product.

THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. I SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.

You can reach the author of this software at : p r e e t . w i k i @ g m a i l . c o m This is a function pointer to handle a command. If the command handler was added for "CPU" and a command is input to command handler as "CPU UTIL 5", then cmdParams will contain "UTIL 5" which are additional parameters for this command.

Parameters
cmdParamsThe parameter string to your handler
outputThe output interface you can use to output data.
pDataParamThis is the same parameter passed when addHandler() is called
dataParamLenThe length of data associated with pDataParam
Returns
One of the responses from CmdRspType