remark release date
[Net-Radio-Location-SUPL-Test.git] / asn1 / Horveluncert.c
blob4bcf8263648497f6f194e18c492372e47b87aaa1
1 /*
2 * Generated by asn1c-0.9.23 (http://lionet.info/asn1c)
3 * From ASN.1 module "ULP-Components"
4 * found in "../asn1src/ULP-Components.asn"
5 * `asn1c -gen-PER -fskeletons-copy -fnative-types`
6 */
8 #include "Horveluncert.h"
10 static int
11 memb_bearing_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 == 9)) {
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_horspeed_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
43 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
44 const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
45 size_t size;
47 if(!sptr) {
48 _ASN_CTFAIL(app_key, td, sptr,
49 "%s: value not given (%s:%d)",
50 td->name, __FILE__, __LINE__);
51 return -1;
54 if(st->size > 0) {
55 /* Size in bits */
56 size = 8 * st->size - (st->bits_unused & 0x07);
57 } else {
58 size = 0;
61 if((size == 16)) {
62 /* Constraint check succeeded */
63 return 0;
64 } else {
65 _ASN_CTFAIL(app_key, td, sptr,
66 "%s: constraint failed (%s:%d)",
67 td->name, __FILE__, __LINE__);
68 return -1;
72 static int
73 memb_uncertspeed_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
74 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
75 const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
76 size_t size;
78 if(!sptr) {
79 _ASN_CTFAIL(app_key, td, sptr,
80 "%s: value not given (%s:%d)",
81 td->name, __FILE__, __LINE__);
82 return -1;
85 if(st->size > 0) {
86 /* Size in bits */
87 size = 8 * st->size - (st->bits_unused & 0x07);
88 } else {
89 size = 0;
92 if((size == 8)) {
93 /* Constraint check succeeded */
94 return 0;
95 } else {
96 _ASN_CTFAIL(app_key, td, sptr,
97 "%s: constraint failed (%s:%d)",
98 td->name, __FILE__, __LINE__);
99 return -1;
103 static asn_per_constraints_t asn_PER_memb_bearing_constr_2 = {
104 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
105 { APC_CONSTRAINED, 0, 0, 9, 9 } /* (SIZE(9..9)) */,
106 0, 0 /* No PER value map */
108 static asn_per_constraints_t asn_PER_memb_horspeed_constr_3 = {
109 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
110 { APC_CONSTRAINED, 0, 0, 16, 16 } /* (SIZE(16..16)) */,
111 0, 0 /* No PER value map */
113 static asn_per_constraints_t asn_PER_memb_uncertspeed_constr_4 = {
114 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
115 { APC_CONSTRAINED, 0, 0, 8, 8 } /* (SIZE(8..8)) */,
116 0, 0 /* No PER value map */
118 static asn_TYPE_member_t asn_MBR_Horveluncert_1[] = {
119 { ATF_NOFLAGS, 0, offsetof(struct Horveluncert, bearing),
120 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
121 -1, /* IMPLICIT tag at current level */
122 &asn_DEF_BIT_STRING,
123 memb_bearing_constraint_1,
124 &asn_PER_memb_bearing_constr_2,
126 "bearing"
128 { ATF_NOFLAGS, 0, offsetof(struct Horveluncert, horspeed),
129 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
130 -1, /* IMPLICIT tag at current level */
131 &asn_DEF_BIT_STRING,
132 memb_horspeed_constraint_1,
133 &asn_PER_memb_horspeed_constr_3,
135 "horspeed"
137 { ATF_NOFLAGS, 0, offsetof(struct Horveluncert, uncertspeed),
138 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
139 -1, /* IMPLICIT tag at current level */
140 &asn_DEF_BIT_STRING,
141 memb_uncertspeed_constraint_1,
142 &asn_PER_memb_uncertspeed_constr_4,
144 "uncertspeed"
147 static ber_tlv_tag_t asn_DEF_Horveluncert_tags_1[] = {
148 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
150 static asn_TYPE_tag2member_t asn_MAP_Horveluncert_tag2el_1[] = {
151 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* bearing at 233 */
152 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* horspeed at 234 */
153 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* uncertspeed at 235 */
155 static asn_SEQUENCE_specifics_t asn_SPC_Horveluncert_specs_1 = {
156 sizeof(struct Horveluncert),
157 offsetof(struct Horveluncert, _asn_ctx),
158 asn_MAP_Horveluncert_tag2el_1,
159 3, /* Count of tags in the map */
160 0, 0, 0, /* Optional elements (not needed) */
161 2, /* Start extensions */
162 4 /* Stop extensions */
164 asn_TYPE_descriptor_t asn_DEF_Horveluncert = {
165 "Horveluncert",
166 "Horveluncert",
167 SEQUENCE_free,
168 SEQUENCE_print,
169 SEQUENCE_constraint,
170 SEQUENCE_decode_ber,
171 SEQUENCE_encode_der,
172 SEQUENCE_decode_xer,
173 SEQUENCE_encode_xer,
174 SEQUENCE_decode_uper,
175 SEQUENCE_encode_uper,
176 0, /* Use generic outmost tag fetcher */
177 asn_DEF_Horveluncert_tags_1,
178 sizeof(asn_DEF_Horveluncert_tags_1)
179 /sizeof(asn_DEF_Horveluncert_tags_1[0]), /* 1 */
180 asn_DEF_Horveluncert_tags_1, /* Same as above */
181 sizeof(asn_DEF_Horveluncert_tags_1)
182 /sizeof(asn_DEF_Horveluncert_tags_1[0]), /* 1 */
183 0, /* No PER visible constraints */
184 asn_MBR_Horveluncert_1,
185 3, /* Elements count */
186 &asn_SPC_Horveluncert_specs_1 /* Additional specs */