@wildboar/copp
Version:
Connection-oriented presentation protocol (COPP) data structures and business logic in TypeScript
75 lines • 4.44 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports._encode_Typed_data_type = exports._decode_Typed_data_type = exports._encode_User_data = exports._decode_User_data = exports._encode_ACA_PPDU = exports._decode_ACA_PPDU = exports.ACA_PPDU = exports._encode_AC_PPDU = exports._decode_AC_PPDU = exports.AC_PPDU = void 0;
/* eslint-disable */
const asn1_ts_1 = require("asn1-ts");
const $ = require("asn1-ts/dist/node/functional");
const AC_PPDU_ta_1 = require("../ISO8823-PRESENTATION/AC-PPDU.ta");
var AC_PPDU_ta_2 = require("../ISO8823-PRESENTATION/AC-PPDU.ta");
Object.defineProperty(exports, "AC_PPDU", { enumerable: true, get: function () { return AC_PPDU_ta_2.AC_PPDU; } });
Object.defineProperty(exports, "_decode_AC_PPDU", { enumerable: true, get: function () { return AC_PPDU_ta_2._decode_AC_PPDU; } });
Object.defineProperty(exports, "_encode_AC_PPDU", { enumerable: true, get: function () { return AC_PPDU_ta_2._encode_AC_PPDU; } });
const ACA_PPDU_ta_1 = require("../ISO8823-PRESENTATION/ACA-PPDU.ta");
var ACA_PPDU_ta_2 = require("../ISO8823-PRESENTATION/ACA-PPDU.ta");
Object.defineProperty(exports, "ACA_PPDU", { enumerable: true, get: function () { return ACA_PPDU_ta_2.ACA_PPDU; } });
Object.defineProperty(exports, "_decode_ACA_PPDU", { enumerable: true, get: function () { return ACA_PPDU_ta_2._decode_ACA_PPDU; } });
Object.defineProperty(exports, "_encode_ACA_PPDU", { enumerable: true, get: function () { return ACA_PPDU_ta_2._encode_ACA_PPDU; } });
const User_data_ta_1 = require("../ISO8823-PRESENTATION/User-data.ta");
var User_data_ta_2 = require("../ISO8823-PRESENTATION/User-data.ta");
Object.defineProperty(exports, "_decode_User_data", { enumerable: true, get: function () { return User_data_ta_2._decode_User_data; } });
Object.defineProperty(exports, "_encode_User_data", { enumerable: true, get: function () { return User_data_ta_2._encode_User_data; } });
/* END_OF_SYMBOL_DEFINITION Typed_data_type */
/* START_OF_SYMBOL_DEFINITION _cached_decoder_for_Typed_data_type */
let _cached_decoder_for_Typed_data_type = null;
/* END_OF_SYMBOL_DEFINITION _cached_decoder_for_Typed_data_type */
/* START_OF_SYMBOL_DEFINITION _decode_Typed_data_type */
/**
* @summary Decodes an ASN.1 element into a(n) Typed_data_type
* @function
* @param {_Element} el The element being decoded.
* @returns {Typed_data_type} The decoded data structure.
*/
function _decode_Typed_data_type(el) {
if (!_cached_decoder_for_Typed_data_type) {
_cached_decoder_for_Typed_data_type = $._decode_inextensible_choice({
'CONTEXT 0': [
'acPPDU',
$._decode_implicit(() => AC_PPDU_ta_1._decode_AC_PPDU),
],
'CONTEXT 1': [
'acaPPDU',
$._decode_implicit(() => ACA_PPDU_ta_1._decode_ACA_PPDU),
],
'APPLICATION 0': ['ttdPPDU', User_data_ta_1._decode_User_data],
'APPLICATION 1': ['ttdPPDU', User_data_ta_1._decode_User_data],
});
}
return _cached_decoder_for_Typed_data_type(el);
}
exports._decode_Typed_data_type = _decode_Typed_data_type;
/* END_OF_SYMBOL_DEFINITION _decode_Typed_data_type */
/* START_OF_SYMBOL_DEFINITION _cached_encoder_for_Typed_data_type */
let _cached_encoder_for_Typed_data_type = null;
/* END_OF_SYMBOL_DEFINITION _cached_encoder_for_Typed_data_type */
/* START_OF_SYMBOL_DEFINITION _encode_Typed_data_type */
/**
* @summary Encodes a(n) Typed_data_type 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 Typed_data_type, encoded as an ASN.1 Element.
*/
function _encode_Typed_data_type(value, elGetter) {
if (!_cached_encoder_for_Typed_data_type) {
_cached_encoder_for_Typed_data_type = $._encode_choice({
acPPDU: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 0, () => AC_PPDU_ta_1._encode_AC_PPDU, $.BER),
acaPPDU: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 1, () => ACA_PPDU_ta_1._encode_ACA_PPDU, $.BER),
ttdPPDU: User_data_ta_1._encode_User_data,
}, $.BER);
}
return _cached_encoder_for_Typed_data_type(value, elGetter);
}
exports._encode_Typed_data_type = _encode_Typed_data_type;
/* END_OF_SYMBOL_DEFINITION _encode_Typed_data_type */
/* eslint-enable */
//# sourceMappingURL=Typed-data-type.ta.js.map