Give the esm_class bits one owner beside the constants

This commit is contained in:
2026-08-27 16:18:05 +02:00
parent b9f77ec969
commit c9c3121d40
7 changed files with 21 additions and 21 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import type { ParamValue } from './defs/types.ts';
import type { Result, VoidResult } from './result.ts';
import type { Tlv } from './defs/tlvs.ts';
import { cmds, commandNameById, isCommandName } from './defs/commands.ts';
import { consts } from './defs/constants.ts';
import { consts, hasUdh } from './defs/constants.ts';
import { decodeMessage, encodeMessage } from './message.ts';
import { detect, encodingByDataCoding } from './defs/encodings.ts';
import { errorNameById, errors, isErrorName } from './defs/errors.ts';
@@ -327,7 +327,7 @@ function parseOnce(pdu: Buffer, trailingNull: boolean): Result<{ aligned: boolea
const esmClass = paramNumber(params.esm_class, 0);
// A message carrying a UDH stays a buffer; the session needs the header intact to reassemble.
if (Buffer.isBuffer(message) && (esmClass & consts.ESM_CLASS.UDH_INDICATOR) !== consts.ESM_CLASS.UDH_INDICATOR) {
if (Buffer.isBuffer(message) && !hasUdh(esmClass)) {
params.short_message = decodeMessage(message, paramNumber(params.data_coding, 0)).message;
}