Revise: add manifest file for SMACK label setting. Add: ico_dbus_amb_find_property... 59/14159/1 accepted/tizen/ivi/release accepted/tizen/ivi/20131227.204858 accepted/tizen/ivi/release/20140108.220745 submit/tizen/20131226.085834 submit/tizen/20140108.022402 submit/tizen_ivi_release/20140108.030101
authorMasayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>
Wed, 25 Dec 2013 12:19:32 +0000 (21:19 +0900)
committerMasayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>
Thu, 26 Dec 2013 03:48:56 +0000 (12:48 +0900)
Change-Id: I711883cf479daf7f91e689d7755d37d54b5061f7
Signed-off-by: Masayuki Sasaki <masayuki.sasaki@mail.toyota-td.jp>
configure.ac
ico-uxf-utilities.manifest [new file with mode: 0644]
include/ico_dbus_amb_efl.h
packaging/ico-uxf-utilities.changes
packaging/ico-uxf-utilities.spec
src/ico_dbus_amb_efl.c

index 42d3710..3bb683f 100644 (file)
@@ -1,6 +1,6 @@
 AC_PREREQ([2.68])
 AC_INIT([ico-uxf-utilities],
-        [0.9.03],
+        [0.9.06],
         [https://BUG-REPORT-ADDRESS])
 
 AC_CONFIG_HEADERS([config.h])
diff --git a/ico-uxf-utilities.manifest b/ico-uxf-utilities.manifest
new file mode 100644 (file)
index 0000000..c4908cd
--- /dev/null
@@ -0,0 +1,8 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+ <assign>
+    <filesystem path="/var/log/ico" label="User"/>
+ </assign>
+</manifest>
index 89a3a8e..6d7518f 100644 (file)
@@ -22,9 +22,21 @@ union dbus_value_variant {
         char *sval;
 };
 
+typedef struct _ico_dbus_error
+{
+  const char *name;    /**< public error name field */
+  const char *message; /**< public error message field */
+} ico_dbus_error_t;
+
 typedef void (*ico_dbus_amb_getcb)(const char *objectname, const char *property, dbus_type type, union dbus_value_variant value, void *user_data);
 typedef void (*ico_dbus_amb_noticb)(const char *objectname, const char *property, dbus_type type, union dbus_value_variant value, int sequence, struct timeval tv, void *user_data);
 
+typedef void (*ico_dbus_amb_findcb)(const char *objectname,
+                                    const char *property,
+                                    dbus_type type,
+                                    void *user_data,
+                                    ico_dbus_error_t *error);
+
 int ico_dbus_amb_start(void);
 int ico_dbus_amb_end(void);
 int ico_dbus_amb_get(const char *objectname, const char *property, int zone, dbus_type type, ico_dbus_amb_getcb cb, void *user_data);
@@ -33,7 +45,12 @@ int ico_dbus_amb_subscribe(const char *objectname, const char *property, int zon
 int ico_dbus_amb_unsubscribe(const char *objectname, const char *property, int zone);
 //int ico_dbus_amb_gethistory(const char *objectname, const char *property, int zone);
 //int ico_dbus_amb_getlist(void);
-
+int ico_dbus_amb_find_property(const char *objectname,
+                               const char *property,
+                               int zone,
+                               dbus_type type,
+                               ico_dbus_amb_findcb cb,
+                               void *user_data);
 #ifdef __cplusplus
 }
 #endif
index 4b0ec69..11199a2 100644 (file)
@@ -1,3 +1,8 @@
+* Thu Dec 26 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> submit/tizen/20131219.041934@fb2d235
+- 0.9.06 release
+-- revise: add manifest file for SMACK label setting.
+-- add: ico_dbus_amb_find_property() API.
+
 * Fri Nov 29 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> ivi_oct_m2@01a342a
 - 0.9.04 release
 -- Addition: DBus API for AMB.
index f9bf2dc..b00ca65 100644 (file)
@@ -1,7 +1,7 @@
 Name:       ico-uxf-utilities
 Summary:    Common utilities for ico uifw
-Version:    0.9.04
-Release:    2.1
+Version:    0.9.06
+Release:    1.1
 Group:      Automotive/Libraries
 License:    Apache-2.0
 URL:        ""
@@ -47,21 +47,29 @@ mkdir -p %{buildroot}/%{_includedir}/ico-util/
 cp -f include/ico_uws.h %{buildroot}/%{_includedir}/ico-util/
 cp -f include/ico_log.h %{buildroot}/%{_includedir}/ico-util/
 cp -f include/ico_dbus_amb_efl.h %{buildroot}/%{_includedir}/ico-util/
+# log output
+mkdir -p %{buildroot}/%{_localstatedir}/log/ico/
+chmod 0777 %{buildroot}/%{_localstatedir}/log/ico/
 
 %post
 /sbin/ldconfig
-mkdir -p %{_localstatedir}/log/ico/
-chmod 0777 %{_localstatedir}/log/ico/
 
 %postun -p /sbin/ldconfig
 
 %files
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
 %license LICENSE-2.0
 %{_libdir}/libico-util*
+%defattr(777,app,app,-)
+%{_localstatedir}/log/ico/
 
 %files devel
+%manifest %{name}.manifest
 %defattr(-,root,root,-)
 %{_includedir}/ico-util/ico_uws.h
 %{_includedir}/ico-util/ico_log.h
 %{_includedir}/ico-util/ico_dbus_amb_efl.h
 %{_libdir}/libico-util*
+%defattr(777,app,app,-)
+%{_localstatedir}/log/ico/
index be7bb39..6cd2231 100644 (file)
@@ -2,6 +2,7 @@
 #include <E_DBus.h>
 #include <stdio.h>
 
+#include "ico_log.h"
 #include "ico_dbus_amb_efl.h"
 
 #define LATER1024
@@ -28,6 +29,7 @@ enum MethodType {
     METHOD_GETHISTORY,
     METHOD_SUBSCRIBE,
     METHOD_UNSUBSCRIBE,
+    METHOD_FIND,
 };
 
 struct _method_args {
@@ -38,6 +40,7 @@ struct _method_args {
     union dbus_value_variant value;
     ico_dbus_amb_getcb getcb;
     ico_dbus_amb_noticb noticb;
+    ico_dbus_amb_findcb findcb;
     enum MethodType mtype;
     void *user_data;
 };
@@ -113,10 +116,6 @@ ICO_API int ico_dbus_amb_set(const char *objectname, const char *property, int z
     if (property == NULL || strlen(property) == 0) {
         return -1;
     }
-    if (type == DBUST_TYPE_STRING && value.sval == NULL) {
-        return -1;
-    }
-
     args = (struct _method_args*)malloc(sizeof(struct _method_args));
     if (args == NULL) {
         return -1;
@@ -211,6 +210,36 @@ ICO_API int ico_dbus_amb_gethistory(const char *objectname, const char *property
 }
 #endif
 
+ICO_API int ico_dbus_amb_find_property(const char *objectname,
+                                       const char *property,
+                                       int zone,
+                                       dbus_type type,
+                                       ico_dbus_amb_findcb cb,
+                                       void *user_data)
+{
+    struct _method_args *args;
+
+    if (objectname == NULL || strlen(objectname) == 0) {
+        return -1;
+    }
+    if (property == NULL || strlen(property) == 0) {
+        return -1;
+    }
+    args = (struct _method_args*)malloc(sizeof(struct _method_args));
+    if (args == NULL) {
+        return -1;
+    }
+    args->objectname = strdup(objectname);
+    args->property = strdup(property);
+    args->findcb = cb;
+    args->zone = zone;
+    args->dtype = type;
+    args->mtype = METHOD_FIND;
+    args->user_data = user_data;
+
+    return getproperty(args);
+}
+
 int getproperty(struct _method_args *args) {
     DBusMessage *msg;
 #ifdef LATER1024
@@ -242,14 +271,31 @@ void getproperty_cb(void *data, DBusMessage *msg, DBusError *error) {
     struct _signal_handler *_sig_handler, *head;
     struct timeval tv;
 
+    args = (struct _method_args*)data;
+
     if (!msg) {
-        if (error) {
-            fprintf(stderr, "%s: %s\n", error->name, error->message);
+        if (NULL != args && NULL != error) {
+            ICO_ERR("FindProperty[%s]: %s : %s", args->property,
+                    error->name, error->message);
+            if (METHOD_FIND == args->mtype) {
+                ico_dbus_error_t ico_error;
+                ico_error.name = error->name;
+                ico_error.message = error->message;
+                if (NULL != args->findcb) {
+                    args->findcb(args->objectname, args->property, args->dtype,
+                                 args->user_data, &ico_error);
+                }
+                free(args->objectname);
+                free(args->property);
+                free(args);
+            }
+        }
+        else {
+            ICO_ERR("FindProperty: %s : %s", error->name, error->message);
         }
         return;
     }
     dbus_error_init(&e);
-    args = (struct _method_args*)data;
 
     dbus_message_get_args(msg, &e, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID);
     //printf("Object Path:%s\n", path);
@@ -339,6 +385,15 @@ void getproperty_cb(void *data, DBusMessage *msg, DBusError *error) {
         break;
     case METHOD_UNSUBSCRIBE :
         break;
+    case METHOD_FIND :
+        if (NULL != args->findcb) {
+            args->findcb(args->objectname, args->property, args->dtype,
+                         args->user_data, NULL);
+            free(args->objectname);
+            free(args->property);
+            free(args);
+        }
+        break;
     default:
         break;
     }