nixpkgs/pkgs/by-name/si/sixpair/hcitool.patch
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

20 lines
718 B
Diff

diff --git a/sixpair.c b/sixpair.c
index b009a6f..78b7ef0 100644
--- a/sixpair.c
+++ b/sixpair.c
@@ -76,11 +76,11 @@ void process_device(int argc, char **argv, struct usb_device *dev,
exit(1);
}
} else {
- FILE *f = popen("hcitool dev", "r");
+ FILE *f = popen("bluetoothctl list", "r");
if ( !f ||
- fscanf(f, "%*s\n%*s %x:%x:%x:%x:%x:%x",
+ fscanf(f, "%*s %x:%x:%x:%x:%x:%x",
&mac[0],&mac[1],&mac[2],&mac[3],&mac[4],&mac[5]) != 6 ) {
- printf("Unable to retrieve local bd_addr from `hcitool dev`.\n");
+ printf("Unable to retrieve local bd_addr from `bluetoothctl list`.\n");
printf("Please enable Bluetooth or specify an address manually.\n");
exit(1);
}