4055c18d133fe42f3f6c445af5ce345685c81a85
[ric-plt/submgr.git] / e2ap / lib / WidebandCQICodeword1.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "X2AP-IEs"
4  *      found in "X2AP-15-4-0.asn1"
5  *      `asn1c -D ./asn1_n1 -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
6  */
7
8 #include "WidebandCQICodeword1.h"
9
10 static int
11 memb_four_bitCQI_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
12                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13         long value;
14         
15         if(!sptr) {
16                 ASN__CTFAIL(app_key, td, sptr,
17                         "%s: value not given (%s:%d)",
18                         td->name, __FILE__, __LINE__);
19                 return -1;
20         }
21         
22         value = *(const long *)sptr;
23         
24         if((value >= 0 && value <= 15)) {
25                 /* Constraint check succeeded */
26                 return 0;
27         } else {
28                 ASN__CTFAIL(app_key, td, sptr,
29                         "%s: constraint failed (%s:%d)",
30                         td->name, __FILE__, __LINE__);
31                 return -1;
32         }
33 }
34
35 static int
36 memb_three_bitSpatialDifferentialCQI_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
37                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
38         long value;
39         
40         if(!sptr) {
41                 ASN__CTFAIL(app_key, td, sptr,
42                         "%s: value not given (%s:%d)",
43                         td->name, __FILE__, __LINE__);
44                 return -1;
45         }
46         
47         value = *(const long *)sptr;
48         
49         if((value >= 0 && value <= 7)) {
50                 /* Constraint check succeeded */
51                 return 0;
52         } else {
53                 ASN__CTFAIL(app_key, td, sptr,
54                         "%s: constraint failed (%s:%d)",
55                         td->name, __FILE__, __LINE__);
56                 return -1;
57         }
58 }
59
60 static asn_oer_constraints_t asn_OER_memb_four_bitCQI_constr_2 CC_NOTUSED = {
61         { 0, 0 },
62         -1};
63 static asn_per_constraints_t asn_PER_memb_four_bitCQI_constr_2 CC_NOTUSED = {
64         { APC_CONSTRAINED | APC_EXTENSIBLE,  4,  4,  0,  15 }   /* (0..15,...) */,
65         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
66         0, 0    /* No PER value map */
67 };
68 static asn_oer_constraints_t asn_OER_memb_three_bitSpatialDifferentialCQI_constr_3 CC_NOTUSED = {
69         { 0, 0 },
70         -1};
71 static asn_per_constraints_t asn_PER_memb_three_bitSpatialDifferentialCQI_constr_3 CC_NOTUSED = {
72         { APC_CONSTRAINED | APC_EXTENSIBLE,  3,  3,  0,  7 }    /* (0..7,...) */,
73         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
74         0, 0    /* No PER value map */
75 };
76 static asn_oer_constraints_t asn_OER_type_WidebandCQICodeword1_constr_1 CC_NOTUSED = {
77         { 0, 0 },
78         -1};
79 asn_per_constraints_t asn_PER_type_WidebandCQICodeword1_constr_1 CC_NOTUSED = {
80         { APC_CONSTRAINED | APC_EXTENSIBLE,  1,  1,  0,  1 }    /* (0..1,...) */,
81         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
82         0, 0    /* No PER value map */
83 };
84 asn_TYPE_member_t asn_MBR_WidebandCQICodeword1_1[] = {
85         { ATF_NOFLAGS, 0, offsetof(struct WidebandCQICodeword1, choice.four_bitCQI),
86                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
87                 -1,     /* IMPLICIT tag at current level */
88                 &asn_DEF_NativeInteger,
89                 0,
90                 { &asn_OER_memb_four_bitCQI_constr_2, &asn_PER_memb_four_bitCQI_constr_2,  memb_four_bitCQI_constraint_1 },
91                 0, 0, /* No default value */
92                 "four-bitCQI"
93                 },
94         { ATF_NOFLAGS, 0, offsetof(struct WidebandCQICodeword1, choice.three_bitSpatialDifferentialCQI),
95                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
96                 -1,     /* IMPLICIT tag at current level */
97                 &asn_DEF_NativeInteger,
98                 0,
99                 { &asn_OER_memb_three_bitSpatialDifferentialCQI_constr_3, &asn_PER_memb_three_bitSpatialDifferentialCQI_constr_3,  memb_three_bitSpatialDifferentialCQI_constraint_1 },
100                 0, 0, /* No default value */
101                 "three-bitSpatialDifferentialCQI"
102                 },
103 };
104 static const asn_TYPE_tag2member_t asn_MAP_WidebandCQICodeword1_tag2el_1[] = {
105     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* four-bitCQI */
106     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* three-bitSpatialDifferentialCQI */
107 };
108 asn_CHOICE_specifics_t asn_SPC_WidebandCQICodeword1_specs_1 = {
109         sizeof(struct WidebandCQICodeword1),
110         offsetof(struct WidebandCQICodeword1, _asn_ctx),
111         offsetof(struct WidebandCQICodeword1, present),
112         sizeof(((struct WidebandCQICodeword1 *)0)->present),
113         asn_MAP_WidebandCQICodeword1_tag2el_1,
114         2,      /* Count of tags in the map */
115         0, 0,
116         2       /* Extensions start */
117 };
118 asn_TYPE_descriptor_t asn_DEF_WidebandCQICodeword1 = {
119         "WidebandCQICodeword1",
120         "WidebandCQICodeword1",
121         &asn_OP_CHOICE,
122         0,      /* No effective tags (pointer) */
123         0,      /* No effective tags (count) */
124         0,      /* No tags (pointer) */
125         0,      /* No tags (count) */
126         { &asn_OER_type_WidebandCQICodeword1_constr_1, &asn_PER_type_WidebandCQICodeword1_constr_1, CHOICE_constraint },
127         asn_MBR_WidebandCQICodeword1_1,
128         2,      /* Elements count */
129         &asn_SPC_WidebandCQICodeword1_specs_1   /* Additional specs */
130 };
131