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

#include "PM-Info-Item.h"

asn_TYPE_member_t asn_MBR_PM_Info_Item_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct PM_Info_Item, pmType),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		+1,	/* EXPLICIT tag at current level */
		&asn_DEF_MeasurementType,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"pmType"
		},
	{ ATF_NOFLAGS, 0, offsetof(struct PM_Info_Item, pmVal),
		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
		+1,	/* EXPLICIT tag at current level */
		&asn_DEF_MeasurementValue,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"pmVal"
		},
};
static const ber_tlv_tag_t asn_DEF_PM_Info_Item_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_PM_Info_Item_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pmType */
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* pmVal */
};
asn_SEQUENCE_specifics_t asn_SPC_PM_Info_Item_specs_1 = {
	sizeof(struct PM_Info_Item),
	offsetof(struct PM_Info_Item, _asn_ctx),
	asn_MAP_PM_Info_Item_tag2el_1,
	2,	/* Count of tags in the map */
	0, 0, 0,	/* Optional elements (not needed) */
	2,	/* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_PM_Info_Item = {
	"PM-Info-Item",
	"PM-Info-Item",
	&asn_OP_SEQUENCE,
	asn_DEF_PM_Info_Item_tags_1,
	sizeof(asn_DEF_PM_Info_Item_tags_1)
		/sizeof(asn_DEF_PM_Info_Item_tags_1[0]), /* 1 */
	asn_DEF_PM_Info_Item_tags_1,	/* Same as above */
	sizeof(asn_DEF_PM_Info_Item_tags_1)
		/sizeof(asn_DEF_PM_Info_Item_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_PM_Info_Item_1,
	2,	/* Elements count */
	&asn_SPC_PM_Info_Item_specs_1	/* Additional specs */
};

