Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@jcoreio/iron-pi-ipc-codec

Package Overview
Dependencies
Maintainers
11
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jcoreio/iron-pi-ipc-codec

Encodes and decodes SPI bus messages exchanged with the Iron Pi

latest
Source
npmnpm
Version
4.0.0
Version published
Maintainers
11
Created
Source

Iron Pi IPC Codec

Encodes and decodes messages exchanged over UNIX sockets with the Iron Pi SPI handler

Getting Started

npm install --save @jcoreio/iron-pi-ipc-codec

Example


import IronPiIPCCodec from './index'
import type {SetOutputs} from './index'

const codec: IronPiIPCCodec = new IronPiIPCCodec()

const setOutputs: SetOutputs = {
  outputs: [
    {
      address: 1,
      levels: [true, false, true, false],
    },
    {
      address: 2,
      levels: [true, true, true, true, false, false, false, false],
    }
  ]
}
const buf: Buffer = codec.encodeSetOutputs(setOutputs)
const msgOut = codec.decodeMessageToDriver(buf)
// msgOut = {setOutputs: {outputs: [ ... ]}}

License

Apache-2.0

Keywords

SPI

FAQs

Package last updated on 29 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts