diff options
| author | Ryan Waskiewicz <ryanwaskiewicz@gmail.com> | 2025-08-26 18:25:26 -0400 |
|---|---|---|
| committer | Ryan Waskiewicz <ryanwaskiewicz@gmail.com> | 2025-08-26 18:25:26 -0400 |
| commit | 9112d97efb26866e1bded7d52884398711eed653 (patch) | |
| tree | fcec600f8b027d7b5014eb692f77fc05904c55e1 /src/tangara/app_console/app_console.cpp | |
| parent | 30e15bba7653a63b9d158008defcece552169db6 (diff) | |
| download | tangara-fw-9112d97efb26866e1bded7d52884398711eed653.tar.gz | |
Add index column to `bt_list` command
This commit adds an 'index' field to the output of the `bt_list`
command. This is meant to be used with/for `bt_forget <index>`, which
requires an index of the device to forget - this helps clarify the index
of each device.
Diffstat (limited to 'src/tangara/app_console/app_console.cpp')
| -rw-r--r-- | src/tangara/app_console/app_console.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tangara/app_console/app_console.cpp b/src/tangara/app_console/app_console.cpp index dcefc966..711f3d68 100644 --- a/src/tangara/app_console/app_console.cpp +++ b/src/tangara/app_console/app_console.cpp @@ -470,8 +470,10 @@ int CmdBtList(int argc, char** argv) { } AppConsole::sServices->bluetooth().pairedDevice(devices[index]); } else { - std::cout << "mac\t\tname" << std::endl; + std::cout << "index\tmac\t\tname" << std::endl; + auto idx = 0; for (const auto& device : devices) { + std::cout << std::setfill(' ') << std::setw(5) << idx++ << "\t"; for (size_t i = 0; i < device.mac.size(); i++) { std::cout << std::hex << std::setfill('0') << std::setw(2) << static_cast<int>(device.mac[i]); |
