* [PATCH v0 0/4] Add Serial and Type property to dundee
@ 2012-06-05 13:48 Daniel Wagner
2012-06-05 13:48 ` [PATCH v0 1/4] dundee: Fix signal name Daniel Wagner
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Daniel Wagner @ 2012-06-05 13:48 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1018 bytes --]
From: Daniel Wagner <daniel.wagner@bmw-carit.de>
Hi,
The first patch is fixes an obvious typo in the introspection.
The next three patches punch a whole through the DUN device
abstraction. If a Bluetooth device supports PAN and DUN at the same
time, there is no real good reason to offer both services to
user. ConnMan needs to figure out if a device supports both profile
(and then picking PAN). For this we need to provide an device
identifier. This API estension is modeled after the modem API, where
we have to do the same thing for HFP.
cheers,
daniel
Daniel Wagner (4):
dundee: Fix signal name
dundee: Add Serial and Type documantation
dundee: Add Serial property
dundee: Add Type property
doc/dundee-api.txt | 12 ++++++++++++
dundee/bluetooth.c | 11 +++++++++++
dundee/device.c | 27 +++++++++++++++++++++++++++
dundee/dundee.h | 9 +++++++++
dundee/manager.c | 2 +-
5 files changed, 60 insertions(+), 1 deletion(-)
--
1.7.10.130.g36e6c
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v0 1/4] dundee: Fix signal name
2012-06-05 13:48 [PATCH v0 0/4] Add Serial and Type property to dundee Daniel Wagner
@ 2012-06-05 13:48 ` Daniel Wagner
2012-06-05 13:48 ` [PATCH v0 2/4] dundee: Add Serial and Type documantation Daniel Wagner
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Daniel Wagner @ 2012-06-05 13:48 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 622 bytes --]
From: Daniel Wagner <daniel.wagner@bmw-carit.de>
---
dundee/manager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dundee/manager.c b/dundee/manager.c
index d7374d6..e8a37bf 100644
--- a/dundee/manager.c
+++ b/dundee/manager.c
@@ -90,7 +90,7 @@ static const GDBusMethodTable manager_methods[] = {
};
static const GDBusSignalTable manager_signals[] = {
- { GDBUS_SIGNAL("DevicesAdded",
+ { GDBUS_SIGNAL("DeviceAdded",
GDBUS_ARGS({ "path", "o"},{ "properties", "a{sv}" })) },
{ GDBUS_SIGNAL("DeviceRemoved",
GDBUS_ARGS({ "path", "o"})) },
--
1.7.10.130.g36e6c
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v0 2/4] dundee: Add Serial and Type documantation
2012-06-05 13:48 [PATCH v0 0/4] Add Serial and Type property to dundee Daniel Wagner
2012-06-05 13:48 ` [PATCH v0 1/4] dundee: Fix signal name Daniel Wagner
@ 2012-06-05 13:48 ` Daniel Wagner
2012-06-05 13:51 ` Daniel Wagner
2012-06-05 13:48 ` [PATCH v0 3/4] dundee: Add Serial property Daniel Wagner
` (2 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Daniel Wagner @ 2012-06-05 13:48 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
From: Daniel Wagner <daniel.wagner@bmw-carit.de>
---
doc/dundee-api.txt | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/doc/dundee-api.txt b/doc/dundee-api.txt
index 9f4cfe6..8c79124 100644
--- a/doc/dundee-api.txt
+++ b/doc/dundee-api.txt
@@ -74,3 +74,15 @@ Properties string Name [readonly]
Holds the list of domain name servers for this
connection.
+
+ string Serial [readonly, optional]
+
+ String represeting the serial number of the modem
+ device.
+
+ string Type [readonly]
+
+ Indicates whether the device is a Bluetooth or
+ USB based one.
+
+ Possible values are "blueooth" or "usb".
--
1.7.10.130.g36e6c
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v0 3/4] dundee: Add Serial property
2012-06-05 13:48 [PATCH v0 0/4] Add Serial and Type property to dundee Daniel Wagner
2012-06-05 13:48 ` [PATCH v0 1/4] dundee: Fix signal name Daniel Wagner
2012-06-05 13:48 ` [PATCH v0 2/4] dundee: Add Serial and Type documantation Daniel Wagner
@ 2012-06-05 13:48 ` Daniel Wagner
2012-06-05 13:48 ` [PATCH v0 4/4] dundee: Add Type property Daniel Wagner
2012-06-05 13:49 ` [PATCH v0 0/4] Add Serial and Type property to dundee Daniel Wagner
4 siblings, 0 replies; 7+ messages in thread
From: Daniel Wagner @ 2012-06-05 13:48 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2287 bytes --]
From: Daniel Wagner <daniel.wagner@bmw-carit.de>
---
dundee/bluetooth.c | 10 ++++++++++
dundee/device.c | 10 ++++++++++
dundee/dundee.h | 3 +++
3 files changed, 23 insertions(+)
diff --git a/dundee/bluetooth.c b/dundee/bluetooth.c
index e2e2bca..0fb00a4 100644
--- a/dundee/bluetooth.c
+++ b/dundee/bluetooth.c
@@ -126,10 +126,20 @@ static void bt_connect(struct dundee_device *device,
CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
}
+static const char *bt_serial(struct dundee_device *device)
+{
+ struct bluetooth_device *bt = dundee_device_get_data(device);
+
+ DBG("%p", bt);
+
+ return bt->address;
+}
+
struct dundee_device_driver bluetooth_driver = {
.name = "bluetooth",
.connect = bt_connect,
.disconnect = bt_disconnect,
+ .serial = bt_serial,
};
static int bt_probe(const char *path, const char *dev_addr,
diff --git a/dundee/device.c b/dundee/device.c
index 709919a..9733b09 100644
--- a/dundee/device.c
+++ b/dundee/device.c
@@ -129,6 +129,8 @@ static void settings_append_dict(struct dundee_device *device,
void __dundee_device_append_properties(struct dundee_device *device,
DBusMessageIter *dict)
{
+ const char *serial;
+
settings_append_dict(device, dict);
ofono_dbus_dict_append(dict, "Name", DBUS_TYPE_STRING,
@@ -136,6 +138,14 @@ void __dundee_device_append_properties(struct dundee_device *device,
ofono_dbus_dict_append(dict, "Active", DBUS_TYPE_BOOLEAN,
&device->active);
+
+ if (device->driver == NULL)
+ return;
+
+ serial = device->driver->serial(device);
+ if (serial)
+ ofono_dbus_dict_append(dict, "Serial", DBUS_TYPE_STRING,
+ &serial);
}
void __dundee_device_foreach(dundee_device_foreach_func func, void *userdata)
diff --git a/dundee/dundee.h b/dundee/dundee.h
index 8866007..ca53c88 100644
--- a/dundee/dundee.h
+++ b/dundee/dundee.h
@@ -121,6 +121,9 @@ struct dundee_device_driver {
/* Hangup and disconnect */
void (*disconnect)(struct dundee_device *device,
dundee_device_disconnect_cb_t cb, void *data);
+
+ /* Get device information */
+ const char *(*serial)(struct dundee_device *device);
};
struct dundee_device *dundee_device_create(struct dundee_device_driver *d);
--
1.7.10.130.g36e6c
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v0 4/4] dundee: Add Type property
2012-06-05 13:48 [PATCH v0 0/4] Add Serial and Type property to dundee Daniel Wagner
` (2 preceding siblings ...)
2012-06-05 13:48 ` [PATCH v0 3/4] dundee: Add Serial property Daniel Wagner
@ 2012-06-05 13:48 ` Daniel Wagner
2012-06-05 13:49 ` [PATCH v0 0/4] Add Serial and Type property to dundee Daniel Wagner
4 siblings, 0 replies; 7+ messages in thread
From: Daniel Wagner @ 2012-06-05 13:48 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2442 bytes --]
From: Daniel Wagner <daniel.wagner@bmw-carit.de>
---
dundee/bluetooth.c | 1 +
dundee/device.c | 17 +++++++++++++++++
dundee/dundee.h | 6 ++++++
3 files changed, 24 insertions(+)
diff --git a/dundee/bluetooth.c b/dundee/bluetooth.c
index 0fb00a4..c124f60 100644
--- a/dundee/bluetooth.c
+++ b/dundee/bluetooth.c
@@ -137,6 +137,7 @@ static const char *bt_serial(struct dundee_device *device)
struct dundee_device_driver bluetooth_driver = {
.name = "bluetooth",
+ .type = DUNDEE_DEVICE_TYPE_BLUETOOTH,
.connect = bt_connect,
.disconnect = bt_disconnect,
.serial = bt_serial,
diff --git a/dundee/device.c b/dundee/device.c
index 9733b09..fa549e1 100644
--- a/dundee/device.c
+++ b/dundee/device.c
@@ -62,6 +62,18 @@ struct dundee_device {
void *data;
};
+static const char *device_type_to_string(enum dundee_device_type type)
+{
+ switch (type) {
+ case DUNDEE_DEVICE_TYPE_BLUETOOTH:
+ return "bluetooth";
+ case DUNDEE_DEVICE_TYPE_USB:
+ return "usb";
+ }
+
+ return "unknown";
+}
+
const char *__dundee_device_get_path(struct dundee_device *device)
{
return device->path;
@@ -130,6 +142,7 @@ void __dundee_device_append_properties(struct dundee_device *device,
DBusMessageIter *dict)
{
const char *serial;
+ const char *type;
settings_append_dict(device, dict);
@@ -146,6 +159,10 @@ void __dundee_device_append_properties(struct dundee_device *device,
if (serial)
ofono_dbus_dict_append(dict, "Serial", DBUS_TYPE_STRING,
&serial);
+
+ type = device_type_to_string(device->driver->type);
+ ofono_dbus_dict_append(dict, "Type", DBUS_TYPE_STRING,
+ &type);
}
void __dundee_device_foreach(dundee_device_foreach_func func, void *userdata)
diff --git a/dundee/dundee.h b/dundee/dundee.h
index ca53c88..b954a91 100644
--- a/dundee/dundee.h
+++ b/dundee/dundee.h
@@ -33,6 +33,11 @@ enum dundee_error_type {
DUNDEE_ERROR_TYPE_FAILURE,
};
+enum dundee_device_type {
+ DUNDEE_DEVICE_TYPE_BLUETOOTH = 0,
+ DUNDEE_DEVICE_TYPE_USB,
+};
+
struct dundee_error {
enum dundee_error_type type;
int error;
@@ -113,6 +118,7 @@ typedef void (*dundee_device_disconnect_cb_t)(const struct dundee_error *error,
struct dundee_device_driver {
const char *name;
+ enum dundee_device_type type;
/* Connect and dial */
void (*connect)(struct dundee_device *device,
--
1.7.10.130.g36e6c
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v0 0/4] Add Serial and Type property to dundee
2012-06-05 13:48 [PATCH v0 0/4] Add Serial and Type property to dundee Daniel Wagner
` (3 preceding siblings ...)
2012-06-05 13:48 ` [PATCH v0 4/4] dundee: Add Type property Daniel Wagner
@ 2012-06-05 13:49 ` Daniel Wagner
4 siblings, 0 replies; 7+ messages in thread
From: Daniel Wagner @ 2012-06-05 13:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 79 bytes --]
> The next three patches punch a whole through the DUN device
s/whole/hole
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v0 2/4] dundee: Add Serial and Type documantation
2012-06-05 13:48 ` [PATCH v0 2/4] dundee: Add Serial and Type documantation Daniel Wagner
@ 2012-06-05 13:51 ` Daniel Wagner
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Wagner @ 2012-06-05 13:51 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 97 bytes --]
> + Possible values are "blueooth" or "usb".
s/blueooth/bluetooth/
(fixed in my repo)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-06-05 13:51 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-05 13:48 [PATCH v0 0/4] Add Serial and Type property to dundee Daniel Wagner
2012-06-05 13:48 ` [PATCH v0 1/4] dundee: Fix signal name Daniel Wagner
2012-06-05 13:48 ` [PATCH v0 2/4] dundee: Add Serial and Type documantation Daniel Wagner
2012-06-05 13:51 ` Daniel Wagner
2012-06-05 13:48 ` [PATCH v0 3/4] dundee: Add Serial property Daniel Wagner
2012-06-05 13:48 ` [PATCH v0 4/4] dundee: Add Type property Daniel Wagner
2012-06-05 13:49 ` [PATCH v0 0/4] Add Serial and Type property to dundee Daniel Wagner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.