funlogic-io/zwave-serialapi

View on GitHub
lib/serialapi/functions/func-04.js

Summary

Maintainability
A
0 mins
Test Coverage
const consts = require('../consts')
const funcUtils = require('./func-utils')

const name = 'applicationCommandHandler'
const funcId = consts.FUNC_ID_APPLICATION_COMMAND_HANDLER

function decodeCallbackData (reader, result) {
  result.status = reader.readByte(rxStatus => funcUtils.decodeRxStatus(rxStatus))
  result.nodeId = reader.readByte()
  result.command = reader.readVarBytes()
}

module.exports = {
  name,
  funcId,
  decodeCallback: funcUtils.buildCallbackDecoder(funcId, decodeCallbackData)
}