Cleanup set_mode code
Luiz Augusto von Dentz
maintainerPATCH 1/1 Cleanup set_mode code
From: Luiz Augusto von Dentz <[email protected]>
Now that MODE_LIMITED was removed there is no need to compare string mode to determine if scan mode will change or not.
--- src/adapter.c | 21 +++++---------------- 1 files changed, 5 insertions(+), 16 deletions(-)
src/adapter.c +5 -16
@@ -603,22 +603,11 @@ done:DBG ("%s" , modestr); -if (msg !=NULL ) { -/* Limited to Discoverable and vice-versa doesn't cause any -change to scan mode */ -if (g_str_equal (modestr,mode2str (adapter->mode)) == TRUE) { -DBusMessage *reply; - - reply =g_dbus_create_reply (msg,DBUS_TYPE_INVALID ); - -g_dbus_send_message (connection, reply); - }else -/* Wait for mode change to reply */ - adapter->pending_mode =create_session (adapter, - connection, - msg, new_mode, -NULL ); - }else +if (msg !=NULL ) +/* Wait for mode change to reply */ + adapter->pending_mode =create_session (adapter, connection, + msg, new_mode,NULL ); +else /* Nothing to reply just write the new mode */ adapter->mode = new_mode;
Signature · 1 line
1.7.1
Hi Luiz,
Quoted 7 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
Now that
MODE_LIMITEDwas removed there is no need to compare string mode to determine if scan mode will change or not.--- src/adapter.c | 21 +++++---------------- 1 files changed, 5 insertions(+), 16 deletions(-)
Pushed upstream. Thanks.
Johan