UI support to cleanup bluetooth bonded devices (#757)

Signed-off-by: Jussi Vatjus-Anttila <jussiva@gmail.com>
This commit is contained in:
Jussi Vatjus-Anttila
2024-01-30 01:38:54 +02:00
committed by GitHub
parent c481720dd7
commit 806bfa4087
7 changed files with 61 additions and 0 deletions

View File

@@ -51,4 +51,24 @@ module.exports = syrup.serial()
])
})
})
router.on(wire.BluetoothCleanBondedMessage, function(channel) {
var reply = wireutil.reply(options.serial)
log.info('Clean bonded Bluetooth devices')
service.cleanupBondedBluetoothDevices()
.timeout(30000)
.then(function() {
push.send([
channel
, reply.okay()
])
})
.catch(function(err) {
log.error('Cleaning Bluetooth bonded devices failed', err.stack)
push.send([
channel
, reply.fail(err.message)
])
})
})
})