/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "E2SM-RC-IEs"
 * 	found in "e2sm-rc-nov2021.asn"
 * 	`asn1c -fcompound-names -fno-include-deps -findirect-choice -pdu=auto -gen-PER -gen-OER -no-gen-example -D .`
 */

#include "EventTrigger-Cell-Info-Item-Choice-Individual.h"

asn_TYPE_member_t asn_MBR_EventTrigger_Cell_Info_Item_Choice_Individual_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct EventTrigger_Cell_Info_Item_Choice_Individual, cellGlobalID),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		+1,	/* EXPLICIT tag at current level */
		&asn_DEF_CGI,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"cellGlobalID"
		},
};
static const ber_tlv_tag_t asn_DEF_EventTrigger_Cell_Info_Item_Choice_Individual_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_EventTrigger_Cell_Info_Item_Choice_Individual_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* cellGlobalID */
};
asn_SEQUENCE_specifics_t asn_SPC_EventTrigger_Cell_Info_Item_Choice_Individual_specs_1 = {
	sizeof(struct EventTrigger_Cell_Info_Item_Choice_Individual),
	offsetof(struct EventTrigger_Cell_Info_Item_Choice_Individual, _asn_ctx),
	asn_MAP_EventTrigger_Cell_Info_Item_Choice_Individual_tag2el_1,
	1,	/* Count of tags in the map */
	0, 0, 0,	/* Optional elements (not needed) */
	1,	/* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_EventTrigger_Cell_Info_Item_Choice_Individual = {
	"EventTrigger-Cell-Info-Item-Choice-Individual",
	"EventTrigger-Cell-Info-Item-Choice-Individual",
	&asn_OP_SEQUENCE,
	asn_DEF_EventTrigger_Cell_Info_Item_Choice_Individual_tags_1,
	sizeof(asn_DEF_EventTrigger_Cell_Info_Item_Choice_Individual_tags_1)
		/sizeof(asn_DEF_EventTrigger_Cell_Info_Item_Choice_Individual_tags_1[0]), /* 1 */
	asn_DEF_EventTrigger_Cell_Info_Item_Choice_Individual_tags_1,	/* Same as above */
	sizeof(asn_DEF_EventTrigger_Cell_Info_Item_Choice_Individual_tags_1)
		/sizeof(asn_DEF_EventTrigger_Cell_Info_Item_Choice_Individual_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_EventTrigger_Cell_Info_Item_Choice_Individual_1,
	1,	/* Elements count */
	&asn_SPC_EventTrigger_Cell_Info_Item_Choice_Individual_specs_1	/* Additional specs */
};

