2.1.0 • Published 9 months ago

@arendi/testing v2.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

Arendi WebSocket client API

This package contains JavaScript source files for testing, used by different Arendi libraries.

Prerequisite

WebSocket server

An instance of the WebSocket server must be running in order for the following sample code to run. To install the WebSocket server, download and execute the installer from https://www.arendi.ch/blt2450

Node

Node.js (at least v16) must be installed on the target machine: https://nodejs.org


Installation

Install with npm:

npm install "@arendi/testing"

Example, using BLT2450 tester

const {
  Interface,
  WsInterface,
  Blt24,
  Blt24List,
  Blt24Mode,
  DtmChannel,
  DtmLength,
  DtmPattern,
  DtmPhy
} = require('@arendi/testing');

// Create WebSocket interface and Blt24 list
const wsInterface = new WsInterface();
const blt24List = new Blt24List(wsInterface);

/* inside async function */
// Open interface and get list of all Blt24 tester
await wsInterface.Open('ws://localhost:5000/blt24/');
await blt24List.Refresh(); // optional
console.log('Blt24 tester list:', blt24List.list);

// Get Blt24 tester with a given serial number
const blt24 = blt24List.Get('123456789ABC-DE');
if (blt24) {
  // Activate DTM mode and start Rx test with an interval of 1000ms
  blt24.SetMode(Blt24Mode.Dtm);
  blt24.DtmRxStart(DtmChannel.Ch19, DtmLength.L37, DtmPattern.Prbs9, DtmPhy.Phy1Mbps, null, 1000);

  // Receive Dtm test results
  while (true) {
    const dtmData = blt24.Read('DtmResultIndication');
    console.log(`Packet Error Rate (PER): ${dtmData.per}`);
  }
}

Development

Build

To build the project from source, perform the following steps:

  • clone the repository to a local folder:
- Open the created folder and run
  ```bash
  npm install
  npm run build
  ```

The 'npm run build' command described above must be executed in order to compile and copy any changes made to the source files located in the src directory

#### Test

- Run server application
  ```bash
  npm run server
  ```
- Run production test (cons testerSerialNumber inside Test/Production.js must be set to current tester)
  ```bash
  npm run productiontest
  ```
1.2.0

10 months ago

2.1.0

9 months ago

1.2.2

9 months ago

2.0.0

9 months ago

1.2.1

9 months ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago