Vanetza
 
Loading...
Searching...
No Matches
Elevation.c
1/*
2 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3 * From ASN.1 module "IEEE1609dot2BaseTypes"
4 * found in "asn1/IEEE1609dot2BaseTypes.asn"
5 * `asn1c -fcompound-names -fincludes-quoted -no-gen-example -R`
6 */
7
8#include "Elevation.h"
9
10int
11Elevation_constraint(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 >= 0L && value <= 65535L)) {
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/*
36 * This type is implemented using ElevInt,
37 * so here we adjust the DEF accordingly.
38 */
39#if !defined(ASN_DISABLE_OER_SUPPORT)
40static asn_oer_constraints_t asn_OER_type_Elevation_constr_1 CC_NOTUSED = {
41 { 2, 1 } /* (0..65535) */,
42 -1};
43#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
44#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
45asn_per_constraints_t asn_PER_type_Elevation_constr_1 CC_NOTUSED = {
46 { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */,
47 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
48 0, 0 /* No PER value map */
49};
50#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
51static const ber_tlv_tag_t asn_DEF_Elevation_tags_1[] = {
52 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
53};
54asn_TYPE_descriptor_t asn_DEF_Elevation = {
55 "Elevation",
56 "Elevation",
57 &asn_OP_NativeInteger,
58 asn_DEF_Elevation_tags_1,
59 sizeof(asn_DEF_Elevation_tags_1)
60 /sizeof(asn_DEF_Elevation_tags_1[0]), /* 1 */
61 asn_DEF_Elevation_tags_1, /* Same as above */
62 sizeof(asn_DEF_Elevation_tags_1)
63 /sizeof(asn_DEF_Elevation_tags_1[0]), /* 1 */
64 {
65#if !defined(ASN_DISABLE_OER_SUPPORT)
66 &asn_OER_type_Elevation_constr_1,
67#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
68#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
69 &asn_PER_type_Elevation_constr_1,
70#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
71 Elevation_constraint
72 },
73 0, 0, /* No members */
74 0 /* No specifics */
75};
76