You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After running som tests on "real world" messages I've got two questions:
Message size (=length) is not part of the ISO standard but anyway sometimes found as a header before the message. The format of this header could differ, for example: not present, two bytes hex or four bytes ascii decimal. As far as I can see this implementation is using two bytes for message length:
let len1 = parseInt(buffer.slice(0,1).toString('hex'), 16); let len2 = parseInt(buffer.slice(1,2).toString('hex'), 16); let actualLen = (256*len1)+len2; buffer = buffer.slice(2,buffer.byteLength);
Would be a nice feature if the message length header was optional or configurable.
The ISO standard specifies bitmap size to 8, 16 or 24 bytes. First bit of bitmap is used to indicate if next bitmap is present. It seems like this implementation has hardcoded bitmap size to 16 bytes:
let bitmap = getHex(incoming.slice(4, 20).toString('hex')).split('').map(Number);
The bitmap may be represented as 8 bytes of binary data, or as sixteen hexadecimal characters (0-9, A-F) in the ASCII or EBCDIC character sets. A message will contain at least one bitmap, called the primary bitmap, which indicates which of data elements 1 to 64 are present. The presence of an optional secondary bitmap is also indicated by bit 1 of the primary bitmap. If present, the secondary bitmap indicates whether data elements 65 to 128 are present. Similarly, a tertiary bitmap can be used to indicate the presence of fields 129 to 192, although these data elements are rarely used.
Would it be possible to add support for one, two or three bitmaps according to the ISO standard?
The text was updated successfully, but these errors were encountered:
Hi @torgilf@timgabets
I have added a new pull request on this branch
It has iso 2003 support with 129... extended fields and auto tertiary bitmap adjustment
After running som tests on "real world" messages I've got two questions:
let len1 = parseInt(buffer.slice(0,1).toString('hex'), 16);
let len2 = parseInt(buffer.slice(1,2).toString('hex'), 16);
let actualLen = (256*len1)+len2;
buffer = buffer.slice(2,buffer.byteLength);
Would be a nice feature if the message length header was optional or configurable.
let bitmap = getHex(incoming.slice(4, 20).toString('hex')).split('').map(Number);
Description from Wikipedia
Would it be possible to add support for one, two or three bitmaps according to the ISO standard?
The text was updated successfully, but these errors were encountered: