From 7dbd8a06abe39a4fb62b4935d717752f54caeaea Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 13 Mar 2016 19:08:47 -0400 Subject: [PATCH] Add a license header and a README. --- README | 4 ++++ apple-ir-control.cc | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..18b367e --- /dev/null +++ b/README @@ -0,0 +1,4 @@ +apple-ir-control is a command line utility to get and set the enabled/disabled +state of the IR remote control on Macs. + +This is equivalent of System Preferences > Security > Advanced > Disable remote diff --git a/apple-ir-control.cc b/apple-ir-control.cc index 91345e6..d159004 100644 --- a/apple-ir-control.cc +++ b/apple-ir-control.cc @@ -1,3 +1,12 @@ +// +// apple-ir-control +// Copyright (c) 2016, Robert Sesek +// +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or any later version. +// + #include #include #include @@ -67,6 +76,7 @@ bool IsIRAvailable() { ERROR("Failed to IOHIDManagerCopyDevices"); return false; } + std::vector devices_array(CFSetGetCount(devices.get()), nullptr); CFSetGetValues(devices.get(), const_cast(devices_array.data())); for (const auto& device : devices_array) { -- 2.43.5