The HTTPExecGetCmd() function is a callback function from the HTTP Server. When the HTTP Server receives a GET method with more than one parameter, it calls this function. This function has been implemented by the Modtronix SBC65EC Web Server in the "httpexec.c" file! All commands implemented by the Modtronix SBC65EC Web Server are listed below.
This function must repetively call the HTTPGetParam() function until all name-value parameters sent with the GET command have been obtained. It must then decode the name-value parameter and take appropriate actions. Such actions may include supplying a new Web page name to be returned and/or performing an I/O task.
"pxx=v"The following PIC port commands are implemented by the Modtronix SBC65EC Web Server:
| Command Syntax | Description |
p=YY | Port Command - set the given PIC port to the given hex value. The given hex value must be
in uppercase! For example:
" a=8A" will set PIC port A to 0x8A.
|
p[0-7]=[1,0] | Port Pin Command - set or clear the given PIC port pin. For example:
" a0=0" will clear PIC port A0 (Port A, pin 0)
" f7=1" will set PIC port F7 (Port F, pin 7)
|
p[0-7]r=[1,0] | Port Pin Command, Remember - - Same as "Port Pin Command" command, except that the settings are saved to the application configuration, and is remembered after power up. |
pc[0-7]=[1,0] | Port Pin Configuration - Configure given PIC port pin as input or output. '0' will configure
pin to be an output, and '1' an input. The port direction configured with this command will NOT be remembered
after the next power up, use the "Port Pin Configuration, Remember" command to achieve this! Example to use this command:
" ac0=0" will configure PIC port A0 (Port A, pin 0) to be an output.
" fc7=1" will configure PIC port F7 (Port F, pin 7) to be an input
|
pc[0-7]r=[1,0] | Port Pin Configuration, Remember - Same as "Port Pin Configuration" command, except that the settings are saved to the application configuration, and is remembered after power up. |
px[0-7]=[1,0] | Inverted Port Pin Command - Set or clear the given PIC port pin. The value is inverted! For example:
" ax0=0" will set PIC port A0 (Port A, pin 0)
" fx7=1" will clear PIC port F7 (Port F, pin 7)
|
Examples:
| Example GET command | Description |
f=01 | This example will set PIC port F to 0x01 |
c5=1 | This example will set PIC port C5 |
bx0=1 | This example will clear PIC port B0 |
The Config command has the following syntax: "kxx=v"
All Config commands can only be executed by a logged in user!
Examples:
| Example GET command | Description |
k00=100 | This example will set the the "Application Configuration byte" at 0x00 (MSB of IP address) to 100 |
k2A=16 | This example will set the "Application Configuration byte" at 0x2A (Port F direction) to 16 (0x0f). Address 0x2A contains the TRIS register for PIC Port F. Setting a bit to 0 will configure the port as an output, and 1 as an input. In this example we set TRISF to 0x0f = binary 00001111. This will configure port F pins 0-3 as inputs, and pins 4-7 as outputs. |
k2F=16 | This example will set the "Application Configuration byte" at 0x2F (Port F default value) to 10 (0x0a). Address 0x2F contains the default value for PIC Port F at power up. In this example we set it to 0x0a = binary 00001010. This will set the default value of port F pins 1 and 3 to 1 (5V), and pins 0, 2, 4, 5, 6, 7 to 0 (0V) at power up. |
"lx=v"The following General commands are implemented by the Modtronix SBC65EC Web Server. If the Logged In column contains a 'X' character then this command can only be executed by a logged in user!
| Command Syntax | Logged In |
Description |
la=str | X | New Username - assigns a new Username. The given "str" is the new username, and must be an alpha numeric
string of 1 to 8 characters. For example:
" la=wombat" will set the new username to "wombat". |
lb=str | X | New Password - assigns a new Password. The given "str" is the new password, and must be an alpha numeric
string of 1 to 8 characters. For example:
" lb=gumtree" will set the new username to "gumtree". |
lu=str | Username - gives the username of an user attempting to log in. The given "str" is the username, and must be an alpha numeric
string of 1 to 8 characters. This command must be followed by the Password command. For example:
" lu=admin" will send a request to log in for the "admin" user. |
|
lp=str | Password - gives the password of an user attempting to log in. The given "str" is the password, and must be an alpha numeric
string of 1 to 8 characters. This command must followed the Username command. For example:
" lp=pw" will send a request to log with the "pw" password. |
Examples:
The following example will log in an user with username="admin" and password="pw" to a target with an IP address of "10.1.0.1":
http://10.1.0.1/?lu=admin&lp=pw
This command can be sent by entering the line above in a standard web browser, or could be send by custom software.
"m=v"The following Short commands are implemented by the Modtronix SBC65EC Web Server. If the Logged In column contains a 'X' character then this command can only be executed by a logged in user!
| Command Syntax | Logged In |
Description |
m=r | X | Reset Board - reset's the board. This command can be used to remotely reset the board. This can be used to update the firmware via the network bootloader for example. |
m=o | X | Log Out - log out the current user. |
Examples:
The following example will reset a target with an IP address of "10.1.0.1":
http://10.1.0.1/?m=r
This command can be sent by entering the line above in a standard web browser, or could be send by custom software.
1.4.7