2015-12-02 15:20:48 -08:00
|
|
|
//Compile with:
|
|
|
|
// gcc -o busmodel busmodel.c `pkg-config --cflags --libs eldbus ecore eina`
|
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2015-12-02 15:20:48 -08:00
|
|
|
# include <config.h>
|
2016-04-20 13:07:53 -07:00
|
|
|
#endif
|
2015-12-02 15:20:48 -08:00
|
|
|
|
|
|
|
#include <Eldbus.h>
|
|
|
|
#include <Eldbus_Model.h>
|
|
|
|
#include <Efl.h>
|
|
|
|
#include <Ecore.h>
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
#include <Ecore_Getopt.h>
|
2015-12-02 15:20:48 -08:00
|
|
|
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
#define DEFAULT_BUS_NAME "org.freedesktop.DBus"
|
2015-12-02 15:20:48 -08:00
|
|
|
#define DEFAULT_PATH "/"
|
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
static int prop_count = 0;
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
static int retval = EXIT_SUCCESS;
|
|
|
|
static Eina_Bool quit_on_done = EINA_TRUE;
|
2015-12-02 15:20:48 -08:00
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
static void
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
future_properties_then(void* data, const Efl_Event *event)
|
2016-04-20 13:07:53 -07:00
|
|
|
{
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
Eo* obj = data;
|
|
|
|
Efl_Future_Event_Success *future = event->info;
|
2016-04-20 13:07:53 -07:00
|
|
|
Eina_Value * property_value;
|
|
|
|
const Eina_Array *properties_list;
|
|
|
|
Eina_Array_Iterator a_it;
|
2015-12-02 15:20:48 -08:00
|
|
|
char *property, *prop_str;
|
|
|
|
const char *name;
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
Eina_Iterator* it = future->value;
|
2015-12-02 15:20:48 -08:00
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
name = eldbus_model_proxy_name_get(obj);
|
|
|
|
properties_list = efl_model_properties_get(obj);
|
2015-12-02 15:20:48 -08:00
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
printf(" -> %s\n Properties:\n", name);
|
|
|
|
unsigned i = 0;
|
|
|
|
EINA_ARRAY_ITER_NEXT(properties_list, i, property, a_it)
|
2015-12-02 15:20:48 -08:00
|
|
|
{
|
2016-04-20 13:07:53 -07:00
|
|
|
if (eina_iterator_next(it, (void **)&property_value) && property_value)
|
2015-12-02 15:20:48 -08:00
|
|
|
{
|
|
|
|
prop_str = eina_value_to_string(property_value);
|
2016-04-20 13:07:53 -07:00
|
|
|
printf(" * %s=%s \n", property, prop_str);
|
|
|
|
free(prop_str);
|
2015-12-02 15:20:48 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
prop_count--;
|
|
|
|
if (prop_count == 0)
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
{
|
|
|
|
if (quit_on_done)
|
|
|
|
ecore_main_loop_quit();
|
|
|
|
else
|
|
|
|
printf("monitoring events...\n");
|
|
|
|
}
|
2015-12-02 15:20:48 -08:00
|
|
|
}
|
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
static void
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
error_cb(void* data EINA_UNUSED, const Efl_Event *event)
|
2015-12-02 15:20:48 -08:00
|
|
|
{
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
Efl_Future_Event_Failure *future = event->info;
|
|
|
|
printf(" ERROR: #%d '%s'\n", future->error, eina_error_msg_get(future->error));
|
2016-04-20 13:07:53 -07:00
|
|
|
ecore_main_loop_quit();
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
retval = EXIT_FAILURE;
|
2016-04-20 13:07:53 -07:00
|
|
|
}
|
2015-12-02 15:20:48 -08:00
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
static void
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
loop_children(Eina_Accessor *children)
|
2016-04-20 13:07:53 -07:00
|
|
|
{
|
|
|
|
Eo* child;
|
|
|
|
int i = 0;
|
2015-12-02 15:20:48 -08:00
|
|
|
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
EINA_ACCESSOR_FOREACH(children, i, child)
|
2015-12-02 15:20:48 -08:00
|
|
|
{
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
const Eina_Array *properties_list = efl_model_properties_get(child);
|
2016-04-20 13:07:53 -07:00
|
|
|
unsigned p_count = eina_array_count(properties_list);
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
const char *name = eldbus_model_proxy_name_get(child);
|
2016-04-20 13:07:53 -07:00
|
|
|
|
|
|
|
if (p_count)
|
|
|
|
{
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
Efl_Future **futures = calloc(p_count + 1, sizeof(Efl_Future *));
|
|
|
|
Eina_Array_Iterator a_it;
|
|
|
|
const char *property;
|
2016-04-20 13:07:53 -07:00
|
|
|
unsigned j = 0;
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
EINA_ARRAY_ITER_NEXT(properties_list, j, property, a_it)
|
|
|
|
{
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
futures[j] = efl_model_property_get(child, property);
|
2016-04-20 13:07:53 -07:00
|
|
|
}
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
efl_future_then(efl_future_iterator_all(eina_carray_iterator_new((void **)futures)),
|
|
|
|
&future_properties_then, &error_cb, NULL, child);
|
2016-04-20 13:07:53 -07:00
|
|
|
prop_count++;
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
free(futures);
|
|
|
|
printf(" %2d: %s (loading %u properties asynchronously)\n", i, name, j);
|
2016-04-20 13:07:53 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
printf(" %2d: %s (no properties yet)\n", i, name);
|
2016-04-20 13:07:53 -07:00
|
|
|
}
|
2015-12-02 15:20:48 -08:00
|
|
|
}
|
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
if (prop_count == 0)
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
{
|
|
|
|
if (quit_on_done)
|
|
|
|
ecore_main_loop_quit();
|
|
|
|
else
|
|
|
|
printf("monitoring events...\n");
|
|
|
|
}
|
2016-04-20 13:07:53 -07:00
|
|
|
}
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
static void
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
future_then(void* obj EINA_UNUSED, const Efl_Event *event)
|
2016-04-20 13:07:53 -07:00
|
|
|
{
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
Efl_Future_Event_Success *future = event->info;
|
|
|
|
Eina_Accessor *values = future->value;
|
|
|
|
Eina_Accessor *children;
|
|
|
|
unsigned int *count;
|
2016-04-20 13:07:53 -07:00
|
|
|
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
if (!eina_accessor_data_get(values, 0, (void**)&children))
|
2015-12-02 15:20:48 -08:00
|
|
|
{
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
fprintf(stderr, "ERROR: missing future fulfillment value #0\n");
|
|
|
|
retval = EXIT_FAILURE;
|
2016-04-20 13:07:53 -07:00
|
|
|
ecore_main_loop_quit();
|
|
|
|
return;
|
2015-12-02 15:20:48 -08:00
|
|
|
}
|
|
|
|
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
if (!eina_accessor_data_get(values, 1, (void**)&count))
|
2016-06-03 16:03:13 -07:00
|
|
|
{
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
fprintf(stderr, "ERROR: missing future fulfillment value #1\n");
|
|
|
|
retval = EXIT_FAILURE;
|
|
|
|
ecore_main_loop_quit();
|
|
|
|
return;
|
2016-06-03 16:03:13 -07:00
|
|
|
}
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
|
|
|
|
printf("efl_model_loaded count %u\n", *count);
|
|
|
|
loop_children(children);
|
2015-12-02 15:20:48 -08:00
|
|
|
}
|
|
|
|
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
static void
|
|
|
|
_on_properties_changed(void *data EINA_UNUSED, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
Efl_Model_Property_Event *ev = event->info;
|
|
|
|
Eina_Array_Iterator it;
|
|
|
|
const char *str;
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
printf("Properties changed:\n");
|
|
|
|
EINA_ARRAY_ITER_NEXT(ev->changed_properties, i, str, it)
|
|
|
|
printf("\t%s\n", str);
|
|
|
|
|
|
|
|
printf("Properties invalidated:\n");
|
|
|
|
EINA_ARRAY_ITER_NEXT(ev->invalidated_properties, i, str, it)
|
|
|
|
printf("\t%s\n", str);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_on_child_added(void *data EINA_UNUSED, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
Eo *child = event->info;
|
|
|
|
printf("Children Added: %p\n", child);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_on_child_removed(void *data EINA_UNUSED, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
Eo *child = event->info;
|
|
|
|
printf("Children Removed: %p\n", child);
|
|
|
|
}
|
|
|
|
|
|
|
|
EFL_CALLBACKS_ARRAY_DEFINE(event_cbs,
|
|
|
|
{ EFL_MODEL_EVENT_PROPERTIES_CHANGED, _on_properties_changed },
|
|
|
|
{ EFL_MODEL_EVENT_CHILD_ADDED, _on_child_added },
|
|
|
|
{ EFL_MODEL_EVENT_CHILD_REMOVED, _on_child_removed });
|
|
|
|
|
|
|
|
static const Ecore_Getopt options = {
|
|
|
|
"dbusmodel", /* program name */
|
|
|
|
NULL, /* usage line */
|
|
|
|
"1", /* version */
|
|
|
|
"(C) 2016 Enlightenment Project", /* copyright */
|
|
|
|
"BSD 2-Clause", /* license */
|
|
|
|
/* long description, may be multiline and contain \n */
|
|
|
|
"Example of Eldbus.Model.Object to fetch children and properties.\n",
|
|
|
|
EINA_FALSE,
|
|
|
|
{
|
|
|
|
ECORE_GETOPT_STORE_TRUE('s', "system", "connect to the system bus, not user session."),
|
|
|
|
ECORE_GETOPT_STORE_FALSE('w', "wait", "after done, wait for events (monitoring)"),
|
|
|
|
|
|
|
|
ECORE_GETOPT_VERSION('V', "version"),
|
|
|
|
ECORE_GETOPT_COPYRIGHT('C', "copyright"),
|
|
|
|
ECORE_GETOPT_LICENSE('L', "license"),
|
|
|
|
ECORE_GETOPT_HELP('h', "help"),
|
|
|
|
|
|
|
|
ECORE_GETOPT_STORE_METAVAR_STR(0, NULL, "The bus name to connect.", "bus_name"),
|
|
|
|
ECORE_GETOPT_STORE_METAVAR_STR(0, NULL, "The path to explore.", "path"),
|
|
|
|
|
|
|
|
ECORE_GETOPT_SENTINEL
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-12-02 15:20:48 -08:00
|
|
|
int
|
|
|
|
main(int argc, char **argv EINA_UNUSED)
|
|
|
|
{
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
Eldbus_Connection_Type conn_type;
|
|
|
|
Eina_Bool is_system = EINA_FALSE;
|
|
|
|
char *bus_name = DEFAULT_BUS_NAME;
|
|
|
|
char *path = DEFAULT_PATH;
|
|
|
|
Eina_Bool quit_option = EINA_FALSE;
|
|
|
|
Ecore_Getopt_Value values[] = {
|
|
|
|
ECORE_GETOPT_VALUE_BOOL(is_system),
|
|
|
|
ECORE_GETOPT_VALUE_BOOL(quit_on_done),
|
|
|
|
|
|
|
|
/* standard block to provide version, copyright, license and help */
|
|
|
|
ECORE_GETOPT_VALUE_BOOL(quit_option), /* -V/--version quits */
|
|
|
|
ECORE_GETOPT_VALUE_BOOL(quit_option), /* -C/--copyright quits */
|
|
|
|
ECORE_GETOPT_VALUE_BOOL(quit_option), /* -L/--license quits */
|
|
|
|
ECORE_GETOPT_VALUE_BOOL(quit_option), /* -h/--help quits */
|
|
|
|
|
|
|
|
/* positional argument */
|
|
|
|
ECORE_GETOPT_VALUE_STR(bus_name),
|
|
|
|
ECORE_GETOPT_VALUE_STR(path),
|
|
|
|
|
|
|
|
ECORE_GETOPT_VALUE_NONE /* sentinel */
|
|
|
|
};
|
|
|
|
int args;
|
2015-12-02 15:20:48 -08:00
|
|
|
Eo *root;
|
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
ecore_init();
|
2015-12-02 15:20:48 -08:00
|
|
|
eldbus_init();
|
|
|
|
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
args = ecore_getopt_parse(&options, values, argc, argv);
|
|
|
|
if (args < 0)
|
|
|
|
{
|
|
|
|
fputs("ERROR: Could not parse command line options.\n", stderr);
|
|
|
|
retval = EXIT_FAILURE;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (quit_option) goto end;
|
2015-12-02 15:20:48 -08:00
|
|
|
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
args = ecore_getopt_parse_positional(&options, values, argc, argv, args);
|
|
|
|
if (args < 0)
|
|
|
|
{
|
|
|
|
fputs("ERROR: Could not parse positional arguments.\n", stderr);
|
|
|
|
retval = EXIT_FAILURE;
|
|
|
|
goto end;
|
|
|
|
}
|
2015-12-02 15:20:48 -08:00
|
|
|
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
conn_type = (is_system ?
|
|
|
|
ELDBUS_CONNECTION_TYPE_SYSTEM :
|
|
|
|
ELDBUS_CONNECTION_TYPE_SESSION);
|
2015-12-02 15:20:48 -08:00
|
|
|
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
root = efl_add_ref(ELDBUS_MODEL_OBJECT_CLASS, ecore_main_loop_get(),
|
|
|
|
eldbus_model_object_constructor(efl_added, conn_type, NULL, EINA_FALSE, bus_name, path),
|
|
|
|
efl_event_callback_array_add(efl_added, event_cbs(), NULL));
|
2015-12-02 15:20:48 -08:00
|
|
|
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
efl_future_then(efl_future_all(efl_model_children_slice_get(root, 0, 0),
|
|
|
|
efl_model_children_count_get(root)),
|
|
|
|
&future_then, &error_cb, NULL, root);
|
2015-12-02 15:20:48 -08:00
|
|
|
|
2016-04-20 13:07:53 -07:00
|
|
|
ecore_main_loop_begin();
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
efl_del(root);
|
2015-12-02 15:20:48 -08:00
|
|
|
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
end:
|
2016-04-20 13:07:53 -07:00
|
|
|
eldbus_shutdown();
|
examples/eldbus/dbusmodel.c improve situation, far from correct.
it was using old API, updated, but still doesn't work as expected,
lots of warnings from children being left alive, all proxies are
reporting no properties...
when model dies, all children proxies should die as well, otherwise we
get on console:
```
CRI:eldbus lib/eldbus/eldbus_core.c:215 eldbus_shutdown() Alive TYPE_SYSTEM connection
ERR:eldbus lib/eldbus/eldbus_core.c:175 print_live_connection() conn=0x8219230 alive object=0x8276d50 net.connman of bus=net.connman
...
```
Also, all proxies are reporting no properties "(no properties yet)",
likely they are missing to fetch such... even if "--wait" to let it
run, no asynchronous properties are delivered, at least not triggering
EFL_MODEL_EVENT_PROPERTIES_CHANGED.
2016-11-04 08:09:27 -07:00
|
|
|
ecore_shutdown();
|
|
|
|
return retval;
|
2015-12-02 15:20:48 -08:00
|
|
|
}
|