Commands And Escape Characters - AMX CAFE DUET STANDARD NETLINX API (SNAPI) COMPONENTS AND LISTENERS Instruction Manual

Standard netlinx api (snapi) r 1.8.0 components/listeners
Table of Contents

Advertisement

Commands and Escape Characters

SNAPI command uses comma as a parameter separator. If a parameter's value contains a comma, the parameter is escaping using double quotes at the start and end
of the parameter. If a parameter's value contains a double quote character it is escaped with a pair of double quote characters.
The following examples are properly escaped parameter values:
6
Hello
Brown Eyed Girl
"Morrison, Van"
"Van ""The Man"" Morrison"
The following examples are improperly escaped parameter values:
Morrison, Van
Van "The Man" Morrison
SNAPI.axi includes a few helpful routines to build commands:
DuetPackCmdHeader(Hdr)
DuetPackCmdParam(Cmd, Param)
DuetPackCmdParamArray(Cmd, Params[])
DuetPackCmdHeader is a command using a given command header where Hdr is the command header. DuetPackCmdParam adds a parameter to the command,
escaping the parameter and adding parameter separators as needed; Cmd is the command to which the parameter is added and Param is the parameter to be added.
DuetPackCmdParamArray is similar to DuetPackCmdParam but it takes an array of parameters and adds them to the command. All of these functions return the
updated command.
SNAPI.axi includes a few helpful routines to parse commands as well:
DuetParseCmdHeader(Cmd)
DuetParseCmdParam(Cmd)
DuetParseCmdHeader removes and returns the command header from a command. DuetParseCmdParam removes and returns the next parameter from the
command, un-escaping the parameter as needed. Both of these functions return a string containing the command header or the parameter.
Standard NetLinx API (SNAPI) R 1.8.0
Interfacing with Standard NetLinx API (SNAPI)
7

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cafe duet

Table of Contents