Skip to content
Snippets Groups Projects
Commit 9312067d authored by gyan000's avatar gyan000
Browse files

GH-3 - Stop auto-pairing.

* Now we have to use the main switch button to start a pairing.
* If device is unpaired from mobile device, switch button now turn off.
* If device was unpaired when EOSConnect was not active, switch button 
is off.
parent 1aa7f968
No related branches found
No related tags found
No related merge requests found
......@@ -82,8 +82,10 @@ namespace EOSConnect.Views {
status_switch.notify["active"].connect (() => {
if (status_switch.active) {
// ClientIface.get_instance ().allow_device.begin (device.id);
device.pair_device ();
} else {
// ClientIface.get_instance ().disallow_device.begin (device.id);
}
});
......@@ -97,6 +99,8 @@ namespace EOSConnect.Views {
public void update_ui () {
if(device.is_paired) {
status_switch.active = true;
} else {
status_switch.active = false;
}
}
}
......
......@@ -241,6 +241,10 @@ namespace MConnect {
}
}
public void pair_device () {
pair.begin ();
}
/**
* maybe_pair:
*
......@@ -248,8 +252,8 @@ namespace MConnect {
*/
public void maybe_pair () {
if (is_paired == false) {
if (_pair_in_progress == false)
pair.begin ();
//if (_pair_in_progress == false)
//pair.begin ();
} else {
// We are already paired.
handle_pair (true);
......@@ -369,7 +373,7 @@ namespace MConnect {
capability_removed (c);
// Remove capability handlers
unregister_capability_handler (c);
// update_capabilities_status_available (c, false);
// Update_capabilities_status_available (c, false);
}
if (host != null && host.to_string () != other_dev.host.to_string ()) {
......@@ -383,7 +387,7 @@ namespace MConnect {
}
public void send (Packet pkt) {
// @TODO: queue messages
// TODO: queue messages
if (_channel != null) {
_channel.send.begin (pkt);
} else {
......
......@@ -104,7 +104,7 @@ namespace MConnect {
if (is_new) {
// Make sure that this happens before we update device data so that
// all subscribeds of found_new_device() signal have a chance to
// setup eveything they need
// setup eveything they need.
this.found_new_device (dev);
dev.capability_added.connect (this.device_capability_added_cb);
dev.capability_removed.connect (this.device_capability_removed_cb);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment