@its-c10/dis-codec 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # dis-codec
2
2
 
3
- Spec-accurate **Distributed Interactive Simulation (DIS)** encode/decode library in TypeScript. Wire format follows IEEE 1278.1 (DIS application protocols). PDUs are encoded with correct header length for UDP/DIS feeds.
3
+ TypeScript encode/decode library for **Distributed Interactive Simulation (DIS)** with wire format aligned to IEEE 1278.1 (DIS application protocols).
4
+
5
+ This project focuses on a **practical subset of DIS 7 PDUs** (see list below). It is **not** an implementation of the full DIS specification.
4
6
 
5
7
  ## Install
6
8
 
7
9
  ```bash
8
- npm install dis-codec
10
+ npm install @its-c10/dis-codec
9
11
  ```
10
12
 
11
13
  ## Usage
@@ -13,7 +15,7 @@ npm install dis-codec
13
15
  **Encode a PDU and get bytes for UDP:**
14
16
 
15
17
  ```ts
16
- import { BinaryWriter, dis7 } from "dis-codec";
18
+ import { BinaryWriter, dis7 } from "@its-c10/dis-codec";
17
19
 
18
20
  const writer = new BinaryWriter();
19
21
  dis7.encodeCreateEntityPdu(writer, {
@@ -39,7 +41,7 @@ const bytes = new Uint8Array(writer.toArrayBuffer());
39
41
  **Decode a PDU from received bytes:**
40
42
 
41
43
  ```ts
42
- import { BinaryReader, dis7 } from "dis-codec";
44
+ import { BinaryReader, dis7 } from "@its-c10/dis-codec";
43
45
 
44
46
  const reader = new BinaryReader(udpPacketBuffer);
45
47
  const pdu = dis7.decodeEntityStatePdu(reader);
@@ -65,7 +67,7 @@ if (header.pduType === dis7.PDU_TYPE_ENTITY_STATE) {
65
67
  ## DIS 7 PDUs
66
68
 
67
69
  | PDU | Encode / Decode | Notes |
68
- |-----|-----------------|--------|
70
+ |-----|-----------------|-------|
69
71
  | Entity State | `encodeEntityStatePdu` / `decodeEntityStatePdu` | Variable length |
70
72
  | Create Entity | `encodeCreateEntityPdu` / `decodeCreateEntityPdu` | 28 bytes |
71
73
  | Remove Entity | `encodeRemoveEntityPdu` / `decodeRemoveEntityPdu` | 28 bytes |
@@ -74,7 +76,7 @@ if (header.pduType === dis7.PDU_TYPE_ENTITY_STATE) {
74
76
  | Electromagnetic Emission | `encodeElectromagneticEmissionPdu` / `decodeElectromagneticEmissionPdu` | Variable length |
75
77
  | Transmitter | `encodeTransmitterPdu` / `decodeTransmitterPdu` | Variable length |
76
78
 
77
- Constants for PDU types, protocol families, and fixed lengths are on `dis7` (e.g. `dis7.PDU_TYPE_ENTITY_STATE`, `dis7.CREATE_ENTITY_PDU_LENGTH`).
79
+ Constants for PDU types, protocol families, and fixed lengths are available on `dis7` (for example `dis7.PDU_TYPE_ENTITY_STATE` and `dis7.CREATE_ENTITY_PDU_LENGTH`).
78
80
 
79
81
  ## Requirements
80
82
 
@@ -38,6 +38,8 @@ export interface ModulationType {
38
38
  detail: number;
39
39
  radioSystem: number;
40
40
  }
41
+ /** Antenna pattern length in octets for Beam Antenna Pattern. */
42
+ export declare const BEAM_ANTENNA_PATTERN_LENGTH = 40;
41
43
  /**
42
44
  * Beam Antenna Pattern record (320 bits). Table 31.
43
45
  */
@@ -56,8 +58,6 @@ export interface BeamAntennaPattern {
56
58
  eX: number;
57
59
  phase: number;
58
60
  }
59
- /** Antenna pattern length in octets for Beam Antenna Pattern. */
60
- export declare const BEAM_ANTENNA_PATTERN_LENGTH = 40;
61
61
  /** Variable Transmitter Parameters record (variable length). */
62
62
  export interface VariableTransmitterParameter {
63
63
  /** 32-bit enumeration. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@its-c10/dis-codec",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Spec-accurate Distributed Interactive Simulation (DIS) encode/decode library in TypeScript",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",