2.0.0-alpha.11 • Published 7 months ago

@novastar/net v2.0.0-alpha.11

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@novastar/net

Net binding for @novastar/codec.

Go to API documentation.

Installation

Using npm:

$ npm install --save @novastar/net@next

or yarn:

$ yarn add @novastar/net@next

Usage:

import net, { findNetDevices } from '@novastar/net';

const [address] = await findNetDevices();
if (address) {
  session = net.open(address);
}

const writeReq = new Request([255]);
writeReq.deviceType = DeviceType.ReceivingCard;
writeReq.address = 0x02000001;
await session.connection.send(writeReq);

// Close all network sessions
net.release();