@wildboar/acse
Version:
Association Control Service Element PDUs in TypeScript
46 lines (45 loc) • 2.04 kB
JavaScript
/* eslint-disable */
import { ASN1TagClass as _TagClass, } from '@wildboar/asn1';
import * as $ from '@wildboar/asn1/functional';
import { _decode_Context_list, _encode_Context_list, } from '../ACSE-1/Context-list.ta.mjs';
import { _decode_Default_Context_List, _encode_Default_Context_List, } from '../ACSE-1/Default-Context-List.ta.mjs';
let _cached_decoder_for_Syntactic_context_list = null;
/**
* @summary Decodes an ASN.1 element into a(n) Syntactic_context_list
* @function
* @param {_Element} el The element being decoded.
* @returns {Syntactic_context_list} The decoded data structure.
*/
export function _decode_Syntactic_context_list(el) {
if (!_cached_decoder_for_Syntactic_context_list) {
_cached_decoder_for_Syntactic_context_list = $._decode_inextensible_choice({
'CONTEXT 0': [
'context_list',
$._decode_implicit(() => _decode_Context_list),
],
'CONTEXT 1': [
'default_contact_list',
$._decode_implicit(() => _decode_Default_Context_List),
],
});
}
return _cached_decoder_for_Syntactic_context_list(el);
}
let _cached_encoder_for_Syntactic_context_list = null;
/**
* @summary Encodes a(n) Syntactic_context_list into an ASN.1 Element.
* @function
* @param value The element being encoded.
* @param elGetter A function that can be used to get new ASN.1 elements.
* @returns {_Element} The Syntactic_context_list, encoded as an ASN.1 Element.
*/
export function _encode_Syntactic_context_list(value, elGetter) {
if (!_cached_encoder_for_Syntactic_context_list) {
_cached_encoder_for_Syntactic_context_list = $._encode_choice({
context_list: $._encode_implicit(_TagClass.context, 0, () => _encode_Context_list, $.BER),
default_contact_list: $._encode_implicit(_TagClass.context, 1, () => _encode_Default_Context_List, $.BER),
}, $.BER);
}
return _cached_encoder_for_Syntactic_context_list(value, elGetter);
}
/* eslint-enable */