Interfacing with Standard NetLinx API (SNAPI)
7
Standard NetLinx API (SNAPI) R 1.7.0
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.
Summary of Contents for CAFE DUET
Page 16: ...Standard NetLinx API SNAPI R 1 8 0 12 ...
Page 28: ...Standard NetLinx API SNAPI R 1 8 0 24 ...
Page 34: ...Standard NetLinx API SNAPI R 1 8 0 30 ...
Page 40: ...Standard NetLinx API SNAPI R 1 8 0 36 ...
Page 46: ...Standard NetLinx API SNAPI R 1 8 0 42 ...
Page 52: ...Standard NetLinx API SNAPI R 1 8 0 48 ...
Page 58: ...Standard NetLinx API SNAPI R 1 8 0 54 ...
Page 142: ...Standard NetLinx API SNAPI R 1 8 0 138 ...
Page 148: ...Standard NetLinx API SNAPI R 1 8 0 144 ...
Page 156: ...Standard NetLinx API SNAPI R 1 8 0 152 ...
Page 172: ...Standard NetLinx API SNAPI R 1 8 0 168 ...
Page 184: ...Standard NetLinx API SNAPI R 1 8 0 180 ...
Page 192: ...Standard NetLinx API SNAPI R 1 8 0 188 ...
Page 206: ...Standard NetLinx API SNAPI R 1 8 0 202 ...
Page 226: ...Standard NetLinx API SNAPI R 1 8 0 222 ...
Page 240: ...Standard NetLinx API SNAPI R 1 8 0 236 ...
Page 244: ...Standard NetLinx API SNAPI R 1 8 0 240 ...
Page 252: ...Standard NetLinx API SNAPI R 1 8 0 248 ...
Page 268: ...Standard NetLinx API SNAPI R 1 8 0 264 ...
Page 302: ...Standard NetLinx API SNAPI R 1 8 0 298 ...
Page 328: ...Standard NetLinx API SNAPI R 1 8 0 324 ...
Page 343: ...Standard NetLinx API SNAPI Devices 339 Standard NetLinx API SNAPI R 1 7 0 ...