MMS报文分析示例(三)
Variable
Management
1. Read request
MMSPdu Received ::=
A0 1E 02 01 0A A4 19 A1 17 A0 15 30 13 A0 11
80 0F 66 65 65 64 65 72 31 5F 33 5F 70 68 61 73 65
[0] A0 1E -- ConfirmedRequestPDU
{
02 01 0A --
invokeID
[4] A4 19
-- ConfirmedServiceRequest, A4 = Read
{
[1] A1 17 --
variableAccessSpecification
{
[0] 30 13
-- listOfVariable
(30 = 00 1 10000, Universal
Constructed)
{
[0] A0 11 --
variableSpecification
{
[0] 80 0F 66 65 65
64 65 72 31 5f 33 5f 70 68 61 73 65 -- name
}
}
}
}
}
where,
invokeID::=0A
Identifier (name of variable to
read)::="feeder1_3_phase"
2. Read response
Assume
typedef struct var_def
{
int a;
int b;
} VAR_DEF;
VAR_DEF
feeder1_3_phase;
MMS Data Production
Data ::= CHOICE
{
[1] IMPLICIT SEQUENCE OF,--
arrayed data
[2] IMPLICIT SEQUENCE OF,--
structured data
[3] IMPLICIT BOOLEAN,
[4] IMPLICIT BIT
STRING,
[5] IMPLICIT INTEGER,-- signed
int
[6] IMPLICIT INTEGER,-- unsigned
int
[7] IMPLICIT Floating
Point,
[9] IMPLICIT OCTET
STRING,
[10] IMPLICIT
VisibleString,
[11] IMPLICIT
GeneralizedTime,
[12] IMPLICIT
TimeofDay,
[13] IMPLICIT INTEGER,--
BCD
[14] IMPLICIT BIT STRING,--
boolean array
[15] IMPLICIT OBJECT
IDENTIFIER
}
The encoded structure of the encoded data can
be determined via VAR_DEF
VAR_DEF::=
TAG
-------------------------------------------
struct {
A2
inta; 85
intb; 85
}
MMSPdu Received ::=
A1 0F 02 01 0A A4 0A A1 08 A2 06 85 01 00 85
0100
[1] A1 0F -- ConfirmedResponsePDU
{
02 01 0A --
invokeID
[4] A4 0A --
ConfirmedServiceResponse, A4 = Read
{
[1] OF A1 08 --
listOfAccessResult
{
A2 06 -- success,
Data of struct
{
85 01 00 -- int
a;
85 01 00 -- int
b;
}
}
}
}
where,
invokeID::=0A
value of a::=00, value of b::=00