remark release date
[Net-Radio-Location-SUPL-Test.git] / asn1 / GANSSSatelliteElement.c
bloba5b55ddc65569c7691e0871625a379eca2849c46
1 /*
2 * Generated by asn1c-0.9.23 (http://lionet.info/asn1c)
3 * From ASN.1 module "RRLP-Components"
4 * found in "../asn1src/RRLP-Components.asn"
5 * `asn1c -gen-PER -fskeletons-copy -fnative-types`
6 */
8 #include "GANSSSatelliteElement.h"
10 static int
11 memb_svHealth_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
12 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13 const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
14 size_t size;
16 if(!sptr) {
17 _ASN_CTFAIL(app_key, td, sptr,
18 "%s: value not given (%s:%d)",
19 td->name, __FILE__, __LINE__);
20 return -1;
23 if(st->size > 0) {
24 /* Size in bits */
25 size = 8 * st->size - (st->bits_unused & 0x07);
26 } else {
27 size = 0;
30 if((size == 5)) {
31 /* Constraint check succeeded */
32 return 0;
33 } else {
34 _ASN_CTFAIL(app_key, td, sptr,
35 "%s: constraint failed (%s:%d)",
36 td->name, __FILE__, __LINE__);
37 return -1;
41 static int
42 memb_iod_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
43 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
44 long value;
46 if(!sptr) {
47 _ASN_CTFAIL(app_key, td, sptr,
48 "%s: value not given (%s:%d)",
49 td->name, __FILE__, __LINE__);
50 return -1;
53 value = *(const long *)sptr;
55 if((value >= 0 && value <= 1023)) {
56 /* Constraint check succeeded */
57 return 0;
58 } else {
59 _ASN_CTFAIL(app_key, td, sptr,
60 "%s: constraint failed (%s:%d)",
61 td->name, __FILE__, __LINE__);
62 return -1;
66 static int
67 memb_svHealthMSB_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
68 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
69 const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
70 size_t size;
72 if(!sptr) {
73 _ASN_CTFAIL(app_key, td, sptr,
74 "%s: value not given (%s:%d)",
75 td->name, __FILE__, __LINE__);
76 return -1;
79 if(st->size > 0) {
80 /* Size in bits */
81 size = 8 * st->size - (st->bits_unused & 0x07);
82 } else {
83 size = 0;
86 if((size == 1)) {
87 /* Constraint check succeeded */
88 return 0;
89 } else {
90 _ASN_CTFAIL(app_key, td, sptr,
91 "%s: constraint failed (%s:%d)",
92 td->name, __FILE__, __LINE__);
93 return -1;
97 static int
98 memb_iodMSB_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
99 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
100 long value;
102 if(!sptr) {
103 _ASN_CTFAIL(app_key, td, sptr,
104 "%s: value not given (%s:%d)",
105 td->name, __FILE__, __LINE__);
106 return -1;
109 value = *(const long *)sptr;
111 if((value >= 0 && value <= 1)) {
112 /* Constraint check succeeded */
113 return 0;
114 } else {
115 _ASN_CTFAIL(app_key, td, sptr,
116 "%s: constraint failed (%s:%d)",
117 td->name, __FILE__, __LINE__);
118 return -1;
122 static asn_per_constraints_t asn_PER_memb_svHealth_constr_3 = {
123 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
124 { APC_CONSTRAINED, 0, 0, 5, 5 } /* (SIZE(5..5)) */,
125 0, 0 /* No PER value map */
127 static asn_per_constraints_t asn_PER_memb_iod_constr_4 = {
128 { APC_CONSTRAINED, 10, 10, 0, 1023 } /* (0..1023) */,
129 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
130 0, 0 /* No PER value map */
132 static asn_per_constraints_t asn_PER_memb_svHealthMSB_constr_8 = {
133 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
134 { APC_CONSTRAINED, 0, 0, 1, 1 } /* (SIZE(1..1)) */,
135 0, 0 /* No PER value map */
137 static asn_per_constraints_t asn_PER_memb_iodMSB_constr_9 = {
138 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
139 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
140 0, 0 /* No PER value map */
142 static asn_TYPE_member_t asn_MBR_GANSSSatelliteElement_1[] = {
143 { ATF_NOFLAGS, 0, offsetof(struct GANSSSatelliteElement, svID),
144 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
145 -1, /* IMPLICIT tag at current level */
146 &asn_DEF_SVID,
147 0, /* Defer constraints checking to the member type */
148 0, /* No PER visible constraints */
150 "svID"
152 { ATF_NOFLAGS, 0, offsetof(struct GANSSSatelliteElement, svHealth),
153 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
154 -1, /* IMPLICIT tag at current level */
155 &asn_DEF_BIT_STRING,
156 memb_svHealth_constraint_1,
157 &asn_PER_memb_svHealth_constr_3,
159 "svHealth"
161 { ATF_NOFLAGS, 0, offsetof(struct GANSSSatelliteElement, iod),
162 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
163 -1, /* IMPLICIT tag at current level */
164 &asn_DEF_NativeInteger,
165 memb_iod_constraint_1,
166 &asn_PER_memb_iod_constr_4,
168 "iod"
170 { ATF_NOFLAGS, 0, offsetof(struct GANSSSatelliteElement, ganssClockModel),
171 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
172 +1, /* EXPLICIT tag at current level */
173 &asn_DEF_GANSSClockModel,
174 0, /* Defer constraints checking to the member type */
175 0, /* No PER visible constraints */
177 "ganssClockModel"
179 { ATF_NOFLAGS, 0, offsetof(struct GANSSSatelliteElement, ganssOrbitModel),
180 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
181 +1, /* EXPLICIT tag at current level */
182 &asn_DEF_GANSSOrbitModel,
183 0, /* Defer constraints checking to the member type */
184 0, /* No PER visible constraints */
186 "ganssOrbitModel"
188 { ATF_POINTER, 2, offsetof(struct GANSSSatelliteElement, svHealthMSB),
189 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
190 -1, /* IMPLICIT tag at current level */
191 &asn_DEF_BIT_STRING,
192 memb_svHealthMSB_constraint_1,
193 &asn_PER_memb_svHealthMSB_constr_8,
195 "svHealthMSB"
197 { ATF_POINTER, 1, offsetof(struct GANSSSatelliteElement, iodMSB),
198 (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
199 -1, /* IMPLICIT tag at current level */
200 &asn_DEF_NativeInteger,
201 memb_iodMSB_constraint_1,
202 &asn_PER_memb_iodMSB_constr_9,
204 "iodMSB"
207 static int asn_MAP_GANSSSatelliteElement_oms_1[] = { 5, 6 };
208 static ber_tlv_tag_t asn_DEF_GANSSSatelliteElement_tags_1[] = {
209 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
211 static asn_TYPE_tag2member_t asn_MAP_GANSSSatelliteElement_tag2el_1[] = {
212 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* svID at 1294 */
213 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* svHealth at 1295 */
214 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* iod at 1296 */
215 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* ganssClockModel at 1297 */
216 { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* ganssOrbitModel at 1298 */
217 { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* svHealthMSB at 1300 */
218 { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 } /* iodMSB at 1301 */
220 static asn_SEQUENCE_specifics_t asn_SPC_GANSSSatelliteElement_specs_1 = {
221 sizeof(struct GANSSSatelliteElement),
222 offsetof(struct GANSSSatelliteElement, _asn_ctx),
223 asn_MAP_GANSSSatelliteElement_tag2el_1,
224 7, /* Count of tags in the map */
225 asn_MAP_GANSSSatelliteElement_oms_1, /* Optional members */
226 0, 2, /* Root/Additions */
227 4, /* Start extensions */
228 8 /* Stop extensions */
230 asn_TYPE_descriptor_t asn_DEF_GANSSSatelliteElement = {
231 "GANSSSatelliteElement",
232 "GANSSSatelliteElement",
233 SEQUENCE_free,
234 SEQUENCE_print,
235 SEQUENCE_constraint,
236 SEQUENCE_decode_ber,
237 SEQUENCE_encode_der,
238 SEQUENCE_decode_xer,
239 SEQUENCE_encode_xer,
240 SEQUENCE_decode_uper,
241 SEQUENCE_encode_uper,
242 0, /* Use generic outmost tag fetcher */
243 asn_DEF_GANSSSatelliteElement_tags_1,
244 sizeof(asn_DEF_GANSSSatelliteElement_tags_1)
245 /sizeof(asn_DEF_GANSSSatelliteElement_tags_1[0]), /* 1 */
246 asn_DEF_GANSSSatelliteElement_tags_1, /* Same as above */
247 sizeof(asn_DEF_GANSSSatelliteElement_tags_1)
248 /sizeof(asn_DEF_GANSSSatelliteElement_tags_1[0]), /* 1 */
249 0, /* No PER visible constraints */
250 asn_MBR_GANSSSatelliteElement_1,
251 7, /* Elements count */
252 &asn_SPC_GANSSSatelliteElement_specs_1 /* Additional specs */