4.0.0 • Published 6 years ago

@jcoreio/iron-pi-ipc-codec v4.0.0

Weekly downloads
12
License
Apache-2.0
Repository
github
Last release
6 years ago

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

4.0.0

6 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago