From 17c50024cf293a91c7d18c2495c1f3e31b986a8a Mon Sep 17 00:00:00 2001 From: Rusty Lynch Date: Mon, 20 Aug 2012 17:41:09 -0700 Subject: [PATCH] Whitespace cleanup --- README.txt | 6 +- Tizen.Device.js | 240 ++++++++++++++++++++++++++++---------------------------- homescreen.js | 153 ++++++++++++++++++------------------ index.html | 2 +- main.c | 88 ++++++++++----------- 5 files changed, 242 insertions(+), 247 deletions(-) diff --git a/README.txt b/README.txt index 4b30420..9d9f3a5 100644 --- a/README.txt +++ b/README.txt @@ -32,7 +32,7 @@ $ sudo make install After all deps are installed then building sockdrawer should be as simple as typing 'make' and running the sockdrawer binary from the source directory. Sample webapps that want to use the sockdrawer functionality should add: - + ... to the toplevel HTML file. @@ -41,7 +41,3 @@ The current prototyping activities include: tizen.application: Enables the creation of an HTML based application launcher tizen.call and tizen.account: Enables the creation of an HTML based dialer - - - - diff --git a/Tizen.Device.js b/Tizen.Device.js index 4b6b175..50848eb 100644 --- a/Tizen.Device.js +++ b/Tizen.Device.js @@ -8,7 +8,7 @@ var __application = function () { var socket = new WebSocket("ws://localhost:7681", "app-list-protocol"); socket.onmessage = function(msg) { - appList = JSON.parse(msg.data); + appList = JSON.parse(msg.data); if (callback) callback(appList); } @@ -31,12 +31,12 @@ var __callmanager = function () { var socket = new WebSocket("ws://localhost:7681", "dialer-protocol"); var services = new Array(); - var listener = { - "onAccountUpdated": function(account) { - }, - "onAccountAdded": function(account) { + var listener = { + "onAccountUpdated": function(account) { + }, + "onAccountAdded": function(account) { services.push(new __callservice(socket, account.id)); - }, + }, "onAccountRemoved": function(id) { var tmp = new Array(); for (var i in services) @@ -48,7 +48,7 @@ var __callmanager = function () { tizen.__account.addAccountListener(listener); socket.onmessage = function(msg) { - var ev = JSON.parse(msg.data); + var ev = JSON.parse(msg.data); if (ev.type == "ModemAdded") { tizen.__account.addAccount(new tizen.Account(ev.ModemAdded, ev)); @@ -63,73 +63,73 @@ var __callmanager = function () { tmp.push(calls[i]); calls = tmp; } else if (ev.type == "PropertyChanged" && ev.State) { - try { - if (ev.State == "incoming") { - for (var index in callHandlers) - for (var i in calls) + try { + if (ev.State == "incoming") { + for (var index in callHandlers) + for (var i in calls) if (calls[i].id == ev.id) - callHandlers[index].onIncoming(calls[i]); - } else if (ev.State == "dialing") { - for (var index in callHandlers) - for (var i in calls) + callHandlers[index].onIncoming(calls[i]); + } else if (ev.State == "dialing") { + for (var index in callHandlers) + for (var i in calls) if (calls[i].id == ev.id) - callHandlers[index].onDialing(calls[i]); - } else if (ev.State == "alerting") { - for (var index in callHandlers) - for (var i in calls) + callHandlers[index].onDialing(calls[i]); + } else if (ev.State == "alerting") { + for (var index in callHandlers) + for (var i in calls) if (calls[i].id == ev.id) - callHandlers[index].onAlerting(calls[i]); - } else if (ev.State == "hold") { - for (var index in callHandlers) - for (var i in calls) + callHandlers[index].onAlerting(calls[i]); + } else if (ev.State == "hold") { + for (var index in callHandlers) + for (var i in calls) if (calls[i].id == ev.id) - callHandlers[index].onHold(calls[i]); - } else if (ev.State == "waiting") { - for (var index in callHandlers) - for (var i in calls) + callHandlers[index].onHold(calls[i]); + } else if (ev.State == "waiting") { + for (var index in callHandlers) + for (var i in calls) if (calls[i].id == ev.id) - callHandlers[index].onWaiting(calls[i]); - } else if (ev.State == "disconnected") { - for (var index in callHandlers) - for (var i in calls) + callHandlers[index].onWaiting(calls[i]); + } else if (ev.State == "disconnected") { + for (var index in callHandlers) + for (var i in calls) if (calls[i].id == ev.id) - callHandlers[index].onDisconnected(calls[i]); - } else if (ev.State == "disconnecting") { - for (var index in callHandlers) - for (var i in calls) + callHandlers[index].onDisconnected(calls[i]); + } else if (ev.State == "disconnecting") { + for (var index in callHandlers) + for (var i in calls) if (calls[i].id == ev.id) - callHandlers[index].onDisconnecting(calls[i]); - } else if (ev.State == "accepted") { - for (var index in callHandlers) - for (var i in calls) + callHandlers[index].onDisconnecting(calls[i]); + } else if (ev.State == "accepted") { + for (var index in callHandlers) + for (var i in calls) if (calls[i].id == ev.id) - callHandlers[index].onAccepted(calls[i]); - } else if (ev.State == "remotelyheld") { - for (var index in callHandlers) - for (var i in calls) + callHandlers[index].onAccepted(calls[i]); + } else if (ev.State == "remotelyheld") { + for (var index in callHandlers) + for (var i in calls) if (calls[i].id == ev.id) - callHandlers[index].onRemotelyHeld(calls[i]); - } else if (ev.State == "active") { - for (var index in callHandlers) - for (var i in calls) + callHandlers[index].onRemotelyHeld(calls[i]); + } else if (ev.State == "active") { + for (var index in callHandlers) + for (var i in calls) if (calls[i].id == ev.id) - callHandlers[index].onActivated(calls[i]); - } else if (ev.State == "initializing") { - for (var index in callHandlers) - for (var i in calls) + callHandlers[index].onActivated(calls[i]); + } else if (ev.State == "initializing") { + for (var index in callHandlers) + for (var i in calls) if (calls[i].id == ev.id) - callHandlers[index].onInitializing(calls[i]); - } else if (ev.State == "initialized") { - for (var index in callHandlers) - for (var i in calls) + callHandlers[index].onInitializing(calls[i]); + } else if (ev.State == "initialized") { + for (var index in callHandlers) + for (var i in calls) if (calls[i].id == ev.id) - callHandlers[index].onInitialized(calls[i]); - } else { + callHandlers[index].onInitialized(calls[i]); + } else { console.log("Unhandled state: " + ev.State); - } - } catch (err) { - // handlers do not have to implement every callback - } + } + } catch (err) { + // handlers do not have to implement every callback + } } else { console.log("Unhandled event"); console.log(ev); @@ -137,27 +137,27 @@ var __callmanager = function () { } this.history = null; - this.isCallInProgress = function() { - return calls.length > 0; - } - this.addCallHandler = function(handler, callServiceType, serviceName) { - callHandlers.push(handler); - } - this.removeCallHandler = function(handler) { - var tmp = new Array(); - for (var item in callHandlers) - if (item != handler) - tmp.push(item); - callHandlers = tmp; - + this.isCallInProgress = function() { + return calls.length > 0; + } + this.addCallHandler = function(handler, callServiceType, serviceName) { + callHandlers.push(handler); + } + this.removeCallHandler = function(handler) { + var tmp = new Array(); + for (var item in callHandlers) + if (item != handler) + tmp.push(item); + callHandlers = tmp; + } - this.getCallService = function(account) { + this.getCallService = function(account) { try { for (var i in services) if (services[i].id == account.id) return services[i]; } catch (ex) {} - + return services[0]; } } @@ -171,22 +171,22 @@ var __callservice = function (wsi, serviceid) { }); this.launchDialer = function(remotePartyId) { - socket.send(JSON.stringify({ "cmd": "launchDialer" })); + socket.send(JSON.stringify({ "cmd": "launchDialer" })); } var voicemailNumbers = new Array(); this.__defineGetter__("voiceNumbers", function() { - return voicemailNumbers; + return voicemailNumbers; }); - + this.makeCall = function(remotePartyId, handler, extension, localVideoOn) { - var c = { - "cmd": "makeCall", - "remotePartyId": remotePartyId.toString(), - "extension": extension, - "localVideoOn": localVideoOn - }; - socket.send(JSON.stringify(c)); + var c = { + "cmd": "makeCall", + "remotePartyId": remotePartyId.toString(), + "extension": extension, + "localVideoOn": localVideoOn + }; + socket.send(JSON.stringify(c)); } } @@ -195,51 +195,51 @@ var __call = function(manager, wsi, data) { var id = data.id; this.__defineGetter__("id", function() { - return id; + return id; }); var callData = data; this.__defineGetter__("callData", function() { - return callData; + return callData; }); - + var streamList = new Array(); this.__defineGetter__("streamList", function() { - return streamList; + return streamList; }); this.accept = function() { - socket.send(JSON.stringify({"cmd": "accept"})); + socket.send(JSON.stringify({"cmd": "accept"})); } this.reject = function() { - socket.send(JSON.stringify({"cmd": "reject"})); + socket.send(JSON.stringify({"cmd": "reject"})); } this.wait = function() { - socket.send(JSON.stringify({"cmd": "wait"})); + socket.send(JSON.stringify({"cmd": "wait"})); } this.redirect = function(rid) { - socket.send(JSON.stringify({"cmd": "redirect"})); + socket.send(JSON.stringify({"cmd": "redirect"})); } this.end = function() { - socket.send(JSON.stringify({"cmd": "end", "path": id})); + socket.send(JSON.stringify({"cmd": "end", "path": id})); } this.hold = function() { - socket.send(JSON.stringify({"cmd": "hold"})); + socket.send(JSON.stringify({"cmd": "hold"})); } this.activate = function() { - socket.send(JSON.stringify({"cmd": "activate"})); + socket.send(JSON.stringify({"cmd": "activate"})); } this.migrate = function(callService, callParticipant) { - socket.send(JSON.stringify({"cmd": "migrate", "callService": callService, "callParticipant": callParticipant})); + socket.send(JSON.stringify({"cmd": "migrate", "callService": callService, "callParticipant": callParticipant})); } this.merge = function(otherCall) { - socket.send(JSON.stringify({"cmd": "merge", "otherCall": otherCall})); + socket.send(JSON.stringify({"cmd": "merge", "otherCall": otherCall})); } this.drop = function(participant) { - socket.send(JSON.stringify({"cmd": "drop", "participant": participant})); + socket.send(JSON.stringify({"cmd": "drop", "participant": participant})); } this.split = function(participant) { - socket.send(JSON.stringify({"cmd": "split", "participant": participant})); + socket.send(JSON.stringify({"cmd": "split", "participant": participant})); } this.addParticipant = function(remotePartyId, successCallback, errorCallback) { } @@ -302,7 +302,7 @@ var __accountmanager = function() { accounts = l; for (var i in listeners) - listeners[i].onAccountRemoved(accountid); + listeners[i].onAccountRemoved(accountid); } this.addAccount = function(account) { accounts.push(account); @@ -325,9 +325,9 @@ var __accountmanager = function() { var __tizen = function() { var application = null; this.__defineGetter__("application", function() { - if (application == null) - application = new __application(); - return application; + if (application == null) + application = new __application(); + return application; }); this.Account = function (accountId, accountProperties) { @@ -345,28 +345,28 @@ var __tizen = function() { var call = null; this.__defineGetter__("call", function() { - if (call == null) { - // ensure the account object is created first - tizen.account; + if (call == null) { + // ensure the account object is created first + tizen.account; - call = new __callmanager(); - } - return call; + call = new __callmanager(); + } + return call; }); var account = null; this.__defineGetter__("account", function() { if (account == null) account = new __accountmanager(); - // ensure the call object is always the first listener - // for new accounts, which means we need a backdoor to - // access the acount object before the getter has finished - // executing for the first time - this.__defineGetter__("__account", function() { - return account; - }); - if (call == null) - call = new __callmanager(); + // ensure the call object is always the first listener + // for new accounts, which means we need a backdoor to + // access the acount object before the getter has finished + // executing for the first time + this.__defineGetter__("__account", function() { + return account; + }); + if (call == null) + call = new __callmanager(); return account; }); } diff --git a/homescreen.js b/homescreen.js index c95ef4b..3a6b8bf 100644 --- a/homescreen.js +++ b/homescreen.js @@ -18,87 +18,87 @@ function createAppEntry(index) { var activeCall = null; document.body.onload = function() { - var listener = { - "onAccountUpdated": function(account) { - console.log("Account updated: " + account.id); - }, - "onAccountAdded": function(account) { - console.log("Account added " + account.id); - }, + var listener = { + "onAccountUpdated": function(account) { + console.log("Account updated: " + account.id); + }, + "onAccountAdded": function(account) { + console.log("Account added " + account.id); + }, "onAccountRemoved": function(id) { - console.log("Account Removed " + id); + console.log("Account Removed " + id); } } tizen.account.addAccountListener(listener); var handler = { - onCallList: function (callList) { - console.log("onCallList: " + callList); - }, - onIncoming: function(call) { - console.log("Incoming call from " + call.callData.LineIdentification); - activeCall = call; - }, - onDialing: function(call) { - console.log("onDialing: "); console.log(call); - activeCall = call; - }, - onAlerting: function(call) { - activeCall = call; - console.log("onAlerting: "); console.log(call); - }, - onHold: function(call) { - console.log("onHold: "); console.log(call); - }, - onWaiting: function(call) { - console.log("onWaiting: "); console.log(call); - }, - onDisconnected: function(call, disconnectReason) { - console.log("onDisconnected: " + call + " " + disconnectReason); - activeCall = null; - }, - onDisconnecting: function(call) { - console.log("onDisconnecting: "); console.log(call); - }, - onAccepted: function(call) { - console.log("onAccepted: "); console.log(call); - }, - onRemotelyHeld: function(call) { - console.log("onRemotelyHeld: "); console.log(call); - }, - onActivated: function(call) { - console.log("onActivated: "); console.log(call); - }, - onInitializing: function(call) { - console.log("onInitializing: "); console.log(call); - }, - onInitialized: function(call) { - console.log("onInitialized: "); console.log(call); - }, - onCapabilitiesChanged: function(call) { - console.log("onCapabilitiesChanged: "); console.log(call); - }, - onParticipantsChanged: function (call, addedP, removedP) { - console.log("onParticipantsChanged: " + call + " " + addedP + " " + removedP); - }, - onStreamsChanged: function(call, addedS, removedS){ - console.log("onStreamsChanged: " + call + " " + addedP + " " + removedP); - }, - onCallSplit: function(confCall, splitCall) { - console.log("onCallSplit: " + confCall + " " + splitCall); - }, - onRecordingStarted: function (call) { - console.log("onRecordingStarted: "); console.log(call); - }, - onRecordingStopped: function(call) { - console.log("onRecordingStopped: "); console.log(call); - }, - onCallChanged: function(call) { - console.log("onCallChanged: "); console.log(call); - }, - onError: function(call){ - console.log("onError: "); console.log(call); - } + onCallList: function (callList) { + console.log("onCallList: " + callList); + }, + onIncoming: function(call) { + console.log("Incoming call from " + call.callData.LineIdentification); + activeCall = call; + }, + onDialing: function(call) { + console.log("onDialing: "); console.log(call); + activeCall = call; + }, + onAlerting: function(call) { + activeCall = call; + console.log("onAlerting: "); console.log(call); + }, + onHold: function(call) { + console.log("onHold: "); console.log(call); + }, + onWaiting: function(call) { + console.log("onWaiting: "); console.log(call); + }, + onDisconnected: function(call, disconnectReason) { + console.log("onDisconnected: " + call + " " + disconnectReason); + activeCall = null; + }, + onDisconnecting: function(call) { + console.log("onDisconnecting: "); console.log(call); + }, + onAccepted: function(call) { + console.log("onAccepted: "); console.log(call); + }, + onRemotelyHeld: function(call) { + console.log("onRemotelyHeld: "); console.log(call); + }, + onActivated: function(call) { + console.log("onActivated: "); console.log(call); + }, + onInitializing: function(call) { + console.log("onInitializing: "); console.log(call); + }, + onInitialized: function(call) { + console.log("onInitialized: "); console.log(call); + }, + onCapabilitiesChanged: function(call) { + console.log("onCapabilitiesChanged: "); console.log(call); + }, + onParticipantsChanged: function (call, addedP, removedP) { + console.log("onParticipantsChanged: " + call + " " + addedP + " " + removedP); + }, + onStreamsChanged: function(call, addedS, removedS){ + console.log("onStreamsChanged: " + call + " " + addedP + " " + removedP); + }, + onCallSplit: function(confCall, splitCall) { + console.log("onCallSplit: " + confCall + " " + splitCall); + }, + onRecordingStarted: function (call) { + console.log("onRecordingStarted: "); console.log(call); + }, + onRecordingStopped: function(call) { + console.log("onRecordingStopped: "); console.log(call); + }, + onCallChanged: function(call) { + console.log("onCallChanged: "); console.log(call); + }, + onError: function(call){ + console.log("onError: "); console.log(call); + } }; tizen.call.addCallHandler(handler); @@ -107,8 +107,7 @@ document.body.onload = function() { while (content.hasChildNodes()) content.removeChild(content.lastChild); for (i in list) { - content.appendChild(createAppEntry(i)); + content.appendChild(createAppEntry(i)); } }); } - diff --git a/index.html b/index.html index c2fade9..9b699cc 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ .appIcon { display: block; -} +} diff --git a/main.c b/main.c index 2a0685b..7e7f1d7 100644 --- a/main.c +++ b/main.c @@ -47,9 +47,9 @@ struct pollfd pollfds[100]; int count_pollfds = 0; void handle_command(json_t *o); -static int callback_http(struct libwebsocket_context *context, +static int callback_http(struct libwebsocket_context *context, struct libwebsocket *wsi, - enum libwebsocket_callback_reasons reason, void *user, + enum libwebsocket_callback_reasons reason, void *user, void *in, size_t len); void send_app_list(struct libwebsocket *socket); static int callback_app_list(struct libwebsocket_context *context, @@ -95,10 +95,10 @@ static struct libwebsocket_protocols protocols[] = { /* libwebsocket callback for handling normal http request. We use this */ /* to implementa a rudamentary webserver. */ -static int -callback_http(struct libwebsocket_context *context, +static int +callback_http(struct libwebsocket_context *context, struct libwebsocket *wsi, - enum libwebsocket_callback_reasons reason, void *user, + enum libwebsocket_callback_reasons reason, void *user, void *in, size_t len) { char client_name[128]; @@ -210,15 +210,15 @@ callback_dialer(struct libwebsocket_context *context, switch (reason) { case LWS_CALLBACK_BROADCAST: - /* + /* * This is triggered on all open websocket connections - * when libwebsocket_broadcast is called. For this + * when libwebsocket_broadcast is called. For this * protocol we ignore the 'in' paramter and send out * the pending event queue */ if (in) { - unsigned char *b = malloc(LWS_SEND_BUFFER_PRE_PADDING + - strlen((char *)in) + + unsigned char *b = malloc(LWS_SEND_BUFFER_PRE_PADDING + + strlen((char *)in) + LWS_SEND_BUFFER_POST_PADDING); unsigned char *p = b + LWS_SEND_BUFFER_PRE_PADDING; int n = sprintf((char *)p, "%s", (char *)in); @@ -238,8 +238,8 @@ callback_dialer(struct libwebsocket_context *context, json_object_set(o, "id", json_string(voicecallmanager_path)); char *dump = json_dumps(o, 0); - unsigned char *b = malloc(LWS_SEND_BUFFER_PRE_PADDING + - strlen(dump) + + unsigned char *b = malloc(LWS_SEND_BUFFER_PRE_PADDING + + strlen(dump) + LWS_SEND_BUFFER_POST_PADDING); unsigned char *p = b + LWS_SEND_BUFFER_PRE_PADDING; int n = sprintf((char *)p, "%s", dump); @@ -250,7 +250,7 @@ callback_dialer(struct libwebsocket_context *context, } case LWS_CALLBACK_RECEIVE: - /* + /* * The other end of the websocket is sending us text * so attempt to parse that text as a JSON object providing * either a single command object or an array of command @@ -287,8 +287,8 @@ void send_app_list(struct libwebsocket *socket) * Ignoring this will result in segfaults. */ char *dump = json_dumps(app_list, 0); - unsigned char *b = malloc(LWS_SEND_BUFFER_PRE_PADDING + - strlen(dump) + + unsigned char *b = malloc(LWS_SEND_BUFFER_PRE_PADDING + + strlen(dump) + LWS_SEND_BUFFER_POST_PADDING); unsigned char *p = b + LWS_SEND_BUFFER_PRE_PADDING; int n = sprintf((char *)p, "%s", dump); @@ -316,9 +316,9 @@ void handle_command(json_t *o) json_t *exec = json_object_get(app, "exec"); if (!exec) return; - + ecore_exe_run(json_string_value(exec), NULL); - } else if (strncmp(cmd, "makeCall", 8) == 0 && + } else if (strncmp(cmd, "makeCall", 8) == 0 && (tmp = json_object_get(o, "remotePartyId"))) { const char *remotePartyId = json_string_value(tmp); const char *hideCallerId = ""; @@ -330,10 +330,10 @@ void handle_command(json_t *o) "org.ofono.VoiceCallManager", "Dial" ); - dbus_message_append_args(msg, - DBUS_TYPE_STRING, &remotePartyId, + dbus_message_append_args(msg, + DBUS_TYPE_STRING, &remotePartyId, DBUS_TYPE_INVALID); - dbus_message_append_args(msg, + dbus_message_append_args(msg, DBUS_TYPE_STRING, &hideCallerId, DBUS_TYPE_INVALID); e_dbus_message_send(bus, msg, dial_reply, -1, NULL); @@ -364,9 +364,9 @@ callback_app_list(struct libwebsocket_context *context, switch (reason) { case LWS_CALLBACK_BROADCAST: - /* + /* * This is triggered on all open websocket connections - * when libwebsocket_broadcast is called. For this + * when libwebsocket_broadcast is called. For this * protocol we only do one possible thing on broadcast * so just ignore the incoming 'in' string and just * send a new list of applications. @@ -376,7 +376,7 @@ callback_app_list(struct libwebsocket_context *context, break; case LWS_CALLBACK_RECEIVE: - /* + /* * The other end of the websocket is sending us text * so attempt to parse that text as a JSON object providing * either a single command object or an array of command @@ -528,7 +528,7 @@ void modem_properties_changed_cb(void *data, DBusMessage *msg) json_object_set(object, "id", json_string(dbus_message_get_path(msg))); dump = json_dumps(object, 0); libwebsockets_broadcast(&protocols[PROTOCOL_DIALER], dump, strlen(dump)); - free(dump); + free(dump); } dbus_message_iter_next(&values); } @@ -559,7 +559,7 @@ void call_added_cb(void *data, DBusMessage *msg) dbus_message_iter_next(&entry); dbus_message_iter_recurse(&entry, &value); - + dbus_message_iter_get_basic(&value, &v); json_object_set(object, key, json_string(v)); @@ -567,12 +567,12 @@ void call_added_cb(void *data, DBusMessage *msg) dbus_message_iter_next(&properties); } - e_dbus_signal_handler_add(bus, - "org.ofono", + e_dbus_signal_handler_add(bus, + "org.ofono", path, - "org.ofono.VoiceCall", - "PropertyChanged", - call_properties_changed_cb, + "org.ofono.VoiceCall", + "PropertyChanged", + call_properties_changed_cb, NULL); char *dump = json_dumps(object, 0); @@ -600,7 +600,7 @@ void modem_added_cb(void *data, DBusMessage *msg) { DBusMessageIter iter; const char *path; - + dbus_message_iter_init(msg, &iter); dbus_message_iter_get_basic(&iter, &path); @@ -609,7 +609,7 @@ void modem_added_cb(void *data, DBusMessage *msg) json_object_set(object, "id", json_string(path)); char *dump = json_dumps(object, 0); libwebsockets_broadcast(&protocols[PROTOCOL_DIALER], dump, strlen(dump)); - free(dump); + free(dump); } void modem_removed_cb(void *data, DBusMessage *msg) @@ -644,7 +644,7 @@ get_modems_reply(void *data, DBusMessage *reply, DBusError *error) } dbus_message_iter_recurse(&iter, &entry); - + while (dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRUCT) { const char *path; DBusMessageIter item, properties; @@ -653,15 +653,15 @@ get_modems_reply(void *data, DBusMessage *reply, DBusError *error) dbus_message_iter_get_basic(&item, &path); printf("registering %s\n", path); - e_dbus_signal_handler_add(bus, "org.ofono", - path, "org.ofono.Modem", "PropertyChanged", + e_dbus_signal_handler_add(bus, "org.ofono", + path, "org.ofono.Modem", "PropertyChanged", modem_properties_changed_cb, (void *)strdup(path)); - e_dbus_signal_handler_add(bus, "org.ofono", + e_dbus_signal_handler_add(bus, "org.ofono", path, "org.ofono.VoiceCallManager", "CallAdded", call_added_cb, NULL); - e_dbus_signal_handler_add(bus, "org.ofono", - path, "org.ofono.VoiceCallManager", - "CallRemoved", + e_dbus_signal_handler_add(bus, "org.ofono", + path, "org.ofono.VoiceCallManager", + "CallRemoved", call_removed_cb, NULL); dbus_message_iter_next(&item); @@ -676,15 +676,15 @@ get_modems_reply(void *data, DBusMessage *reply, DBusError *error) dbus_message_iter_next(&entry); dbus_message_iter_recurse(&entry, &value); - + if (!strcasecmp(key, "Interfaces")) { dbus_message_iter_recurse(&value, &interfaces); - while (dbus_message_iter_get_arg_type(&interfaces) == + while (dbus_message_iter_get_arg_type(&interfaces) == DBUS_TYPE_STRING) { const char *iface; - + dbus_message_iter_get_basic(&interfaces, &iface); - + if (!strcasecmp(iface, "org.ofono.VoiceCallManager")) { if (voicecallmanager_path) free(voicecallmanager_path); @@ -797,9 +797,9 @@ int main(int argc, char **argv) } ecore_idler_add(poll_descriptors, NULL); - + ecore_main_loop_begin(); - + /* cleanup */ libwebsocket_context_destroy(context); ecore_shutdown(); -- 2.7.4