ble-node
v1.0.4
Published
Ai-Thinker AT Mesh 模组
Downloads
57
Readme
BLE Node
Ai-Thinker AT Mesh 模组
安装
npm i ble-node
使用示例
const { BleNode } = require('ble-node');
const node = new BleNode(path, {
rts: true,
dtr: true,
baudRate: 115200,
addr: '00aa',
meshName: 'test_mesh',
meshPwd: 'test_pwd',
dataHandle: (d) => {
console.log('got data:', d);
}
});
async function main() {
await node.open();
await node.sendTo('00bb', 'Hi');
}
main().then(() => {
console.log('ble node running...');
}).catch(err => {
console.log('catch error:', err)
})
其他示例可见 src/test
。