aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunil Kumar Behera <sunil.behera@samsung.com>2012-09-13 19:12:25 +0530
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2012-09-14 12:54:35 +0300
commit0c2cf119d1923a761bc5ed1fc9255b93b52abdaa (patch)
tree295cfab874c2bae27ab4b92dd65b6330252b0fe5
parent9434ebf18630e9b38dcf1c0f0b5431ec58d2f1d6 (diff)
downloadobexd-0c2cf119d1923a761bc5ed1fc9255b93b52abdaa.tar.gz
MAP: Add support for MessageStatus
Add driver to support x-bt/messageStatus mimetype
-rw-r--r--plugins/mas.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/plugins/mas.c b/plugins/mas.c
index 1c9199d..63d188c 100644
--- a/plugins/mas.c
+++ b/plugins/mas.c
@@ -649,6 +649,37 @@ static void *message_update_open(const char *name, int oflag, mode_t mode,
return mas;
}
+static void *message_set_status_open(const char *name, int oflag, mode_t mode,
+ void *driver_data, size_t *size,
+ int *err)
+
+{
+ struct mas_session *mas = driver_data;
+ uint8_t indicator;
+ uint8_t value;
+
+ DBG("");
+
+ if (oflag == O_RDONLY) {
+ *err = -EBADR;
+ return NULL;
+ }
+
+ if (!g_obex_apparam_get_uint8(mas->inparams, MAP_AP_STATUSINDICATOR,
+ &indicator)) {
+ *err = -EBADR;
+ return NULL;
+ }
+
+ if (!g_obex_apparam_get_uint8(mas->inparams, MAP_AP_STATUSVALUE,
+ &value)) {
+ *err = -EBADR;
+ return NULL;
+ }
+
+ return mas;
+}
+
static ssize_t any_get_next_header(void *object, void *buf, size_t mtu,
uint8_t *hi)
{
@@ -784,7 +815,7 @@ static struct obex_mime_type_driver mime_message_status = {
.target = MAS_TARGET,
.target_size = TARGET_SIZE,
.mimetype = "x-bt/messageStatus",
- .open = any_open,
+ .open = message_set_status_open,
.close = any_close,
.read = any_read,
.write = any_write,