47
Response Tokens
The response tokens are:
•
status
- 0 for Failure, 1 for Success
•
faultCode
- If
status
is 0 (failure).
faultCode
will be an integer representing a specific error
{Fault Codes, page 48}. This token is NOT returned if status is 1 (success).
•
response
[
i
] - Returned value #
i
, where
i
is an integer. If
status
is 0 (fail), the value for
response1
will be a string describing the failure, and the value for
response2
will be a debug
string giving more information about the failure.
Returned values are strings, integers, or Booleans, depending on the method. See the detailed list of
methods at the end of this reference for details about the returned values for any given method. These
returned values are denoted by the text "
[out, retval]
" in the Syntax and Parameters sections.
The response to the HTTP Post will be a string in the format:
status
=[ 0 or 1 ]
[&faultCode
=[Fault Code]] [
&response1=
[ Value
for Response 1 ]
&response2=
[ Value for Response 2 ]
&response3=
[ Value for Response 3, etc...]
]
EXAMPLE #1: Serial_GetSettings
Let us look at the method
Serial_GetSettings
(defined on page 55). From the Syntax and
Parameter sections, we can tell that
param1
is a long integer that specifies either serial port #1 or #2.
We can also see that
response1
(retval, or return value) is a string describing the settings for the given
port.
Using the HTTP Post format, the call to obtain settings from serial port #2 is:
version=2.0&method=Serial_GetSettings¶m1=2
Since the version token is optional, this call may be simplified:
method=Serial_GetSettings¶m1=2
A sample response for this call:
status=1&response1=9600,8,ODD,2,1,SOFTWARE
Responses are not usually used in its raw string format. A web programmer will typically parse the
response before displaying or otherwise making use of the information received.
EXAMPLE #2: Net_GetSubnetMask
The call for the
Net_GetSubnetMask
method:
method=Net_GetSubnetMask
Sample response:
status=1&response1=255.255.255.0
Содержание CRM-WIC
Страница 1: ...Reference Manual Programming Guide Room Monitor Web Intelligent Controller Model CRM WIC...
Страница 7: ...7 Box Contents Box Contents for the CRM WIC Web Intelligent Controller Model CRMWIC Power Adapter...
Страница 8: ...8 Hardware User Interface Hardware User Interface for the CRM WIC...
Страница 16: ...16 For full details see the RPC section at the end of this manual...
Страница 43: ...43 This expression resolves to this value 0 1 4 3 1 Hello Hello 0...
Страница 98: ...98 Index...