@wildboar/copp
Version:
Connection-oriented presentation protocol (COPP) data structures and business logic in TypeScript
198 lines • 10 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports._encode_CPA_PPDU_x410_mode_parameters = exports._decode_CPA_PPDU_x410_mode_parameters = exports._extension_additions_list_spec_for_CPA_PPDU_x410_mode_parameters = exports._root_component_type_list_2_spec_for_CPA_PPDU_x410_mode_parameters = exports._root_component_type_list_1_spec_for_CPA_PPDU_x410_mode_parameters = exports.CPA_PPDU_x410_mode_parameters = exports._encode_ConnectionData = exports._decode_ConnectionData = exports._encode_RTOACapdu = exports._decode_RTOACapdu = exports.RTOACapdu = void 0;
/* eslint-disable */
const asn1_ts_1 = require("asn1-ts");
const $ = require("asn1-ts/dist/node/functional");
var RTOACapdu_ta_1 = require("@wildboar/rtse/src/lib/modules/Reliable-Transfer-APDU/RTOACapdu.ta");
Object.defineProperty(exports, "RTOACapdu", { enumerable: true, get: function () { return RTOACapdu_ta_1.RTOACapdu; } });
Object.defineProperty(exports, "_decode_RTOACapdu", { enumerable: true, get: function () { return RTOACapdu_ta_1._decode_RTOACapdu; } });
Object.defineProperty(exports, "_encode_RTOACapdu", { enumerable: true, get: function () { return RTOACapdu_ta_1._encode_RTOACapdu; } });
const ConnectionData_ta_1 = require("@wildboar/rtse/src/lib/modules/Reliable-Transfer-APDU/ConnectionData.ta");
var ConnectionData_ta_2 = require("@wildboar/rtse/src/lib/modules/Reliable-Transfer-APDU/ConnectionData.ta");
Object.defineProperty(exports, "_decode_ConnectionData", { enumerable: true, get: function () { return ConnectionData_ta_2._decode_ConnectionData; } });
Object.defineProperty(exports, "_encode_ConnectionData", { enumerable: true, get: function () { return ConnectionData_ta_2._encode_ConnectionData; } });
/* START_OF_SYMBOL_DEFINITION CPA_PPDU_x410_mode_parameters */
/**
* @summary CPA_PPDU_x410_mode_parameters
* @description
*
* ### ASN.1 Definition:
*
* ```asn1
* CPA-PPDU-x410-mode-parameters ::= SEQUENCE { -- REMOVED_FROM_UNNESTING -- }
* ```
*
* @class
*/
class CPA_PPDU_x410_mode_parameters {
constructor(
/**
* @summary `checkpointSize`.
* @public
* @readonly
*/
checkpointSize /* REPLICATED_COMPONENT */,
/**
* @summary `windowSize`.
* @public
* @readonly
*/
windowSize /* REPLICATED_COMPONENT */,
/**
* @summary `connectionDataAC`.
* @public
* @readonly
*/
connectionDataAC /* REPLICATED_COMPONENT */) {
this.checkpointSize = checkpointSize;
this.windowSize = windowSize;
this.connectionDataAC = connectionDataAC;
}
/**
* @summary Restructures an object into a CPA_PPDU_x410_mode_parameters
* @description
*
* This takes an `object` and converts it to a `CPA_PPDU_x410_mode_parameters`.
*
* @public
* @static
* @method
* @param {Object} _o An object having all of the keys and values of a `CPA_PPDU_x410_mode_parameters`.
* @returns {CPA_PPDU_x410_mode_parameters}
*/
static _from_object(_o) {
return new CPA_PPDU_x410_mode_parameters(_o.checkpointSize, _o.windowSize, _o.connectionDataAC);
}
/**
* @summary Getter that returns the default value for `checkpointSize`.
* @public
* @static
* @method
*/
static get _default_value_for_checkpointSize() {
return 0;
}
/**
* @summary Getter that returns the default value for `windowSize`.
* @public
* @static
* @method
*/
static get _default_value_for_windowSize() {
return 3;
}
}
exports.CPA_PPDU_x410_mode_parameters = CPA_PPDU_x410_mode_parameters;
/* END_OF_SYMBOL_DEFINITION CPA_PPDU_x410_mode_parameters */
/* START_OF_SYMBOL_DEFINITION _root_component_type_list_1_spec_for_CPA_PPDU_x410_mode_parameters */
/**
* @summary The Leading Root Component Types of CPA_PPDU_x410_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_CPA_PPDU_x410_mode_parameters = [
new $.ComponentSpec('checkpointSize', true, $.hasTag(asn1_ts_1.ASN1TagClass.context, 0), undefined, undefined),
new $.ComponentSpec('windowSize', true, $.hasTag(asn1_ts_1.ASN1TagClass.context, 1), undefined, undefined),
new $.ComponentSpec('connectionDataAC', false, $.hasTag(asn1_ts_1.ASN1TagClass.context, 2), undefined, undefined),
];
/* END_OF_SYMBOL_DEFINITION _root_component_type_list_1_spec_for_CPA_PPDU_x410_mode_parameters */
/* START_OF_SYMBOL_DEFINITION _root_component_type_list_2_spec_for_CPA_PPDU_x410_mode_parameters */
/**
* @summary The Trailing Root Component Types of CPA_PPDU_x410_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_CPA_PPDU_x410_mode_parameters = [];
/* END_OF_SYMBOL_DEFINITION _root_component_type_list_2_spec_for_CPA_PPDU_x410_mode_parameters */
/* START_OF_SYMBOL_DEFINITION _extension_additions_list_spec_for_CPA_PPDU_x410_mode_parameters */
/**
* @summary The Extension Addition Component Types of CPA_PPDU_x410_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_CPA_PPDU_x410_mode_parameters = [];
/* END_OF_SYMBOL_DEFINITION _extension_additions_list_spec_for_CPA_PPDU_x410_mode_parameters */
/* START_OF_SYMBOL_DEFINITION _cached_decoder_for_CPA_PPDU_x410_mode_parameters */
let _cached_decoder_for_CPA_PPDU_x410_mode_parameters = null;
/* END_OF_SYMBOL_DEFINITION _cached_decoder_for_CPA_PPDU_x410_mode_parameters */
/* START_OF_SYMBOL_DEFINITION _decode_CPA_PPDU_x410_mode_parameters */
/**
* @summary Decodes an ASN.1 element into a(n) CPA_PPDU_x410_mode_parameters
* @function
* @param {_Element} el The element being decoded.
* @returns {CPA_PPDU_x410_mode_parameters} The decoded data structure.
*/
function _decode_CPA_PPDU_x410_mode_parameters(el) {
if (!_cached_decoder_for_CPA_PPDU_x410_mode_parameters) {
_cached_decoder_for_CPA_PPDU_x410_mode_parameters = function (el) {
/* START_OF_SET_COMPONENT_DECLARATIONS */
let checkpointSize = CPA_PPDU_x410_mode_parameters._default_value_for_checkpointSize;
let windowSize = CPA_PPDU_x410_mode_parameters._default_value_for_windowSize;
let connectionDataAC;
/* END_OF_SET_COMPONENT_DECLARATIONS */
/* START_OF_CALLBACKS_MAP */
const callbacks = {
checkpointSize: (_el) => {
checkpointSize = $._decode_implicit(() => $._decodeInteger)(_el);
},
windowSize: (_el) => {
windowSize = $._decode_implicit(() => $._decodeInteger)(_el);
},
connectionDataAC: (_el) => {
connectionDataAC = $._decode_explicit(() => ConnectionData_ta_1._decode_ConnectionData)(_el);
},
};
/* END_OF_CALLBACKS_MAP */
$._parse_set(el, callbacks, exports._root_component_type_list_1_spec_for_CPA_PPDU_x410_mode_parameters, exports._extension_additions_list_spec_for_CPA_PPDU_x410_mode_parameters, exports._root_component_type_list_2_spec_for_CPA_PPDU_x410_mode_parameters, undefined);
return new CPA_PPDU_x410_mode_parameters /* SET_CONSTRUCTOR_CALL */(checkpointSize, windowSize, connectionDataAC);
};
}
return _cached_decoder_for_CPA_PPDU_x410_mode_parameters(el);
}
exports._decode_CPA_PPDU_x410_mode_parameters = _decode_CPA_PPDU_x410_mode_parameters;
/* END_OF_SYMBOL_DEFINITION _decode_CPA_PPDU_x410_mode_parameters */
/* START_OF_SYMBOL_DEFINITION _cached_encoder_for_CPA_PPDU_x410_mode_parameters */
let _cached_encoder_for_CPA_PPDU_x410_mode_parameters = null;
/* END_OF_SYMBOL_DEFINITION _cached_encoder_for_CPA_PPDU_x410_mode_parameters */
/* START_OF_SYMBOL_DEFINITION _encode_CPA_PPDU_x410_mode_parameters */
/**
* @summary Encodes a(n) CPA_PPDU_x410_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 CPA_PPDU_x410_mode_parameters, encoded as an ASN.1 Element.
*/
function _encode_CPA_PPDU_x410_mode_parameters(value, elGetter) {
if (!_cached_encoder_for_CPA_PPDU_x410_mode_parameters) {
_cached_encoder_for_CPA_PPDU_x410_mode_parameters = function (value, elGetter) {
return $._encodeSet([]
.concat([
/* IF_DEFAULT */ value.checkpointSize === undefined ||
$.deepEq(value.checkpointSize, CPA_PPDU_x410_mode_parameters._default_value_for_checkpointSize)
? undefined
: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 0, () => $._encodeInteger, $.BER)(value.checkpointSize, $.BER),
/* IF_DEFAULT */ value.windowSize === undefined ||
$.deepEq(value.windowSize, CPA_PPDU_x410_mode_parameters._default_value_for_windowSize)
? undefined
: $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 1, () => $._encodeInteger, $.BER)(value.windowSize, $.BER),
/* REQUIRED */ $._encode_explicit(asn1_ts_1.ASN1TagClass.context, 2, () => ConnectionData_ta_1._encode_ConnectionData, $.BER)(value.connectionDataAC, $.BER),
])
.filter((c) => !!c), $.BER);
};
}
return _cached_encoder_for_CPA_PPDU_x410_mode_parameters(value, elGetter);
}
exports._encode_CPA_PPDU_x410_mode_parameters = _encode_CPA_PPDU_x410_mode_parameters;
/* END_OF_SYMBOL_DEFINITION _encode_CPA_PPDU_x410_mode_parameters */
/* eslint-enable */
//# sourceMappingURL=CPA-PPDU-x410-mode-parameters.ta.js.map