Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sammachin committed Dec 29, 2024
1 parent d183e11 commit 4b318c4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

repl.js
repl.js
2 changes: 1 addition & 1 deletion manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
});
$('#node-input-label').typedInput({
types: ['str', 'msg', 'flow', 'global', 'jsonata', 'env'],
typeField: $('#node-input-lablelType')
typeField: $('#node-input-labelType')
});
}
});
Expand Down
29 changes: 27 additions & 2 deletions repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,33 @@ const commissioningController = new CommissioningController({
});

await commissioningController.start();
let longDiscriminator = undefined
let shortDiscriminator = undefined

async function commissionDevice(pc){
let re = new RegExp("MT:.*")
let pcData
if (re.test(pc)) {
pcData = QrPairingCodeCodec.decode(pc)[0]
} else {
pcData = ManualPairingCodeCodec.decode(pc);
}
let options = {
commissioning :{
regulatoryLocation: 2
},
discovery: {
identifierData:
{ shortDiscriminator : pcData.shortDiscriminator } ,
discoveryCapabilities: {
ble : false,
},
},
passcode: pcData.passcode,
}
const nodeId = await commissioningController.commissionNode(options);
console.log(`Commissioning successfully done with nodeId ${nodeId}`);
}




var nodes = commissioningController.getCommissionedNodes();
Expand Down

0 comments on commit 4b318c4

Please sign in to comment.