We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npx pbjs -t static-module -w es6 --root wirepas -o dist/protobuf.js wirepas-5g-mesh-bridge/protobuf/generic_message.proto npx pbts -o dist/protobuf.d.ts dist/protobuf.js
import mqtt from 'mqtt' import wpGw from '../dist/protobuf.js' export const wirepasPublish = ({ bridgeEndpoint }: { bridgeEndpoint: string }) => ({ gateway, device }: { gateway: string; device: string }) => new Promise((resolve, reject) => { const client = mqtt.connect(bridgeEndpoint) client.on('connect', () => { console.log(`Connected.`) client.publish( `gw-request/send_data/${gateway}/${device}`, Buffer.from( wpGw.wirepas.proto.gateway_api.SendPacketReq.encode( wpGw.wirepas.proto.gateway_api.SendPacketReq.create({ qos: 1, sourceEndpoint: 1, destinationAddress: 1, destinationEndpoint: 1, payload: Buffer.from([1]), header: { reqId: Date.now(), }, }), ).finish(), ), (err, res) => { if (err !== null) return reject(err) return resolve(res) }, ) }) })
The text was updated successfully, but these errors were encountered:
coderbyheart
No branches or pull requests
Generate static protobuf files
Use
The text was updated successfully, but these errors were encountered: