UNPKG

@wildboar/copp

Version:

Connection-oriented presentation protocol (COPP) data structures and business logic in TypeScript

173 lines 10.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._encode_CPR_PPDU_x400_mode_parameters = exports._decode_CPR_PPDU_x400_mode_parameters = exports._extension_additions_list_spec_for_CPR_PPDU_x400_mode_parameters = exports._root_component_type_list_2_spec_for_CPR_PPDU_x400_mode_parameters = exports._root_component_type_list_1_spec_for_CPR_PPDU_x400_mode_parameters = exports.CPR_PPDU_x400_mode_parameters = exports._encode_RefuseReason = exports._decode_RefuseReason = exports.unacceptableDialogueMode = exports.RefuseReason_unacceptableDialogueMode = exports.validationFailure = exports.RefuseReason_validationFailure = exports.cannotRecover = exports.RefuseReason_cannotRecover = exports.rtsBusy = exports.RefuseReason_rtsBusy = exports._encode_RTORJapdu = exports._decode_RTORJapdu = exports.RTORJapdu = void 0; /* eslint-disable */ const asn1_ts_1 = require("asn1-ts"); const $ = require("asn1-ts/dist/node/functional"); var RTORJapdu_ta_1 = require("@wildboar/rtse/src/lib/modules/Reliable-Transfer-APDU/RTORJapdu.ta"); Object.defineProperty(exports, "RTORJapdu", { enumerable: true, get: function () { return RTORJapdu_ta_1.RTORJapdu; } }); Object.defineProperty(exports, "_decode_RTORJapdu", { enumerable: true, get: function () { return RTORJapdu_ta_1._decode_RTORJapdu; } }); Object.defineProperty(exports, "_encode_RTORJapdu", { enumerable: true, get: function () { return RTORJapdu_ta_1._encode_RTORJapdu; } }); const RefuseReason_ta_1 = require("@wildboar/rtse/src/lib/modules/Reliable-Transfer-APDU/RefuseReason.ta"); var RefuseReason_ta_2 = require("@wildboar/rtse/src/lib/modules/Reliable-Transfer-APDU/RefuseReason.ta"); Object.defineProperty(exports, "RefuseReason_rtsBusy", { enumerable: true, get: function () { return RefuseReason_ta_2.RefuseReason_rtsBusy; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "rtsBusy", { enumerable: true, get: function () { return RefuseReason_ta_2.rtsBusy; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "RefuseReason_cannotRecover", { enumerable: true, get: function () { return RefuseReason_ta_2.RefuseReason_cannotRecover; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "cannotRecover", { enumerable: true, get: function () { return RefuseReason_ta_2.cannotRecover; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "RefuseReason_validationFailure", { enumerable: true, get: function () { return RefuseReason_ta_2.RefuseReason_validationFailure; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "validationFailure", { enumerable: true, get: function () { return RefuseReason_ta_2.validationFailure; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "RefuseReason_unacceptableDialogueMode", { enumerable: true, get: function () { return RefuseReason_ta_2.RefuseReason_unacceptableDialogueMode; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "unacceptableDialogueMode", { enumerable: true, get: function () { return RefuseReason_ta_2.unacceptableDialogueMode; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "_decode_RefuseReason", { enumerable: true, get: function () { return RefuseReason_ta_2._decode_RefuseReason; } }); Object.defineProperty(exports, "_encode_RefuseReason", { enumerable: true, get: function () { return RefuseReason_ta_2._encode_RefuseReason; } }); /* START_OF_SYMBOL_DEFINITION CPR_PPDU_x400_mode_parameters */ /** * @summary CPR_PPDU_x400_mode_parameters * @description * * ### ASN.1 Definition: * * ```asn1 * CPR-PPDU-x400-mode-parameters ::= SEQUENCE { -- REMOVED_FROM_UNNESTING -- } * ``` * * @class */ class CPR_PPDU_x400_mode_parameters { constructor( /** * @summary `refuseReason`. * @public * @readonly */ refuseReason /* REPLICATED_COMPONENT */, /** * @summary `userDataRJ`. * @public * @readonly */ userDataRJ /* REPLICATED_COMPONENT */) { this.refuseReason = refuseReason; this.userDataRJ = userDataRJ; } /** * @summary Restructures an object into a CPR_PPDU_x400_mode_parameters * @description * * This takes an `object` and converts it to a `CPR_PPDU_x400_mode_parameters`. * * @public * @static * @method * @param {Object} _o An object having all of the keys and values of a `CPR_PPDU_x400_mode_parameters`. * @returns {CPR_PPDU_x400_mode_parameters} */ static _from_object(_o) { return new CPR_PPDU_x400_mode_parameters(_o.refuseReason, _o.userDataRJ); } } exports.CPR_PPDU_x400_mode_parameters = CPR_PPDU_x400_mode_parameters; /* END_OF_SYMBOL_DEFINITION CPR_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _root_component_type_list_1_spec_for_CPR_PPDU_x400_mode_parameters */ /** * @summary The Leading Root Component Types of CPR_PPDU_x400_mode_parameters * @description * * This is an array of `ComponentSpec`s that define how to decode the leading root component type list of a SET or SEQUENCE. * * @constant */ exports._root_component_type_list_1_spec_for_CPR_PPDU_x400_mode_parameters = [ new $.ComponentSpec('refuseReason', true, $.hasTag(asn1_ts_1.ASN1TagClass.context, 0), undefined, undefined), new $.ComponentSpec('userDataRJ', true, $.hasTag(asn1_ts_1.ASN1TagClass.context, 1), undefined, undefined), ]; /* END_OF_SYMBOL_DEFINITION _root_component_type_list_1_spec_for_CPR_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _root_component_type_list_2_spec_for_CPR_PPDU_x400_mode_parameters */ /** * @summary The Trailing Root Component Types of CPR_PPDU_x400_mode_parameters * @description * * This is an array of `ComponentSpec`s that define how to decode the trailing root component type list of a SET or SEQUENCE. * * @constant */ exports._root_component_type_list_2_spec_for_CPR_PPDU_x400_mode_parameters = []; /* END_OF_SYMBOL_DEFINITION _root_component_type_list_2_spec_for_CPR_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _extension_additions_list_spec_for_CPR_PPDU_x400_mode_parameters */ /** * @summary The Extension Addition Component Types of CPR_PPDU_x400_mode_parameters * @description * * This is an array of `ComponentSpec`s that define how to decode the extension addition component type list of a SET or SEQUENCE. * * @constant */ exports._extension_additions_list_spec_for_CPR_PPDU_x400_mode_parameters = []; /* END_OF_SYMBOL_DEFINITION _extension_additions_list_spec_for_CPR_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _cached_decoder_for_CPR_PPDU_x400_mode_parameters */ let _cached_decoder_for_CPR_PPDU_x400_mode_parameters = null; /* END_OF_SYMBOL_DEFINITION _cached_decoder_for_CPR_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _decode_CPR_PPDU_x400_mode_parameters */ /** * @summary Decodes an ASN.1 element into a(n) CPR_PPDU_x400_mode_parameters * @function * @param {_Element} el The element being decoded. * @returns {CPR_PPDU_x400_mode_parameters} The decoded data structure. */ function _decode_CPR_PPDU_x400_mode_parameters(el) { if (!_cached_decoder_for_CPR_PPDU_x400_mode_parameters) { _cached_decoder_for_CPR_PPDU_x400_mode_parameters = function (el) { /* START_OF_SET_COMPONENT_DECLARATIONS */ let refuseReason; let userDataRJ; /* END_OF_SET_COMPONENT_DECLARATIONS */ /* START_OF_CALLBACKS_MAP */ const callbacks = { refuseReason: (_el) => { refuseReason = $._decode_implicit(() => RefuseReason_ta_1._decode_RefuseReason)(_el); }, userDataRJ: (_el) => { userDataRJ = $._decode_explicit(() => $._decodeAny)(_el); }, }; /* END_OF_CALLBACKS_MAP */ $._parse_set(el, callbacks, exports._root_component_type_list_1_spec_for_CPR_PPDU_x400_mode_parameters, exports._extension_additions_list_spec_for_CPR_PPDU_x400_mode_parameters, exports._root_component_type_list_2_spec_for_CPR_PPDU_x400_mode_parameters, undefined); return new CPR_PPDU_x400_mode_parameters /* SET_CONSTRUCTOR_CALL */(refuseReason, userDataRJ); }; } return _cached_decoder_for_CPR_PPDU_x400_mode_parameters(el); } exports._decode_CPR_PPDU_x400_mode_parameters = _decode_CPR_PPDU_x400_mode_parameters; /* END_OF_SYMBOL_DEFINITION _decode_CPR_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _cached_encoder_for_CPR_PPDU_x400_mode_parameters */ let _cached_encoder_for_CPR_PPDU_x400_mode_parameters = null; /* END_OF_SYMBOL_DEFINITION _cached_encoder_for_CPR_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _encode_CPR_PPDU_x400_mode_parameters */ /** * @summary Encodes a(n) CPR_PPDU_x400_mode_parameters into an ASN.1 Element. * @function * @param {value} el The element being decoded. * @param elGetter A function that can be used to get new ASN.1 elements. * @returns {_Element} The CPR_PPDU_x400_mode_parameters, encoded as an ASN.1 Element. */ function _encode_CPR_PPDU_x400_mode_parameters(value, elGetter) { if (!_cached_encoder_for_CPR_PPDU_x400_mode_parameters) { _cached_encoder_for_CPR_PPDU_x400_mode_parameters = function (value, elGetter) { return $._encodeSet([] .concat([ /* IF_ABSENT */ value.refuseReason === undefined ? undefined : $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 0, () => RefuseReason_ta_1._encode_RefuseReason, $.BER)(value.refuseReason, $.BER), /* IF_ABSENT */ value.userDataRJ === undefined ? undefined : $._encode_explicit(asn1_ts_1.ASN1TagClass.context, 1, () => $._encodeAny, $.BER)(value.userDataRJ, $.BER), ]) .filter((c) => !!c), $.BER); }; } return _cached_encoder_for_CPR_PPDU_x400_mode_parameters(value, elGetter); } exports._encode_CPR_PPDU_x400_mode_parameters = _encode_CPR_PPDU_x400_mode_parameters; /* END_OF_SYMBOL_DEFINITION _encode_CPR_PPDU_x400_mode_parameters */ /* eslint-enable */ //# sourceMappingURL=CPR-PPDU-x400-mode-parameters.ta.js.map