cmd.h File Reference


Detailed Description

Commands.

Author:
Modtronix Engineering
Dependencies:
Compiler:
MPLAB C18 v2.10 or higher
HITECH PICC-18 V8.35PL3 or higher

Description

This module contains the code that executes all received commands

Configuration

The following defines are used to configure this module, and should be placed in the projdefs.h (or similar) file. For details, see Project Configuration. To configure the module, the required defines should be uncommended, and the rest commented out.
 //*********************************************************************
 //--------------------  Cmd Configuration --------------------
 //*********************************************************************
 //Default "UDP Command Port"
 #define DEFAULT_CMD_UDPPORT (54123)

 //Default "UDP Command Responce Port"
 #define DEFAULT_CMDRESP_UDPPORT (54124)

 //"UDP Command Port"
 #define CMD_UDPPORT     DEFAULT_CMD_UDPPORT

 //"UDP Command Responce Port"
 #define CMDRESP_UDPPORT DEFAULT_CMDRESP_UDPPORT


Data Structures

struct  _CMD_GET_VAR

Defines

#define CMD_UD_ADC   0x0010
#define CMD_UD_CPU_IO   0x0008
#define CMD_UD_NETWORK   0x0002
#define CMD_UD_PWM   0x0100
#define CMD_UD_SMTP   0x0040
#define CMD_UD_SYSTEM   0x0080
#define CMD_UD_TFTP   0x0020
#define CMD_UD_UNDEFINED   0x0001
#define CMD_UD_USART   0x0004
#define CMD_UD_WEB   0x0200
#define CMDCODE_GEN_NEW_NETBIOS_NAME   ('n')
#define CMDCODE_GEN_NEW_PASSWORD   ('b')
#define CMDCODE_GEN_NEW_USERNAME   ('a')
#define CMDCODE_GEN_PASSWORD   ('p')
#define CMDCODE_GEN_USERNAME   ('u')
#define CMDCODE_GENNOVAL_LOGIN   ('l')
#define CMDCODE_GENNOVAL_LOGOUT   ('o')
#define CMDCODE_GENNOVAL_RESET   ('r')
#define CMDCODE_SPI_CFGCLK   ('r')
#define CMDGROUP_CONFIG   ('k')
#define CMDGROUP_GENERAL   ('l')
#define CMDGROUP_GENERAL_NOVAL   ('m')
#define CMDGROUP_PORTA   ('a')
#define CMDGROUP_PORTB   ('b')
#define CMDGROUP_PORTC   ('c')
#define CMDGROUP_PORTD   ('d')
#define CMDGROUP_PORTE   ('e')
#define CMDGROUP_PORTF   ('f')
#define CMDGROUP_PORTG   ('g')
#define CMDGROUP_PORTH   ('h')
#define CMDGROUP_PORTJ   ('i')
#define CMDGROUP_PWM   ('w')
#define CMDGROUP_SPI   ('s')

Typedefs

typedef _CMD_GET_VAR CMD_GET_VAR

Functions

void cmdProcess (void)
void cmdUdpInit (void)
WORD execNameValueCmd (BYTE *name, BYTE *value, BYTE user)
WORD getVarCmd (CMD_GET_VAR *pGetVar)


Define Documentation

#define CMD_UD_ADC   0x0010

#define CMD_UD_CPU_IO   0x0008

#define CMD_UD_NETWORK   0x0002

#define CMD_UD_PWM   0x0100

#define CMD_UD_SMTP   0x0040

#define CMD_UD_SYSTEM   0x0080

#define CMD_UD_TFTP   0x0020

#define CMD_UD_UNDEFINED   0x0001

#define CMD_UD_USART   0x0004

#define CMD_UD_WEB   0x0200

#define CMDCODE_GEN_NEW_NETBIOS_NAME   ('n')

#define CMDCODE_GEN_NEW_PASSWORD   ('b')

#define CMDCODE_GEN_NEW_USERNAME   ('a')

#define CMDCODE_GEN_PASSWORD   ('p')

#define CMDCODE_GEN_USERNAME   ('u')

#define CMDCODE_GENNOVAL_LOGIN   ('l')

#define CMDCODE_GENNOVAL_LOGOUT   ('o')

#define CMDCODE_GENNOVAL_RESET   ('r')

#define CMDCODE_SPI_CFGCLK   ('r')

#define CMDGROUP_CONFIG   ('k')

#define CMDGROUP_GENERAL   ('l')

#define CMDGROUP_GENERAL_NOVAL   ('m')

#define CMDGROUP_PORTA   ('a')

#define CMDGROUP_PORTB   ('b')

#define CMDGROUP_PORTC   ('c')

#define CMDGROUP_PORTD   ('d')

#define CMDGROUP_PORTE   ('e')

#define CMDGROUP_PORTF   ('f')

#define CMDGROUP_PORTG   ('g')

#define CMDGROUP_PORTH   ('h')

#define CMDGROUP_PORTJ   ('i')

#define CMDGROUP_PWM   ('w')

#define CMDGROUP_SPI   ('s')


Typedef Documentation

typedef struct _CMD_GET_VAR CMD_GET_VAR

Structure for passing variables to getVarCmd() function


Function Documentation

void cmdProcess ( void   ) 

Must be called every couple of ms

void cmdUdpInit ( void   ) 

Initializes "UDP Command Port" and "UDP Command Responce Port". These ports are used for sending and receiving and commands via the UDP port.

WORD execNameValueCmd ( BYTE name,
BYTE value,
BYTE  user 
)

Execute the given name-value command. The command might not be executed if a higher user level is required.

Parameters:
name The name part of the name-value command
value The value part of the name-value command
user The user level, is a HTTP_USER_XX constant
Returns:
Returns an UD_XXX flag (or multiple ones ORed together) indicating what has been updated. Not all name-value commands will return a value here.

WORD getVarCmd ( CMD_GET_VAR pGetVar  ) 

Get the requested variable command. The command might not be executed if a higher user level is required.

Parameters:
pGetVar Pointer to CMD_GET_VAR structure.
Returns:
Returns number of bytes read. If this value is less then the size of the buffer given, then all requested data has been returned (flags.bFinished flag will also be set)


Generated on Thu Jul 5 21:26:31 2007 for SBC65EC Web Server by  doxygen 1.5.2