@u4/adbkit
Version:
A Typescript client for the Android Debug Bridge.
37 lines • 1.44 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const commander_1 = require("commander");
const cli_common_1 = require("./cli-common");
for (const type of ['bluetooth', 'data', 'wifi']) {
commander_1.program
.command(`${type}-off [serials...]`)
.description('Disable bluetooth.')
.action(async (serials) => {
const devices = await (0, cli_common_1.getClientDevice)(serials);
const process = async (device) => {
if (await device.extra.setSvc(type, false)) {
console.log(`[${device.serial}] ${type} disabled`);
}
else {
console.log(`[${device.serial}] failed ${type} already disabled`);
}
};
await Promise.all(devices.map(process));
});
commander_1.program
.command(`${type}-on [serials...]`)
.description('Enable bluetooth.')
.action(async (serials) => {
const devices = await (0, cli_common_1.getClientDevice)(serials);
const process = async (device) => {
if (await device.extra.setSvc(type, true)) {
console.log(`[${device.serial}] ${type} enabled`);
}
else {
console.log(`[${device.serial}] failed ${type} already enabled`);
}
};
await Promise.all(devices.map(process));
});
}
//# sourceMappingURL=cli-connectivity.js.map