@wildboar/copp
Version:
Connection-oriented presentation protocol (COPP) data structures and business logic in TypeScript
66 lines • 4.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports._encode_CPR_PPDU = exports._decode_CPR_PPDU = exports._encode_CPR_PPDU_normal_mode_parameters = exports._decode_CPR_PPDU_normal_mode_parameters = exports.CPR_PPDU_normal_mode_parameters = exports._encode_CPR_PPDU_x400_mode_parameters = exports._decode_CPR_PPDU_x400_mode_parameters = exports.CPR_PPDU_x400_mode_parameters = void 0;
const $ = require("asn1-ts/dist/node/functional");
const CPR_PPDU_x400_mode_parameters_ta_1 = require("../ISO8823-PRESENTATION/CPR-PPDU-x400-mode-parameters.ta");
var CPR_PPDU_x400_mode_parameters_ta_2 = require("../ISO8823-PRESENTATION/CPR-PPDU-x400-mode-parameters.ta");
Object.defineProperty(exports, "CPR_PPDU_x400_mode_parameters", { enumerable: true, get: function () { return CPR_PPDU_x400_mode_parameters_ta_2.CPR_PPDU_x400_mode_parameters; } });
Object.defineProperty(exports, "_decode_CPR_PPDU_x400_mode_parameters", { enumerable: true, get: function () { return CPR_PPDU_x400_mode_parameters_ta_2._decode_CPR_PPDU_x400_mode_parameters; } });
Object.defineProperty(exports, "_encode_CPR_PPDU_x400_mode_parameters", { enumerable: true, get: function () { return CPR_PPDU_x400_mode_parameters_ta_2._encode_CPR_PPDU_x400_mode_parameters; } });
const CPR_PPDU_normal_mode_parameters_ta_1 = require("../ISO8823-PRESENTATION/CPR-PPDU-normal-mode-parameters.ta");
var CPR_PPDU_normal_mode_parameters_ta_2 = require("../ISO8823-PRESENTATION/CPR-PPDU-normal-mode-parameters.ta");
Object.defineProperty(exports, "CPR_PPDU_normal_mode_parameters", { enumerable: true, get: function () { return CPR_PPDU_normal_mode_parameters_ta_2.CPR_PPDU_normal_mode_parameters; } });
Object.defineProperty(exports, "_decode_CPR_PPDU_normal_mode_parameters", { enumerable: true, get: function () { return CPR_PPDU_normal_mode_parameters_ta_2._decode_CPR_PPDU_normal_mode_parameters; } });
Object.defineProperty(exports, "_encode_CPR_PPDU_normal_mode_parameters", { enumerable: true, get: function () { return CPR_PPDU_normal_mode_parameters_ta_2._encode_CPR_PPDU_normal_mode_parameters; } });
/* END_OF_SYMBOL_DEFINITION CPR_PPDU */
/* START_OF_SYMBOL_DEFINITION _cached_decoder_for_CPR_PPDU */
let _cached_decoder_for_CPR_PPDU = null;
/* END_OF_SYMBOL_DEFINITION _cached_decoder_for_CPR_PPDU */
/* START_OF_SYMBOL_DEFINITION _decode_CPR_PPDU */
/**
* @summary Decodes an ASN.1 element into a(n) CPR_PPDU
* @function
* @param {_Element} el The element being decoded.
* @returns {CPR_PPDU} The decoded data structure.
*/
function _decode_CPR_PPDU(el) {
if (!_cached_decoder_for_CPR_PPDU) {
_cached_decoder_for_CPR_PPDU = $._decode_inextensible_choice({
'UNIVERSAL 17': [
'x400_mode_parameters',
CPR_PPDU_x400_mode_parameters_ta_1._decode_CPR_PPDU_x400_mode_parameters,
],
'UNIVERSAL 16': [
'normal_mode_parameters',
CPR_PPDU_normal_mode_parameters_ta_1._decode_CPR_PPDU_normal_mode_parameters,
],
});
}
return _cached_decoder_for_CPR_PPDU(el);
}
exports._decode_CPR_PPDU = _decode_CPR_PPDU;
/* END_OF_SYMBOL_DEFINITION _decode_CPR_PPDU */
/* START_OF_SYMBOL_DEFINITION _cached_encoder_for_CPR_PPDU */
let _cached_encoder_for_CPR_PPDU = null;
/* END_OF_SYMBOL_DEFINITION _cached_encoder_for_CPR_PPDU */
/* START_OF_SYMBOL_DEFINITION _encode_CPR_PPDU */
/**
* @summary Encodes a(n) CPR_PPDU 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, encoded as an ASN.1 Element.
*/
function _encode_CPR_PPDU(value, elGetter) {
if (!_cached_encoder_for_CPR_PPDU) {
_cached_encoder_for_CPR_PPDU = $._encode_choice({
x400_mode_parameters: CPR_PPDU_x400_mode_parameters_ta_1._encode_CPR_PPDU_x400_mode_parameters,
normal_mode_parameters: CPR_PPDU_normal_mode_parameters_ta_1._encode_CPR_PPDU_normal_mode_parameters,
}, $.BER);
}
return _cached_encoder_for_CPR_PPDU(value, elGetter);
}
exports._encode_CPR_PPDU = _encode_CPR_PPDU;
/* END_OF_SYMBOL_DEFINITION _encode_CPR_PPDU */
/* eslint-enable */
//# sourceMappingURL=CPR-PPDU.ta.js.map