Process messages to send to devices.
import * as message from 'jooby-codec/analog-ultrasound/message/downlink';import * as downlinkCommands from 'jooby-codec/analog-ultrasound/commands/downlink';import getHexFromBytes from 'jooby-codec/utils/getHexFromBytes.js';const commands = [ { id: downlinkCommands.setDepassivationConfig.id, parameters: {resistanceStartThreshold: 24000, resistanceStopThreshold: 20000} }];const bytes = message.toBytes(commands);console.log('message encoded:', JSON.stringify(bytes));// output:'[7, 34, 25, 192, 93, 32, 78]'console.log('message encoded in HEX:', getHexFromBytes(bytes));// output:'07 22 19 b8 88 a8 61' Copy
import * as message from 'jooby-codec/analog-ultrasound/message/downlink';import * as downlinkCommands from 'jooby-codec/analog-ultrasound/commands/downlink';import getHexFromBytes from 'jooby-codec/utils/getHexFromBytes.js';const commands = [ { id: downlinkCommands.setDepassivationConfig.id, parameters: {resistanceStartThreshold: 24000, resistanceStopThreshold: 20000} }];const bytes = message.toBytes(commands);console.log('message encoded:', JSON.stringify(bytes));// output:'[7, 34, 25, 192, 93, 32, 78]'console.log('message encoded in HEX:', getHexFromBytes(bytes));// output:'07 22 19 b8 88 a8 61'
Process messages to send to devices.
Example