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);
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
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: ""
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/
#include <E_DBus.h>
#include <stdio.h>
+#include "ico_log.h"
#include "ico_dbus_amb_efl.h"
#define LATER1024
METHOD_GETHISTORY,
METHOD_SUBSCRIBE,
METHOD_UNSUBSCRIBE,
+ METHOD_FIND,
};
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;
};
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;
}
#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
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);
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;
}