Commit | Line | Data |
---|---|---|
970ed795 EL |
1 | --***************************************************************************** |
2 | -- Copyright (c) 2000-2014 Ericsson Telecom AB | |
3 | -- All rights reserved. This program and the accompanying materials | |
4 | -- are made available under the terms of the Eclipse Public License v1.0 | |
5 | -- which accompanies this distribution, and is available at | |
6 | -- http://www.eclipse.org/legal/epl-v10.html | |
7 | --***************************************************************************** | |
8 | JsonData | |
9 | DEFINITIONS | |
10 | ||
11 | AUTOMATIC TAGS | |
12 | ||
13 | ::= | |
14 | ||
15 | BEGIN | |
16 | ||
17 | IMPORTS ; | |
18 | ||
19 | -- Type definitions -- | |
20 | ---------------------- | |
21 | ||
af710487 | 22 | -- Sequence of |
970ed795 EL |
23 | SeqOfInt ::= SEQUENCE OF INTEGER |
24 | ||
af710487 | 25 | -- Sequence |
970ed795 EL |
26 | SeqProduct ::= SEQUENCE { |
27 | name UniversalString, | |
28 | price REAL, | |
29 | id OCTET STRING OPTIONAL, | |
30 | available BOOLEAN | |
31 | } | |
32 | ||
af710487 | 33 | -- Choice |
970ed795 EL |
34 | Number ::= CHOICE { |
35 | decimal INTEGER, | |
36 | binary BIT STRING, | |
37 | hexadecimal OCTET STRING | |
38 | } | |
39 | ||
af710487 | 40 | -- Choice containing all string types |
970ed795 EL |
41 | AnyString ::= CHOICE { |
42 | generalstr GeneralString, | |
43 | numericstr NumericString, | |
44 | utf8str UTF8String, | |
45 | printablestr PrintableString, | |
46 | universalstr UniversalString, | |
47 | bmpstr BMPString, | |
48 | graphicstr GraphicString, | |
49 | ia5str IA5String, | |
50 | teletexstr TeletexString, | |
51 | videotexstr VideotexString, | |
52 | visiblestr VisibleString | |
53 | } | |
54 | ||
af710487 | 55 | -- Sequence of strings |
970ed795 EL |
56 | ManyStrings ::= SEQUENCE OF AnyString |
57 | ||
af710487 | 58 | -- Set containing all of the above |
970ed795 EL |
59 | ComplexSet ::= SET { |
60 | product SeqProduct, | |
61 | numbers SET OF Number, | |
62 | strings ManyStrings | |
63 | } | |
64 | ||
af710487 | 65 | Priority ::= ENUMERATED { low, normal, medium, high, urgent } |
66 | ||
67 | Conditionality ::= ENUMERATED { optional, conditional, mandatory } | |
68 | ||
69 | ProtocolElem-ID ::= INTEGER (0..65535) | |
70 | ||
71 | -- IOC | |
72 | PROTOCOL-ELEMS ::= CLASS | |
73 | { | |
74 | &id ProtocolElem-ID UNIQUE, | |
75 | &priority Priority, | |
76 | &Value, | |
77 | &conditionality Conditionality | |
78 | } | |
79 | WITH SYNTAX | |
80 | { | |
81 | ID &id | |
82 | PRIORITY &priority | |
83 | TYPE &Value | |
84 | CONDITIONALITY &conditionality | |
85 | } | |
86 | ||
87 | -- parameterized type | |
88 | ProtocolElem-Field {PROTOCOL-ELEMS : ElemsSetParam} ::= SEQUENCE | |
89 | { | |
90 | id PROTOCOL-ELEMS.&id ({ElemsSetParam}), | |
91 | priority PROTOCOL-ELEMS.&priority ({ElemsSetParam}{@id}), | |
92 | val PROTOCOL-ELEMS.&Value ({ElemsSetParam}{@id}) | |
93 | } | |
94 | ||
95 | ||
96 | -- Information objects | |
97 | ies-Set-Element-1 PROTOCOL-ELEMS ::= | |
98 | { | |
99 | ID 0 | |
100 | PRIORITY low | |
101 | TYPE INTEGER | |
102 | CONDITIONALITY mandatory | |
103 | } | |
104 | ||
105 | ies-Set-Element-2 PROTOCOL-ELEMS ::= | |
106 | { | |
107 | ID 1 | |
108 | PRIORITY high | |
109 | TYPE IA5String | |
110 | CONDITIONALITY optional | |
111 | } | |
112 | -- Information Object Set | |
113 | Elems-Set PROTOCOL-ELEMS ::= { ies-Set-Element-1 | ies-Set-Element-2 } | |
114 | ||
115 | ||
116 | -- instantiation | |
117 | ProtocolElem-Field1 ::= ProtocolElem-Field {{Elems-Set}} | |
118 | ||
119 | ProtocolElem-Field2 ::= ProtocolElem-Field {{ies-Set-Element-2 }} | |
120 | ||
121 | -- Choice containing NULL | |
122 | Price ::= CHOICE | |
123 | { | |
124 | value REAL, | |
125 | invaluable NULL | |
126 | } | |
127 | ||
128 | -- Sequence containing an object identifier and an ANY type | |
129 | Object ::= SEQUENCE | |
130 | { | |
131 | id OBJECT IDENTIFIER, | |
132 | data ANY | |
133 | } | |
134 | ||
135 | -- Sequence containing an optional NULL field | |
136 | HasNull ::= SEQUENCE | |
137 | { | |
138 | theNull NULL OPTIONAL | |
139 | } | |
140 | ||
141 | ||
970ed795 EL |
142 | -- Values and their encoding -- |
143 | ------------------------------- | |
144 | ||
145 | -- SeqOfInt | |
146 | c-ints SeqOfInt ::= { 1, 3, 6 } | |
147 | ||
148 | c-ints-str VisibleString ::= "[1,3,6]" | |
149 | ||
150 | -- SeqProduct | |
151 | c-product SeqProduct ::= { | |
152 | name "TV", | |
153 | price 250.0, | |
154 | id '1D65'H, | |
155 | available TRUE | |
156 | } | |
157 | ||
158 | c-product-str VisibleString ::= "{""name"":""TV"",""price"":250.000000,""id"":""1D65"",""available"":true}" | |
159 | ||
160 | -- Number | |
161 | c-number Number ::= binary : '1100'B | |
162 | ||
163 | c-number-str VisibleString ::= "{""binary"":""1100""}" | |
164 | ||
165 | -- ManyStrings | |
166 | c-strings ManyStrings ::= { | |
167 | generalstr : "General String <o", | |
168 | numericstr : "1 457 664", | |
169 | utf8str : "Doesn't actually contain non-ASCII characters", | |
170 | printablestr : "hello", | |
171 | universalstr : "not so universal, apparently", | |
172 | bmpstr : "abc", | |
173 | ia5str : "one two three", | |
174 | teletexstr : "Let's just bug out and call it even, OK?!", | |
175 | videotexstr : "abc123;.", | |
176 | visiblestr : "invisible" | |
177 | } | |
178 | ||
179 | c-strings-str VisibleString ::= "[{""generalstr"":""General String <o""},{""numericstr"":""1 457 664""},{""utf8str"":""Doesn't actually contain non-ASCII characters""},{""printablestr"":""hello""},{""universalstr"":""not so universal, apparently""},{""bmpstr"":""abc""},{""ia5str"":""one two three""},{""teletexstr"":""Let's just bug out and call it even, OK?!""},{""videotexstr"":""abc123;.""},{""visiblestr"":""invisible""}]" | |
180 | ||
181 | -- ComplexSet | |
182 | c-set-val ComplexSet ::= { | |
183 | product { | |
184 | name "Headset", | |
185 | price 28.5, | |
186 | available FALSE | |
187 | }, | |
188 | numbers { | |
189 | hexadecimal : '16678D'H, | |
190 | decimal : 12 | |
191 | }, | |
192 | strings { | |
193 | printablestr : "first", | |
194 | numericstr : "2" | |
195 | } | |
196 | } | |
197 | ||
198 | c-set-val-str VisibleString ::= "{""product"":{""name"":""Headset"",""price"":28.500000,""available"":false},""numbers"":[{""hexadecimal"":""16678D""},{""decimal"":12}],""strings"":[{""printablestr"":""first""},{""numericstr"":""2""}]}" | |
199 | ||
af710487 | 200 | -- Object |
201 | c-obj Object ::= { | |
202 | id { joint-iso-itu-t remote-operations(4) informationObjects(5) version1(0) }, | |
203 | data 'DEADBEEF'H | |
204 | } | |
205 | ||
206 | c-obj-str VisibleString ::= "{""id"":""2.4.5.0"",""data"":""DEADBEEF""}" | |
207 | ||
208 | -- HasNull | |
209 | c-null HasNull ::= { theNull NULL } | |
210 | c-not-null HasNull ::= {} | |
211 | ||
212 | c-null-str VisibleString ::= "{""theNull"":null}" | |
213 | c-not-null-str VisibleString ::= "{}" | |
214 | ||
970ed795 | 215 | END |