https://github.com/jcoreio/iron-pi-ipc-codec
Encodes and decodes SPI bus messages exchanged with the Iron Pi
https://github.com/jcoreio/iron-pi-ipc-codec
Last synced: 11 months ago
JSON representation
Encodes and decodes SPI bus messages exchanged with the Iron Pi
- Host: GitHub
- URL: https://github.com/jcoreio/iron-pi-ipc-codec
- Owner: jcoreio
- License: apache-2.0
- Created: 2018-11-12T21:20:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T12:44:56.000Z (over 3 years ago)
- Last Synced: 2025-07-05T05:21:24.600Z (11 months ago)
- Language: JavaScript
- Size: 3.1 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```js
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](LICENSE)