/*
 * SPDX-FileCopyrightText: (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
 * SPDX-License-Identifier: BSD-1-Clause
 * Generated by asn1c-0.9.22 (http://lionet.info/asn1c)
 * From ASN.1 module "RRLP-Components"
 *     found in "../rrlp-components.asn"
 */

#include "AlmanacElement.h"

static int memb_almanacE_constraint_1(asn_TYPE_descriptor_t *td,
    const void *sptr,
    asn_app_constraint_failed_f *ctfailcb,
    void *app_key)
{
    long value;

    if (!sptr)
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }

    value = *(const long *)sptr;

    if ((value >= 0 && value <= 65535))
        {
            /* Constraint check succeeded */
            return 0;
        }
    else
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }
}

static int memb_alamanacToa_constraint_1(asn_TYPE_descriptor_t *td,
    const void *sptr,
    asn_app_constraint_failed_f *ctfailcb,
    void *app_key)
{
    long value;

    if (!sptr)
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }

    value = *(const long *)sptr;

    if ((value >= 0 && value <= 255))
        {
            /* Constraint check succeeded */
            return 0;
        }
    else
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }
}

static int memb_almanacKsii_constraint_1(asn_TYPE_descriptor_t *td,
    const void *sptr,
    asn_app_constraint_failed_f *ctfailcb,
    void *app_key)
{
    long value;

    if (!sptr)
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }

    value = *(const long *)sptr;

    if ((value >= -32768 && value <= 32767))
        {
            /* Constraint check succeeded */
            return 0;
        }
    else
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }
}

static int memb_almanacOmegaDot_constraint_1(
    asn_TYPE_descriptor_t *td, const void *sptr,
    asn_app_constraint_failed_f *ctfailcb, void *app_key)
{
    long value;

    if (!sptr)
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }

    value = *(const long *)sptr;

    if ((value >= -32768 && value <= 32767))
        {
            /* Constraint check succeeded */
            return 0;
        }
    else
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }
}

static int memb_almanacSVhealth_constraint_1(
    asn_TYPE_descriptor_t *td, const void *sptr,
    asn_app_constraint_failed_f *ctfailcb, void *app_key)
{
    long value;

    if (!sptr)
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }

    value = *(const long *)sptr;

    if ((value >= 0 && value <= 255))
        {
            /* Constraint check succeeded */
            return 0;
        }
    else
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }
}

static int memb_almanacAPowerHalf_constraint_1(
    asn_TYPE_descriptor_t *td, const void *sptr,
    asn_app_constraint_failed_f *ctfailcb, void *app_key)
{
    long value;

    if (!sptr)
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }

    value = *(const long *)sptr;

    if ((value >= 0 && value <= 16777215))
        {
            /* Constraint check succeeded */
            return 0;
        }
    else
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }
}

static int memb_almanacOmega0_constraint_1(
    asn_TYPE_descriptor_t *td, const void *sptr,
    asn_app_constraint_failed_f *ctfailcb, void *app_key)
{
    long value;

    if (!sptr)
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }

    value = *(const long *)sptr;

    if ((value >= -8388608 && value <= 8388607))
        {
            /* Constraint check succeeded */
            return 0;
        }
    else
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }
}

static int memb_almanacW_constraint_1(asn_TYPE_descriptor_t *td,
    const void *sptr,
    asn_app_constraint_failed_f *ctfailcb,
    void *app_key)
{
    long value;

    if (!sptr)
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }

    value = *(const long *)sptr;

    if ((value >= -8388608 && value <= 8388607))
        {
            /* Constraint check succeeded */
            return 0;
        }
    else
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }
}

static int memb_almanacM0_constraint_1(asn_TYPE_descriptor_t *td,
    const void *sptr,
    asn_app_constraint_failed_f *ctfailcb,
    void *app_key)
{
    long value;

    if (!sptr)
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }

    value = *(const long *)sptr;

    if ((value >= -8388608 && value <= 8388607))
        {
            /* Constraint check succeeded */
            return 0;
        }
    else
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }
}

static int memb_almanacAF0_constraint_1(asn_TYPE_descriptor_t *td,
    const void *sptr,
    asn_app_constraint_failed_f *ctfailcb,
    void *app_key)
{
    long value;

    if (!sptr)
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }

    value = *(const long *)sptr;

    if ((value >= -1024 && value <= 1023))
        {
            /* Constraint check succeeded */
            return 0;
        }
    else
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }
}

static int memb_almanacAF1_constraint_1(asn_TYPE_descriptor_t *td,
    const void *sptr,
    asn_app_constraint_failed_f *ctfailcb,
    void *app_key)
{
    long value;

    if (!sptr)
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }

    value = *(const long *)sptr;

    if ((value >= -1024 && value <= 1023))
        {
            /* Constraint check succeeded */
            return 0;
        }
    else
        {
            _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)",
                td->name, __FILE__, __LINE__);
            return -1;
        }
}

static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_E_CONSTR_3 = {
    {APC_CONSTRAINED, 16, 16, 0, 65535} /* (0..65535) */,
    {APC_UNCONSTRAINED, -1, -1, 0, 0},
    0,
    0 /* No PER value map */
};
static asn_per_constraints_t ASN_PER_MEMB_ALAMANAC_TOA_CONSTR_4 = {
    {APC_CONSTRAINED, 8, 8, 0, 255} /* (0..255) */,
    {APC_UNCONSTRAINED, -1, -1, 0, 0},
    0,
    0 /* No PER value map */
};
static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_KSII_CONSTR_5 = {
    {APC_CONSTRAINED, 16, 16, -32768, 32767} /* (-32768..32767) */,
    {APC_UNCONSTRAINED, -1, -1, 0, 0},
    0,
    0 /* No PER value map */
};
static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_OMEGA_DOT_CONSTR_6 = {
    {APC_CONSTRAINED, 16, 16, -32768, 32767} /* (-32768..32767) */,
    {APC_UNCONSTRAINED, -1, -1, 0, 0},
    0,
    0 /* No PER value map */
};
static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_S_VHEALTH_CONSTR_7 = {
    {APC_CONSTRAINED, 8, 8, 0, 255} /* (0..255) */,
    {APC_UNCONSTRAINED, -1, -1, 0, 0},
    0,
    0 /* No PER value map */
};
static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_A_POWER_HALF_CONSTR_8 = {
    {APC_CONSTRAINED, 24, -1, 0, 16777215} /* (0..16777215) */,
    {APC_UNCONSTRAINED, -1, -1, 0, 0},
    0,
    0 /* No PER value map */
};
static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_OMEGA0_CONSTR_9 = {
    {APC_CONSTRAINED, 24, -1, -8388608, 8388607} /* (-8388608..8388607) */,
    {APC_UNCONSTRAINED, -1, -1, 0, 0},
    0,
    0 /* No PER value map */
};
static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_W_CONSTR_10 = {
    {APC_CONSTRAINED, 24, -1, -8388608, 8388607} /* (-8388608..8388607) */,
    {APC_UNCONSTRAINED, -1, -1, 0, 0},
    0,
    0 /* No PER value map */
};
static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_M0_CONSTR_11 = {
    {APC_CONSTRAINED, 24, -1, -8388608, 8388607} /* (-8388608..8388607) */,
    {APC_UNCONSTRAINED, -1, -1, 0, 0},
    0,
    0 /* No PER value map */
};
static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_A_F0_CONSTR_12 = {
    {APC_CONSTRAINED, 11, 11, -1024, 1023} /* (-1024..1023) */,
    {APC_UNCONSTRAINED, -1, -1, 0, 0},
    0,
    0 /* No PER value map */
};
static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_A_F1_CONSTR_13 = {
    {APC_CONSTRAINED, 11, 11, -1024, 1023} /* (-1024..1023) */,
    {APC_UNCONSTRAINED, -1, -1, 0, 0},
    0,
    0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_AlmanacElement_1[] = {
    {ATF_NOFLAGS, 0, offsetof(struct AlmanacElement, satelliteID),
        (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */
        &asn_DEF_SatelliteID,
        0, /* Defer constraints checking to the member type */
        0, /* No PER visible constraints */
        0, "satelliteID"},
    {ATF_NOFLAGS, 0, offsetof(struct AlmanacElement, almanacE),
        (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */
        &asn_DEF_NativeInteger, memb_almanacE_constraint_1,
        &ASN_PER_MEMB_ALMANAC_E_CONSTR_3, 0, "almanacE"},
    {ATF_NOFLAGS, 0, offsetof(struct AlmanacElement, alamanacToa),
        (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */
        &asn_DEF_NativeInteger, memb_alamanacToa_constraint_1,
        &ASN_PER_MEMB_ALAMANAC_TOA_CONSTR_4, 0, "alamanacToa"},
    {ATF_NOFLAGS, 0, offsetof(struct AlmanacElement, almanacKsii),
        (ASN_TAG_CLASS_CONTEXT | (3 << 2)), -1, /* IMPLICIT tag at current level */
        &asn_DEF_NativeInteger, memb_almanacKsii_constraint_1,
        &ASN_PER_MEMB_ALMANAC_KSII_CONSTR_5, 0, "almanacKsii"},
    {ATF_NOFLAGS, 0, offsetof(struct AlmanacElement, almanacOmegaDot),
        (ASN_TAG_CLASS_CONTEXT | (4 << 2)), -1, /* IMPLICIT tag at current level */
        &asn_DEF_NativeInteger, memb_almanacOmegaDot_constraint_1,
        &ASN_PER_MEMB_ALMANAC_OMEGA_DOT_CONSTR_6, 0, "almanacOmegaDot"},
    {ATF_NOFLAGS, 0, offsetof(struct AlmanacElement, almanacSVhealth),
        (ASN_TAG_CLASS_CONTEXT | (5 << 2)), -1, /* IMPLICIT tag at current level */
        &asn_DEF_NativeInteger, memb_almanacSVhealth_constraint_1,
        &ASN_PER_MEMB_ALMANAC_S_VHEALTH_CONSTR_7, 0, "almanacSVhealth"},
    {ATF_NOFLAGS, 0, offsetof(struct AlmanacElement, almanacAPowerHalf),
        (ASN_TAG_CLASS_CONTEXT | (6 << 2)), -1, /* IMPLICIT tag at current level */
        &asn_DEF_NativeInteger, memb_almanacAPowerHalf_constraint_1,
        &ASN_PER_MEMB_ALMANAC_A_POWER_HALF_CONSTR_8, 0, "almanacAPowerHalf"},
    {ATF_NOFLAGS, 0, offsetof(struct AlmanacElement, almanacOmega0),
        (ASN_TAG_CLASS_CONTEXT | (7 << 2)), -1, /* IMPLICIT tag at current level */
        &asn_DEF_NativeInteger, memb_almanacOmega0_constraint_1,
        &ASN_PER_MEMB_ALMANAC_OMEGA0_CONSTR_9, 0, "almanacOmega0"},
    {ATF_NOFLAGS, 0, offsetof(struct AlmanacElement, almanacW),
        (ASN_TAG_CLASS_CONTEXT | (8 << 2)), -1, /* IMPLICIT tag at current level */
        &asn_DEF_NativeInteger, memb_almanacW_constraint_1,
        &ASN_PER_MEMB_ALMANAC_W_CONSTR_10, 0, "almanacW"},
    {ATF_NOFLAGS, 0, offsetof(struct AlmanacElement, almanacM0),
        (ASN_TAG_CLASS_CONTEXT | (9 << 2)), -1, /* IMPLICIT tag at current level */
        &asn_DEF_NativeInteger, memb_almanacM0_constraint_1,
        &ASN_PER_MEMB_ALMANAC_M0_CONSTR_11, 0, "almanacM0"},
    {ATF_NOFLAGS, 0, offsetof(struct AlmanacElement, almanacAF0),
        (ASN_TAG_CLASS_CONTEXT | (10 << 2)),
        -1, /* IMPLICIT tag at current level */
        &asn_DEF_NativeInteger, memb_almanacAF0_constraint_1,
        &ASN_PER_MEMB_ALMANAC_A_F0_CONSTR_12, 0, "almanacAF0"},
    {ATF_NOFLAGS, 0, offsetof(struct AlmanacElement, almanacAF1),
        (ASN_TAG_CLASS_CONTEXT | (11 << 2)),
        -1, /* IMPLICIT tag at current level */
        &asn_DEF_NativeInteger, memb_almanacAF1_constraint_1,
        &ASN_PER_MEMB_ALMANAC_A_F1_CONSTR_13, 0, "almanacAF1"},
};
static ber_tlv_tag_t asn_DEF_AlmanacElement_tags_1[] = {
    (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))};
static asn_TYPE_tag2member_t asn_MAP_AlmanacElement_tag2el_1[] = {
    {(ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0}, /* satelliteID at 799 */
    {(ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0}, /* almanacE at 800 */
    {(ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0}, /* alamanacToa at 801 */
    {(ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0}, /* almanacKsii at 802 */
    {(ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0}, /* almanacOmegaDot at 803 */
    {(ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0}, /* almanacSVhealth at 804 */
    {(ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0,
        0},                                          /* almanacAPowerHalf at 805 */
    {(ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0},   /* almanacOmega0 at 806 */
    {(ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0},   /* almanacW at 807 */
    {(ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0},   /* almanacM0 at 808 */
    {(ASN_TAG_CLASS_CONTEXT | (10 << 2)), 10, 0, 0}, /* almanacAF0 at 809 */
    {(ASN_TAG_CLASS_CONTEXT | (11 << 2)), 11, 0, 0}  /* almanacAF1 at 810 */
};
static asn_SEQUENCE_specifics_t asn_SPC_AlmanacElement_specs_1 = {
    sizeof(struct AlmanacElement),
    offsetof(struct AlmanacElement, _asn_ctx),
    asn_MAP_AlmanacElement_tag2el_1,
    12, /* Count of tags in the map */
    0,
    0,
    0,  /* Optional elements (not needed) */
    -1, /* Start extensions */
    -1  /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_AlmanacElement = {
    "AlmanacElement",
    "AlmanacElement",
    SEQUENCE_free,
    SEQUENCE_print,
    SEQUENCE_constraint,
    SEQUENCE_decode_ber,
    SEQUENCE_encode_der,
    SEQUENCE_decode_xer,
    SEQUENCE_encode_xer,
    SEQUENCE_decode_uper,
    SEQUENCE_encode_uper,
    0, /* Use generic outmost tag fetcher */
    asn_DEF_AlmanacElement_tags_1,
    sizeof(asn_DEF_AlmanacElement_tags_1) /
        sizeof(asn_DEF_AlmanacElement_tags_1[0]), /* 1 */
    asn_DEF_AlmanacElement_tags_1,                /* Same as above */
    sizeof(asn_DEF_AlmanacElement_tags_1) /
        sizeof(asn_DEF_AlmanacElement_tags_1[0]), /* 1 */
    0,                                            /* No PER visible constraints */
    asn_MBR_AlmanacElement_1,
    12,                             /* Elements count */
    &asn_SPC_AlmanacElement_specs_1 /* Additional specs */
};
