unetjs 3.2.0 → 3.2.2

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/dist/cjs/unet.cjs CHANGED
@@ -1,8 +1,8 @@
1
- /* unet.js v3.2.0 2025-01-14T01:50:07.306Z */
1
+ /* unet.js v3.2.2 2025-04-15T06:23:18.443Z */
2
2
 
3
3
  'use strict';
4
4
 
5
- /* fjage.js v1.13.5 */
5
+ /* fjage.js v1.13.7 */
6
6
 
7
7
  const isBrowser =
8
8
  typeof window !== "undefined" && typeof window.document !== "undefined";
@@ -696,7 +696,10 @@ class Message {
696
696
  class Gateway {
697
697
 
698
698
  constructor(opts = {}) {
699
- opts = Object.assign({}, GATEWAY_DEFAULTS, opts);
699
+ // Similar to Object.assign but also overwrites `undefined` and empty strings with defaults
700
+ for (var key in GATEWAY_DEFAULTS){
701
+ if (opts[key] == undefined || opts[key] === '') opts[key] = GATEWAY_DEFAULTS[key];
702
+ }
700
703
  var url = DEFAULT_URL;
701
704
  url.hostname = opts.hostname;
702
705
  url.port = opts.port;
@@ -714,7 +717,7 @@ class Gateway {
714
717
  this.queue = []; // incoming message queue
715
718
  this.connected = false; // connection status
716
719
  this.debug = false; // debug info to be logged to console?
717
- this.aid = new AgentID((isBrowser ? 'WebGW-' : 'NodeGW-')+_guid(4)); // gateway agent name
720
+ this.aid = new AgentID('gateway-'+_guid(4)); // gateway agent name
718
721
  this.connector = this._createConnector(url);
719
722
  this._addGWCache(this);
720
723
  }
@@ -1310,6 +1313,7 @@ function MessageClass(name, parent=Message) {
1310
1313
  this[k] = params[k];
1311
1314
  }
1312
1315
  }
1316
+ if (name.endsWith('Req')) this.perf = Performative.REQUEST;
1313
1317
  }
1314
1318
  };
1315
1319
  cls.__clazz__ = name;
@@ -1446,6 +1450,7 @@ const ParameterReq = MessageClass('org.arl.fjage.param.ParameterReq');
1446
1450
 
1447
1451
  const DatagramReq$1 = MessageClass('org.arl.unet.DatagramReq');
1448
1452
  const DatagramNtf$1 = MessageClass('org.arl.unet.DatagramNtf');
1453
+ const TxFrameReq = MessageClass('org.arl.unet.phy.TxFrameReq', DatagramReq$1);
1449
1454
  const RxFrameNtf$1 = MessageClass('org.arl.unet.phy.RxFrameNtf', DatagramNtf$1);
1450
1455
  const BasebandSignal = MessageClass('org.arl.unet.bb.BasebandSignal');
1451
1456
 
@@ -1519,8 +1524,9 @@ let UnetMessages = {
1519
1524
  // phy
1520
1525
  'FecDecodeReq' : MessageClass('org.arl.unet.phy.FecDecodeReq'),
1521
1526
  'RxSWiG1FrameNtf' : MessageClass('org.arl.unet.phy.RxSWiG1FrameNtf', RxFrameNtf$1),
1527
+ 'TxSWiG1FrameReq' : MessageClass('org.arl.unet.phy.TxSWiG1FrameReq', TxFrameReq),
1522
1528
  'RxJanusFrameNtf' : MessageClass('org.arl.unet.phy.RxJanusFrameNtf', RxFrameNtf$1),
1523
- 'TxJanusFrameReq' : MessageClass('org.arl.unet.phy.TxJanusFrameReq'),
1529
+ 'TxJanusFrameReq' : MessageClass('org.arl.unet.phy.TxJanusFrameReq', TxFrameReq),
1524
1530
  'BadFrameNtf' : MessageClass('org.arl.unet.phy.BadFrameNtf'),
1525
1531
  'BadRangeNtf' : MessageClass('org.arl.unet.phy.BadRangeNtf'),
1526
1532
  'ClearSyncReq' : MessageClass('org.arl.unet.phy.ClearSyncReq'),
package/dist/esm/unet.js CHANGED
@@ -1,6 +1,6 @@
1
- /* unet.js v3.2.0 2025-01-14T01:50:07.305Z */
1
+ /* unet.js v3.2.2 2025-04-15T06:23:18.442Z */
2
2
 
3
- /* fjage.js v1.13.5 */
3
+ /* fjage.js v1.13.7 */
4
4
 
5
5
  const isBrowser =
6
6
  typeof window !== "undefined" && typeof window.document !== "undefined";
@@ -694,7 +694,10 @@ class Message {
694
694
  class Gateway {
695
695
 
696
696
  constructor(opts = {}) {
697
- opts = Object.assign({}, GATEWAY_DEFAULTS, opts);
697
+ // Similar to Object.assign but also overwrites `undefined` and empty strings with defaults
698
+ for (var key in GATEWAY_DEFAULTS){
699
+ if (opts[key] == undefined || opts[key] === '') opts[key] = GATEWAY_DEFAULTS[key];
700
+ }
698
701
  var url = DEFAULT_URL;
699
702
  url.hostname = opts.hostname;
700
703
  url.port = opts.port;
@@ -712,7 +715,7 @@ class Gateway {
712
715
  this.queue = []; // incoming message queue
713
716
  this.connected = false; // connection status
714
717
  this.debug = false; // debug info to be logged to console?
715
- this.aid = new AgentID((isBrowser ? 'WebGW-' : 'NodeGW-')+_guid(4)); // gateway agent name
718
+ this.aid = new AgentID('gateway-'+_guid(4)); // gateway agent name
716
719
  this.connector = this._createConnector(url);
717
720
  this._addGWCache(this);
718
721
  }
@@ -1308,6 +1311,7 @@ function MessageClass(name, parent=Message) {
1308
1311
  this[k] = params[k];
1309
1312
  }
1310
1313
  }
1314
+ if (name.endsWith('Req')) this.perf = Performative.REQUEST;
1311
1315
  }
1312
1316
  };
1313
1317
  cls.__clazz__ = name;
@@ -1444,6 +1448,7 @@ const ParameterReq = MessageClass('org.arl.fjage.param.ParameterReq');
1444
1448
 
1445
1449
  const DatagramReq$1 = MessageClass('org.arl.unet.DatagramReq');
1446
1450
  const DatagramNtf$1 = MessageClass('org.arl.unet.DatagramNtf');
1451
+ const TxFrameReq = MessageClass('org.arl.unet.phy.TxFrameReq', DatagramReq$1);
1447
1452
  const RxFrameNtf$1 = MessageClass('org.arl.unet.phy.RxFrameNtf', DatagramNtf$1);
1448
1453
  const BasebandSignal = MessageClass('org.arl.unet.bb.BasebandSignal');
1449
1454
 
@@ -1517,8 +1522,9 @@ let UnetMessages = {
1517
1522
  // phy
1518
1523
  'FecDecodeReq' : MessageClass('org.arl.unet.phy.FecDecodeReq'),
1519
1524
  'RxSWiG1FrameNtf' : MessageClass('org.arl.unet.phy.RxSWiG1FrameNtf', RxFrameNtf$1),
1525
+ 'TxSWiG1FrameReq' : MessageClass('org.arl.unet.phy.TxSWiG1FrameReq', TxFrameReq),
1520
1526
  'RxJanusFrameNtf' : MessageClass('org.arl.unet.phy.RxJanusFrameNtf', RxFrameNtf$1),
1521
- 'TxJanusFrameReq' : MessageClass('org.arl.unet.phy.TxJanusFrameReq'),
1527
+ 'TxJanusFrameReq' : MessageClass('org.arl.unet.phy.TxJanusFrameReq', TxFrameReq),
1522
1528
  'BadFrameNtf' : MessageClass('org.arl.unet.phy.BadFrameNtf'),
1523
1529
  'BadRangeNtf' : MessageClass('org.arl.unet.phy.BadRangeNtf'),
1524
1530
  'ClearSyncReq' : MessageClass('org.arl.unet.phy.ClearSyncReq'),
package/dist/unetjs.js CHANGED
@@ -4,7 +4,7 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.unet = {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
- /* fjage.js v1.13.5 */
7
+ /* fjage.js v1.13.7 */
8
8
 
9
9
  const isBrowser =
10
10
  typeof window !== "undefined" && typeof window.document !== "undefined";
@@ -698,7 +698,10 @@
698
698
  class Gateway {
699
699
 
700
700
  constructor(opts = {}) {
701
- opts = Object.assign({}, GATEWAY_DEFAULTS, opts);
701
+ // Similar to Object.assign but also overwrites `undefined` and empty strings with defaults
702
+ for (var key in GATEWAY_DEFAULTS){
703
+ if (opts[key] == undefined || opts[key] === '') opts[key] = GATEWAY_DEFAULTS[key];
704
+ }
702
705
  var url = DEFAULT_URL;
703
706
  url.hostname = opts.hostname;
704
707
  url.port = opts.port;
@@ -716,7 +719,7 @@
716
719
  this.queue = []; // incoming message queue
717
720
  this.connected = false; // connection status
718
721
  this.debug = false; // debug info to be logged to console?
719
- this.aid = new AgentID((isBrowser ? 'WebGW-' : 'NodeGW-')+_guid(4)); // gateway agent name
722
+ this.aid = new AgentID('gateway-'+_guid(4)); // gateway agent name
720
723
  this.connector = this._createConnector(url);
721
724
  this._addGWCache(this);
722
725
  }
@@ -1312,6 +1315,7 @@
1312
1315
  this[k] = params[k];
1313
1316
  }
1314
1317
  }
1318
+ if (name.endsWith('Req')) this.perf = Performative.REQUEST;
1315
1319
  }
1316
1320
  };
1317
1321
  cls.__clazz__ = name;
@@ -1448,6 +1452,7 @@
1448
1452
 
1449
1453
  const DatagramReq$1 = MessageClass('org.arl.unet.DatagramReq');
1450
1454
  const DatagramNtf$1 = MessageClass('org.arl.unet.DatagramNtf');
1455
+ const TxFrameReq = MessageClass('org.arl.unet.phy.TxFrameReq', DatagramReq$1);
1451
1456
  const RxFrameNtf$1 = MessageClass('org.arl.unet.phy.RxFrameNtf', DatagramNtf$1);
1452
1457
  const BasebandSignal = MessageClass('org.arl.unet.bb.BasebandSignal');
1453
1458
 
@@ -1521,8 +1526,9 @@
1521
1526
  // phy
1522
1527
  'FecDecodeReq' : MessageClass('org.arl.unet.phy.FecDecodeReq'),
1523
1528
  'RxSWiG1FrameNtf' : MessageClass('org.arl.unet.phy.RxSWiG1FrameNtf', RxFrameNtf$1),
1529
+ 'TxSWiG1FrameReq' : MessageClass('org.arl.unet.phy.TxSWiG1FrameReq', TxFrameReq),
1524
1530
  'RxJanusFrameNtf' : MessageClass('org.arl.unet.phy.RxJanusFrameNtf', RxFrameNtf$1),
1525
- 'TxJanusFrameReq' : MessageClass('org.arl.unet.phy.TxJanusFrameReq'),
1531
+ 'TxJanusFrameReq' : MessageClass('org.arl.unet.phy.TxJanusFrameReq', TxFrameReq),
1526
1532
  'BadFrameNtf' : MessageClass('org.arl.unet.phy.BadFrameNtf'),
1527
1533
  'BadRangeNtf' : MessageClass('org.arl.unet.phy.BadRangeNtf'),
1528
1534
  'ClearSyncReq' : MessageClass('org.arl.unet.phy.ClearSyncReq'),