From c920d6f9c8d967d7de311fc417fd5a8c8e85dd43 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 6 Aug 2013 13:33:08 -0500 Subject: add some extra comments --- src/killswitch.vala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/killswitch.vala') diff --git a/src/killswitch.vala b/src/killswitch.vala index 7695c0c..6d8f195 100644 --- a/src/killswitch.vala +++ b/src/killswitch.vala @@ -22,12 +22,14 @@ * either by software (e.g., a session configuration setting) * or by hardware (e.g., user disabled it via a physical switch on her laptop). * - * KillSwitchBluetooth uses this as a backend for its Bluetooth.blocked property. + * KillSwitchBluetooth uses this as the impl for its Bluetooth.blocked property */ public interface KillSwitch: Object { public abstract bool blocked { get; protected set; } + /* Try to block/unblock bluetooth. + * This can fail if the requested state is overruled by a hardware block. */ public abstract void try_set_blocked (bool blocked); } @@ -42,13 +44,16 @@ public class RfKillSwitch: KillSwitch, Object { return_if_fail (this.blocked != blocked); - // try to soft-block all the bluetooth devices + // Try to soft-block all the bluetooth devices var event = Linux.RfKillEvent() { op = Linux.RfKillOp.CHANGE_ALL, type = Linux.RfKillType.BLUETOOTH, soft = (uint8)blocked }; + /* Write this request to rfkill. + * Don't update this object's "blocked" property here -- + * We'll get the update when on_channel_event() reads it below */ var bwritten = Posix.write (fd, &event, sizeof(Linux.RfKillEvent)); if (bwritten == -1) warning (@"Could not write rfkill event: $(strerror(errno))"); -- cgit v1.2.3