Shared Variables
Sample Code
Updating a variable | function send_update( $host, $port, $name, $value ) { |
using PHP | $s=fsockopen( $host, $port ); |
| fwrite( $s, “UPDATE \”$name\" \"$value\"\r\n" ); |
| fclose( $s ); |
| } |
| Note: this simplified example does not handle the escaping of control characters. |
Sending an event | Sending a keydown event for the key 'V' with control modifier pressed. |
using PHP | function send_copy_key( $host, $port ) { |
| $s=fsockopen( $host, $port ); |
| fwrite( $s, “EVENT \”keydown\” \”Ctrl+V\”\r\n” ); |
| fclose( $s ); |
| } |
Updating a variable | telnet 192.168.1.10 1234 |
using telnet | Trying 192.168.1.10... |
| Connected to 192.168.1.10 |
| Escape character is '^]'. |
| UPDATE “menu” “P1” |
| ^] |
| telnet> quit |
| Connection closed. |
Updating a variable | http://192.168.1.10:1234/update?menu=P1 |
using HTTP |
|
Enabling the Network API
The network API must be enabled on the
Click the box and then click “Apply”
FIG. 113 Enabling the Network API
For more information on the
www.amx.com.
88 | Inspired XPress - Programming Guide |