[PATCH] Add WSP_VALUE_TYPE_TEXT support in wsp_decode_application_id()
by Jens Rehsack
From: Jens Rehsack <sno(a)NetBSD.org>
---
src/wsputil.c | 24 ++++++++++++++++++++----
1 Datei geändert, 20 Zeilen hinzugefügt(+), 4 Zeilen entfernt(-)
diff --git a/src/wsputil.c b/src/wsputil.c
index 1b2b2b7..ece58e6 100644
--- a/src/wsputil.c
+++ b/src/wsputil.c
@@ -490,13 +490,26 @@ gboolean wsp_decode_application_id(struct wsp_header_iter *iter,
unsigned int val_len;
unsigned int i;
+ switch (wsp_header_iter_get_val_type(iter)) {
+ case WSP_VALUE_TYPE_TEXT:
+ if (out_value)
+ *out_value = pdu_val;
+
+ break;
+
/*
* Well-known field values MUST be encoded using the
* compact binary formats
*/
- if (wsp_header_iter_get_val_type(iter) == WSP_VALUE_TYPE_SHORT) {
+ case WSP_VALUE_TYPE_SHORT:
val = *pdu_val & 0x7f;
- } else {
+
+ if (out_value)
+ *out_value = get_text_entry(val, app_id);
+
+ break;
+
+ case WSP_VALUE_TYPE_LONG:
val_len = wsp_header_iter_get_val_len(iter);
if (val_len > 2)
@@ -504,10 +517,13 @@ gboolean wsp_decode_application_id(struct wsp_header_iter *iter,
for (i = 0, val = 0; i < val_len && i < sizeof(val); i++)
val = (val << 8) | pdu_val[i];
+
+ if (out_value)
+ *out_value = get_text_entry(val, app_id);
+
+ break;
}
- if (out_value)
- *out_value = get_text_entry(val, app_id);
return TRUE;
}
--
1.7.10.1
9 years, 11 months
[PATCH] Add WSP_VALUE_TYPE_TEXT support in wsp_decode_application_id()
by Jens Rehsack
From: Jens Rehsack <sno(a)NetBSD.org>
---
src/wsputil.c | 43 ++++++++++++++++++++++++++-----------------
1 Datei geändert, 26 Zeilen hinzugefügt(+), 17 Zeilen entfernt(-)
diff --git a/src/wsputil.c b/src/wsputil.c
index 1b2b2b7..5611ed2 100644
--- a/src/wsputil.c
+++ b/src/wsputil.c
@@ -486,28 +486,37 @@ gboolean wsp_decode_application_id(struct wsp_header_iter *iter,
const void **out_value)
{
const unsigned char *pdu_val = wsp_header_iter_get_val(iter);
- unsigned int val;
- unsigned int val_len;
- unsigned int i;
- /*
- * Well-known field values MUST be encoded using the
- * compact binary formats
- */
- if (wsp_header_iter_get_val_type(iter) == WSP_VALUE_TYPE_SHORT) {
- val = *pdu_val & 0x7f;
+ if (wsp_header_iter_get_val_type(iter) == WSP_VALUE_TYPE_TEXT) {
+ wsp_header_iter_get_val_len(iter);
+
+ if (out_value)
+ *out_value = pdu_val;
} else {
- val_len = wsp_header_iter_get_val_len(iter);
+ unsigned int val;
- if (val_len > 2)
- return FALSE;
+ /*
+ * Well-known field values MUST be encoded using the
+ * compact binary formats
+ */
+ if (wsp_header_iter_get_val_type(iter) == WSP_VALUE_TYPE_SHORT) {
+ val = *pdu_val & 0x7f;
+ } else {
+ unsigned int val_len;
+ unsigned int i;
- for (i = 0, val = 0; i < val_len && i < sizeof(val); i++)
- val = (val << 8) | pdu_val[i];
- }
+ val_len = wsp_header_iter_get_val_len(iter);
- if (out_value)
- *out_value = get_text_entry(val, app_id);
+ if (val_len > 2)
+ return FALSE;
+
+ for (i = 0, val = 0; i < val_len && i < sizeof(val); i++)
+ val = (val << 8) | pdu_val[i];
+ }
+
+ if (out_value)
+ *out_value = get_text_entry(val, app_id);
+ }
return TRUE;
}
--
1.7.10.1
9 years, 11 months
[PATCH 1/4] n900: Use consistent naming in GPIO API
by Aki Niemi
In addition, add header guards as the API can be used from more than
one plugin.
---
plugins/n900.c | 12 +++---
plugins/nokia-gpio.c | 106 ++++++++++++++++++++++----------------------------
plugins/nokia-gpio.h | 37 +++++++++++++++--
3 files changed, 85 insertions(+), 70 deletions(-)
diff --git a/plugins/n900.c b/plugins/n900.c
index 44e2e75..420fd0c 100644
--- a/plugins/n900.c
+++ b/plugins/n900.c
@@ -308,7 +308,7 @@ static void n900_power_cb(enum power_state state, void *data)
struct ofono_modem *modem = data;
struct isi_data *isi = ofono_modem_get_data(modem);
- DBG("power state %s", gpio_power_state_name(state));
+ DBG("power state %s", nokia_gpio_power_state_name(state));
isi->power_state = state;
@@ -358,7 +358,7 @@ static int n900_probe(struct ofono_modem *modem)
if (getenv("OFONO_ISI_TRACE"))
g_isi_modem_set_trace(isimodem, isi_trace);
- if (gpio_probe(isimodem, address, n900_power_cb, modem) != 0) {
+ if (nokia_gpio_probe(isimodem, address, n900_power_cb, modem) != 0) {
DBG("gpio for %s: %s", ifname, strerror(errno));
goto error;
}
@@ -382,7 +382,7 @@ static int n900_probe(struct ofono_modem *modem)
error:
g_isi_modem_destroy(isimodem);
- gpio_remove(modem);
+ nokia_gpio_remove(modem);
g_free(isi);
return -errno;
@@ -397,7 +397,7 @@ static void n900_remove(struct ofono_modem *modem)
if (!isi)
return;
- gpio_remove(modem);
+ nokia_gpio_remove(modem);
if (isi->timeout)
g_source_remove(isi->timeout);
@@ -523,7 +523,7 @@ static int n900_enable(struct ofono_modem *modem)
isi->enabled = TRUE;
- return gpio_enable(modem);
+ return nokia_gpio_enable(modem);
}
static int n900_disable(struct ofono_modem *modem)
@@ -534,7 +534,7 @@ static int n900_disable(struct ofono_modem *modem)
isi->enabled = FALSE;
- return gpio_disable(modem);
+ return nokia_gpio_disable(modem);
}
static struct ofono_modem_driver n900_driver = {
diff --git a/plugins/nokia-gpio.c b/plugins/nokia-gpio.c
index 57aad8d..d9e05f3 100644
--- a/plugins/nokia-gpio.c
+++ b/plugins/nokia-gpio.c
@@ -60,18 +60,6 @@ enum phonet_link {
PHONET_LINK_UP,
};
-enum power_event {
- POWER_EVENT_PHONET_LINK_UP = 1,
- POWER_EVENT_PHONET_LINK_DOWN,
- POWER_EVENT_ON,
- POWER_EVENT_ON_TIMEOUT,
- POWER_EVENT_REBOOT_TIMEOUT,
- POWER_EVENT_OFF,
- POWER_EVENT_OFF_IMMEDIATELY,
- POWER_EVENT_OFF_TIMEOUT,
- POWER_EVENT_OFF_COMPLETE,
-};
-
struct gpio_data {
GIsiPhonetNetlink *link;
gpio_finished_cb_t callback;
@@ -98,41 +86,6 @@ struct gpio_data {
static struct gpio_data self;
-#define _(X) case X: return #X
-
-static inline char const *gpio_power_event_name(enum power_event value)
-{
- switch (value) {
- _(POWER_EVENT_PHONET_LINK_UP);
- _(POWER_EVENT_PHONET_LINK_DOWN);
- _(POWER_EVENT_ON);
- _(POWER_EVENT_ON_TIMEOUT);
- _(POWER_EVENT_REBOOT_TIMEOUT);
- _(POWER_EVENT_OFF);
- _(POWER_EVENT_OFF_IMMEDIATELY);
- _(POWER_EVENT_OFF_TIMEOUT);
- _(POWER_EVENT_OFF_COMPLETE);
- }
- return "<UNKNOWN>";
-}
-
-char const *gpio_power_state_name(enum power_state value)
-{
- switch (value) {
- _(POWER_STATE_NONE);
- _(POWER_STATE_ON_STARTED);
- _(POWER_STATE_ON);
- _(POWER_STATE_ON_RESET);
- _(POWER_STATE_ON_FAILED);
- _(POWER_STATE_OFF_STARTED);
- _(POWER_STATE_OFF_WAITING);
- _(POWER_STATE_OFF);
- }
- return "<UNKNOWN>";
-}
-
-#undef _
-
static void gpio_power_state_machine(enum power_event event);
static void gpio_power_set_state(enum power_state new_state);
@@ -324,14 +277,13 @@ static gboolean gpio_power_timer_cb(gpointer user)
return FALSE;
}
-
static void gpio_power_state_machine(enum power_event event)
{
enum power_state new_state;
DBG("(%s) @ state %s",
- gpio_power_event_name(event),
- gpio_power_state_name(self.state));
+ nokia_gpio_power_event_name(event),
+ nokia_gpio_power_state_name(self.state));
switch (event) {
case POWER_EVENT_ON:
@@ -491,10 +443,10 @@ static void gpio_power_state_machine(enum power_event event)
return;
}
- DBG("Event %s (%d) not handled", gpio_power_event_name(event), event);
+ DBG("Event %s (%d) not handled", nokia_gpio_power_event_name(event),
+ event);
}
-
static void gpio_power_set_state(enum power_state new_state)
{
enum power_state old_state = self.state;
@@ -502,8 +454,8 @@ static void gpio_power_set_state(enum power_state new_state)
enum power_event timer_event;
DBG("(%s) at (%s)%s",
- gpio_power_state_name(new_state),
- gpio_power_state_name(old_state),
+ nokia_gpio_power_state_name(new_state),
+ nokia_gpio_power_state_name(old_state),
new_state == old_state ? " - already" : "");
switch (old_state) {
@@ -707,8 +659,8 @@ static int gpio_probe_links(void)
return -(errno = ENODEV);
}
-
-int gpio_probe(GIsiModem *idx, unsigned addr, gpio_finished_cb_t cb, void *data)
+int nokia_gpio_probe(GIsiModem *idx, unsigned addr, gpio_finished_cb_t cb,
+ void *data)
{
int error;
@@ -774,7 +726,7 @@ int gpio_probe(GIsiModem *idx, unsigned addr, gpio_finished_cb_t cb, void *data)
return 0;
}
-int gpio_remove(void *data)
+int nokia_gpio_remove(void *data)
{
if (self.data != data)
return -EINVAL;
@@ -792,7 +744,7 @@ int gpio_remove(void *data)
return 0;
}
-int gpio_enable(void *data)
+int nokia_gpio_enable(void *data)
{
if (self.data != data)
return -EINVAL;
@@ -805,7 +757,7 @@ int gpio_enable(void *data)
return -EINPROGRESS;
}
-int gpio_disable(void *data)
+int nokia_gpio_disable(void *data)
{
if (self.data != data)
return -EINVAL;
@@ -818,3 +770,39 @@ int gpio_disable(void *data)
return -EINPROGRESS;
}
+
+
+#define _(X) case X: return #X
+
+const char *nokia_gpio_power_event_name(enum power_event value)
+{
+ switch (value) {
+ _(POWER_EVENT_PHONET_LINK_UP);
+ _(POWER_EVENT_PHONET_LINK_DOWN);
+ _(POWER_EVENT_ON);
+ _(POWER_EVENT_ON_TIMEOUT);
+ _(POWER_EVENT_REBOOT_TIMEOUT);
+ _(POWER_EVENT_OFF);
+ _(POWER_EVENT_OFF_IMMEDIATELY);
+ _(POWER_EVENT_OFF_TIMEOUT);
+ _(POWER_EVENT_OFF_COMPLETE);
+ }
+ return "<UNKNOWN>";
+}
+
+const char *nokia_gpio_power_state_name(enum power_state value)
+{
+ switch (value) {
+ _(POWER_STATE_NONE);
+ _(POWER_STATE_ON_STARTED);
+ _(POWER_STATE_ON);
+ _(POWER_STATE_ON_RESET);
+ _(POWER_STATE_ON_FAILED);
+ _(POWER_STATE_OFF_STARTED);
+ _(POWER_STATE_OFF_WAITING);
+ _(POWER_STATE_OFF);
+ }
+ return "<UNKNOWN>";
+}
+
+#undef _
diff --git a/plugins/nokia-gpio.h b/plugins/nokia-gpio.h
index b653bb8..991c10a 100644
--- a/plugins/nokia-gpio.h
+++ b/plugins/nokia-gpio.h
@@ -19,6 +19,13 @@
*
*/
+#ifndef __NOKIA_GPIO_H
+#define __NOKIA_GPIO_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum power_state {
POWER_STATE_NONE,
POWER_STATE_ON_STARTED,
@@ -30,11 +37,31 @@ enum power_state {
POWER_STATE_OFF,
};
+enum power_event {
+ POWER_EVENT_PHONET_LINK_UP = 1,
+ POWER_EVENT_PHONET_LINK_DOWN,
+ POWER_EVENT_ON,
+ POWER_EVENT_ON_TIMEOUT,
+ POWER_EVENT_REBOOT_TIMEOUT,
+ POWER_EVENT_OFF,
+ POWER_EVENT_OFF_IMMEDIATELY,
+ POWER_EVENT_OFF_TIMEOUT,
+ POWER_EVENT_OFF_COMPLETE,
+};
+
typedef void (*gpio_finished_cb_t)(enum power_state value, void *opaque);
-int gpio_probe(GIsiModem *idx, unsigned addr, gpio_finished_cb_t cb, void *data);
-int gpio_enable(void *opaque);
-int gpio_disable(void *opaque);
-int gpio_remove(void *opaque);
+int nokia_gpio_probe(GIsiModem *idx, unsigned addr, gpio_finished_cb_t cb,
+ void *data);
+int nokia_gpio_enable(void *opaque);
+int nokia_gpio_disable(void *opaque);
+int nokia_gpio_remove(void *opaque);
+
+const char *nokia_gpio_power_event_name(enum power_event value);
+const char *nokia_gpio_power_state_name(enum power_state value);
+
+#ifdef __cplusplus
+};
+#endif
-char const *gpio_power_state_name(enum power_state value);
+#endif /* !__NOKIA_GPIO_H */
--
1.7.5.4
9 years, 11 months
[PATCH 0/6] Return specific ofono errors after SS transaction
by Philippe Nunes
As pointed by the first GCF tests, the user indication does not distinguish the type of error occured after an SS request.
Actually, the ofono error type .Failed is returned whatever is the telephony error.
In order to return more specific ofono error types, I introduced an utility function to map the telephony errors into ofono errors.
I extended also the ofono error types to match more closely with the telephony errors.
Philippe Nunes (6):
common: Fix typos in error strings
dbus: Add new error types
error-mapping: Add function to map telephony errors into ofono error
types
build: Add error-mapping utility to build
Return specific ofono errors according telephony errors
Extend the list of ofono error types returned by the method initiate
Makefile.am | 1 +
doc/supplementaryservices-api.txt | 6 +++
src/call-barring.c | 11 ++++--
src/call-forwarding.c | 6 ++-
src/call-settings.c | 18 +++++----
src/common.c | 19 ++++-----
src/dbus.c | 13 +++++++
src/error-mapping.c | 77 +++++++++++++++++++++++++++++++++++++
src/error-mapping.h | 25 ++++++++++++
src/ofono.h | 2 +
10 files changed, 155 insertions(+), 23 deletions(-)
create mode 100644 src/error-mapping.c
create mode 100644 src/error-mapping.h
--
1.7.9.5
9 years, 11 months
[PATCH] v2: support Wavecom Q2403/Q2686 modems
by pablo@gnumonks.org
From: Pablo Neira Ayuso <pablo(a)gnumonks.org>
Hi!
This is the second version of the patch to support Wavecom Q2403/Q2686
modems. I've tried to address all comments from Denis Kenzior.
I've splitted the patch in two, one per directory directory as you
suggested.
Please, let me know if you find any issue with this patch.
Thank you!
Pablo Neira Ayuso (2):
wavecom: add support for Wavecom Q2403/Q2686 modems
wavecom: add support for Wavecom Q2403/Q2686 modems
drivers/atmodem/sim.c | 3 +-
drivers/atmodem/sms.c | 27 +++++++++++++---
drivers/atmodem/vendor.h | 1 +
plugins/udev.c | 15 +++++++++
plugins/wavecom.c | 77 ++++++++++++++++++++++++++++++++++++++++++----
5 files changed, 111 insertions(+), 12 deletions(-)
--
1.7.10
9 years, 11 months
[PATCH] test: Add new script for SS GCF test cases
by Guillaume Zajac
This script uses dynamic SS codes in input and
displays answers to the different requests.
It handles all SS: call barring, call forwarding,
call waiting, CLIP, CLIR, ...
---
test/test-ss | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
create mode 100755 test/test-ss
diff --git a/test/test-ss b/test/test-ss
new file mode 100755
index 0000000..adeff33
--- /dev/null
+++ b/test/test-ss
@@ -0,0 +1,55 @@
+#!/usr/bin/python
+
+import sys
+import gobject
+
+import dbus
+import dbus.mainloop.glib
+
+if __name__ == "__main__":
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+ bus = dbus.SystemBus()
+
+ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+ modems = manager.GetModems()
+ modem = modems[0][0]
+
+ if (len(sys.argv) == 2):
+ ss_code = sys.argv[1]
+ else:
+ modem = sys.argv[1]
+ ss_code = sys.argv[2]
+
+ ss = dbus.Interface(bus.get_object('org.ofono', modem),
+ 'org.ofono.SupplementaryServices')
+
+ try:
+ ss_type, properties = ss.Initiate(ss_code, timeout=100)
+ except dbus.DBusException, e:
+ print "Unable to perform operation: ", e
+ sys.exit(1);
+
+ if (ss_type == "CallBarring"):
+ print "%s : Operation [ %s ] Service Type [ %s ]" % (ss_type, properties[0], properties[1])
+ for key in properties[2]:
+ print "%s : %s" % (key, properties[2][key])
+ sys.exit(1);
+ elif (ss_type == "CallForwarding"):
+ print "%s : Operation [ %s ] Service Type [ %s ]" % (ss_type, properties[0], properties[1])
+ for key in properties[2]:
+ print "%s : %s" % (key, properties[2][key])
+ sys.exit(1);
+ elif (ss_type == "CallWaiting"):
+ print "%s : Operation [ %s ]" % (ss_type, properties[0])
+ for key in properties[1]:
+ print "%s : %s" % (key, properties[1][key])
+ sys.exit(1);
+ else:
+ print "%s : Operation [ %s ] Status [ %s ]" % (ss_type, properties[0], properties[1])
+ sys.exit(1);
+
+ mainloop = gobject.MainLoop()
+ mainloop.run()
--
1.7.5.4
9 years, 11 months
[PATCH v7 00/16] Add DUN support
by Daniel Wagner
From: Daniel Wagner <daniel.wagner(a)bmw-carit.de>
Hi,
Changes v7:
- Fixed test scripts
- SetProperty("Active", True) will be deferred until PPP link is up
or an error happens
- GDBUS changes added
- Fixed a crash in set_property_active: device->ppp can be NULL
- Copyright year update and whitespace fixes
cheers,
daniel
Daniel Wagner (16):
bluetooth: Add Serial interface definition
dundee: Add documentation
dundee: Add test scripts
dundee: Add skeleton implementation
dundee: Add D-Bus error messages
dundee: Add D-Bus configuration file
dundee: Add systemd configuration file
dundee: Add Manager interface
dundee: Add skeleton implementation for device
dundee: Manager append devices
dundee: Add callback helpers
dundee: Add device un/register
dundee: Add driver helper functions
dundee: Add device D-Bus interface
dundee: Add PPP handling code to device
dundee: Add Bluetooth DUN driver
Makefile.am | 25 ++
bootstrap-configure | 1 +
configure.ac | 7 +-
doc/dundee-api.txt | 76 ++++++
dundee/bluetooth.c | 290 ++++++++++++++++++++
dundee/dbus.c | 45 ++++
dundee/device.c | 660 ++++++++++++++++++++++++++++++++++++++++++++++
dundee/dundee.conf | 23 ++
dundee/dundee.h | 144 ++++++++++
dundee/dundee.service.in | 11 +
dundee/main.c | 256 ++++++++++++++++++
dundee/manager.c | 122 +++++++++
plugins/bluetooth.h | 1 +
test/dundee-connect | 20 ++
test/dundee-disconnect | 20 ++
test/monitor-dundee | 109 ++++++++
16 files changed, 1809 insertions(+), 1 deletion(-)
create mode 100644 doc/dundee-api.txt
create mode 100644 dundee/bluetooth.c
create mode 100644 dundee/dbus.c
create mode 100644 dundee/device.c
create mode 100644 dundee/dundee.conf
create mode 100644 dundee/dundee.h
create mode 100644 dundee/dundee.service.in
create mode 100644 dundee/main.c
create mode 100644 dundee/manager.c
create mode 100755 test/dundee-connect
create mode 100755 test/dundee-disconnect
create mode 100755 test/monitor-dundee
--
1.7.10.130.g36e6c
9 years, 12 months
[HEADS UP] vim users
by Lucas De Marchi
Hey,
As I sent previously to BlueZ mailing list, the patches for d-bus
introspection exposes a bug in vim c syntax highlight. There's already
a fix for that:
https://groups.google.com/forum/#!msg/vim_dev/_IL5jM1-t_w/D-vIwZM2RfwJ
I'm not sure when there will be a new version, so I'm attaching to
this email the fixed c.vim file. Replace
/usr/share/vim/vim73/syntax/c.vim with this one and highlight will be
fixed.
Regards,
Lucas De Marchi
9 years, 12 months
[PATCH 0/3] mmsd: new tasks definition
by Ronald Tessier
These patches concern mmsd and update TODO and documentation to describe new
functionalities to add to mmsd.
Ronald Tessier (3):
TODO: Add new tasks
doc: Describe delivered group in storage doc
doc: Add new D-Bus methods to service interface
TODO | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++
doc/service-api.txt | 20 +++++++++++++++
doc/storage.txt | 30 ++++++++++++++++++++++
3 files changed, 117 insertions(+), 0 deletions(-)
--
1.7.4.1
9 years, 12 months
[PATCH 0/3] mmsd: new tasks definition
by Ronald Tessier
These patches concern mmsd and update TODO and documentation to describe new
functionalities to add to mmsd.
Ronald Tessier (3):
TODO: Add new tasks
doc: Describe delivered group in storage doc
doc: Add new D-Bus methods to service interface
TODO | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++
doc/service-api.txt | 20 +++++++++++++++
doc/storage.txt | 30 ++++++++++++++++++++++
3 files changed, 117 insertions(+), 0 deletions(-)
--
1.7.4.1
9 years, 12 months