Re: USB insertion event on Tizen through dbus

2014-09-11 Thread Rees, Kevron
The way you are listening for signals seems strange.  This is the code
I have used:

object->handle =

g_dbus_connection_signal_subscribe(g_bus_get_sync(G_BUS_TYPE_SYSTEM,

  NULL, NULL),

   "org.automotive.message.broker",

   "org.freedesktop.DBus.Properties",

   "PropertiesChanged",

   object_path.c_str(), NULL,

   G_DBUS_SIGNAL_FLAGS_NONE,

   SignalCallback, &amb_objects_,

   NULL);

Hope that helps.

On Wed, Sep 10, 2014 at 8:27 PM, Ruchi Sharma  wrote:
> Hello,
>
>
>
> I have checked dbus-monitor --system. Its shows signals when USB device is
> inserted.
>
> Thanks!!
>
>
>
> Regards,
>
> Ruchi
>
>
> ~~Disclaimer~~~
> Information contained and transmitted by this e-mail is confidential and
> proprietary to IGATE and its affiliates and is intended for use only by the
> recipient. If you are not the intended recipient, you are hereby notified
> that any dissemination, distribution, copying or use of this e-mail is
> strictly prohibited and you are requested to delete this e-mail immediately
> and notify the originator or mailad...@igate.com. IGATE does not enter into
> any agreement with any party by e-mail. Any views expressed by an individual
> do not necessarily reflect the view of IGATE. IGATE is not responsible for
> the consequences of any actions taken on the basis of information provided,
> through this email. The contents of an attachment to this e-mail may contain
> software viruses, which could damage your own computer system. While IGATE
> has taken every reasonable precaution to minimise this risk, we cannot
> accept liability for any damage which you sustain as a result of software
> viruses. You should carry out your own virus checks before opening an
> attachment. To know more about IGATE please visit www.igate.com.
> 
>
> ___
> IVI mailing list
> IVI@lists.tizen.org
> https://lists.tizen.org/listinfo/ivi
>
___
IVI mailing list
IVI@lists.tizen.org
https://lists.tizen.org/listinfo/ivi


Re: USB insertion event on Tizen through dbus

2014-09-10 Thread Ruchi Sharma
Hello,

I have checked dbus-monitor --system. Its shows signals when USB device is 
inserted.
Thanks!!

Regards,
Ruchi

~~Disclaimer~~~
Information contained and transmitted by this e-mail is confidential and 
proprietary to IGATE and its affiliates and is intended for use only by the 
recipient. If you are not the intended recipient, you are hereby notified that 
any dissemination, distribution, copying or use of this e-mail is strictly 
prohibited and you are requested to delete this e-mail immediately and notify 
the originator or mailad...@igate.com . IGATE does 
not enter into any agreement with any party by e-mail. Any views expressed by 
an individual do not necessarily reflect the view of IGATE. IGATE is not 
responsible for the consequences of any actions taken on the basis of 
information provided, through this email. The contents of an attachment to this 
e-mail may contain software viruses, which could damage your own computer 
system. While IGATE has taken every reasonable precaution to minimise this 
risk, we cannot accept liability for any damage which you sustain as a result 
of software viruses. You should carry out your own virus checks before opening 
an attachment. To know more about IGATE please visit www.igate.com 
.

___
IVI mailing list
IVI@lists.tizen.org
https://lists.tizen.org/listinfo/ivi


Re: USB insertion event on Tizen through dbus

2014-09-09 Thread Thiago Macieira
On Tuesday 09 September 2014 12:50:03 Ruchi Sharma wrote:
> Thanks for your reply.
> 
> I checked that udisk daemon is running as "udisksd".
> 
> I ran "udisksctl dump" , it gives logs on USB insertion which shows it is
> using "org.freedesktop.UDisks2" service.
> 
> 
> 
> I tried to get these events through GDBus APIs but I was not able to get the
> events.

You didn't tell us whether dbus-monitor --system shows those signals being 
emitted.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
IVI mailing list
IVI@lists.tizen.org
https://lists.tizen.org/listinfo/ivi


RE: USB insertion event on Tizen through dbus

2014-09-09 Thread Ruchi Sharma
Hi All,



Thanks for your reply.

I checked that udisk daemon is running as "udisksd".

I ran "udisksctl dump" , it gives logs on USB insertion which shows it is using 
"org.freedesktop.UDisks2" service.



Below is the code snapshot which I am using to get USB insertion event using 
GDBus. But I am not able to get USB insertion events. Kindly let me know if I 
am doing something wrong.

Thanks!!



/Code snapshot**/



GDBusConnection *connection;

GDBusMessage* message;

GDBusProxy *proxy;

GError *error = NULL;



connection = g_bus_get_sync(DBUS_BUS_SYSTEM,NULL,NULL);

if (connection == NULL)
{
  g_printerr ("Failed to open connection to bus: %s\n",error->message);
  g_error_free (error);
  exit (1);
}
else
{
printf("Got a connection to DBUS_BUS_SYSTEM\n");
}



 proxy = g_dbus_proxy_new_sync(connection, G_DBUS_PROXY_FLAGS_NONE , NULL, 
"org.freedesktop.UDisks2", "/org/freedesktop/UDisks2", 
"org.freedesktop.UDisks2", NULL, NULL);



if(proxy == NULL)
 {
g_printerr ("Failed To Create A proxy...: %s\n", error->message);
g_error_free (error);
exit(1);
 }
 else
   printf("Probably got a connection to the correct interface...\n");



g_signal_connect(proxy,"g-signal",(GCallback)device_added,NULL);



   g_signal_connect(proxy,"g-signal",(GCallback)device_removed,NULL);



 loop=g_main_loop_new(NULL,FALSE);

 g_main_loop_run (loop);

 g_error_free (error);

 return 0;





____________
From: Ruchi Sharma
Sent: 09 September 2014 18:20:03
To: ivi@lists.tizen.org
Subject: Re: USB insertion event on Tizen through dbus


Hi,



Thanks for your reply.

I checked that udisk daemon is running as "udisksd".

I ran "udisksctl dump" , it gives logs on USB insertion which shows it is using 
"org.freedesktop.UDisks2" service.



I tried to get these events through GDBus APIs but I was not able to get the 
events.

Can I get some code snapshot of GDBus APIs using "org.freedesktop.UDisks2" 
service ??

Thanks !!



Regards,

Ruchi



~~Disclaimer~~~
Information contained and transmitted by this e-mail is confidential and 
proprietary to IGATE and its affiliates and is intended for use only by the 
recipient. If you are not the intended recipient, you are hereby notified that 
any dissemination, distribution, copying or use of this e-mail is strictly 
prohibited and you are requested to delete this e-mail immediately and notify 
the originator or mailad...@igate.com <mailto:mailad...@igate.com>. IGATE does 
not enter into any agreement with any party by e-mail. Any views expressed by 
an individual do not necessarily reflect the view of IGATE. IGATE is not 
responsible for the consequences of any actions taken on the basis of 
information provided, through this email. The contents of an attachment to this 
e-mail may contain software viruses, which could damage your own computer 
system. While IGATE has taken every reasonable precaution to minimise this 
risk, we cannot accept liability for any damage which you sustain as a result 
of software viruses. You should carry out your own virus checks before opening 
an attachment. To know more about IGATE please visit www.igate.com 
<http://www.igate.com>.

___
IVI mailing list
IVI@lists.tizen.org
https://lists.tizen.org/listinfo/ivi


Re: USB insertion event on Tizen through dbus

2014-09-09 Thread Ruchi Sharma
Hi,



Thanks for your reply.

I checked that udisk daemon is running as "udisksd".

I ran "udisksctl dump" , it gives logs on USB insertion which shows it is using 
"org.freedesktop.UDisks2" service.



I tried to get these events through GDBus APIs but I was not able to get the 
events.

Can I get some code snapshot of GDBus APIs using "org.freedesktop.UDisks2" 
service ??

Thanks !!



Regards,

Ruchi



~~Disclaimer~~~
Information contained and transmitted by this e-mail is confidential and 
proprietary to IGATE and its affiliates and is intended for use only by the 
recipient. If you are not the intended recipient, you are hereby notified that 
any dissemination, distribution, copying or use of this e-mail is strictly 
prohibited and you are requested to delete this e-mail immediately and notify 
the originator or mailad...@igate.com . IGATE does 
not enter into any agreement with any party by e-mail. Any views expressed by 
an individual do not necessarily reflect the view of IGATE. IGATE is not 
responsible for the consequences of any actions taken on the basis of 
information provided, through this email. The contents of an attachment to this 
e-mail may contain software viruses, which could damage your own computer 
system. While IGATE has taken every reasonable precaution to minimise this 
risk, we cannot accept liability for any damage which you sustain as a result 
of software viruses. You should carry out your own virus checks before opening 
an attachment. To know more about IGATE please visit www.igate.com 
.

___
IVI mailing list
IVI@lists.tizen.org
https://lists.tizen.org/listinfo/ivi


Re: USB insertion event on Tizen through dbus

2014-09-08 Thread Rees, Kevron
On Mon, Sep 8, 2014 at 9:15 AM, Thiago Macieira
 wrote:
> On Monday 08 September 2014 09:46:44 Ruchi Sharma wrote:
>> Hi All,
>>
>> I am working on Tizen IVI March release.
>> I am trying to get USB insertion/removal events through dbus APIs. I am
>> using UDisks service. Below is the snapshot of code:
>>
>> connection = dbus_g_bus_get(DBUS_BUS_SYSTEM,NULL);
>> proxy=dbus_g_proxy_new_for_name(connection,"org.freedesktop.UDisks","/org/fr
>> eedesktop/UDisks","org.freedesktop.UDisks");
>>
>> dbus_g_proxy_add_signal(proxy,"DeviceAdded",DBUS_TYPE_G_OBJECT_PATH,
>> G_TYPE_INVALID);
>> dbus_g_proxy_connect_signal(proxy,"DeviceAdded",(GCallback)device_added,NUL
>> L,NULL);
>>
>> dbus_g_proxy_add_signal(proxy,"DeviceRemoved",DBUS_TYPE_G_OBJECT_PATH,
>> G_TYPE_INVALID);
>> dbus_g_proxy_connect_signal(proxy,"DeviceRemoved",(GCallback)device_removed
>> ,NULL,NULL);
>>
>> I am checking "connection" and "proxy" and they are not null.
>
> First of all, please do not write any new code using dbus-glib. It's
> maintainer has publicly asked that people don't do that. That library is
> entirely deprecated and code should move off it as soon as possible.
>

Use gdbus or QtDBus.

>> But still I am not able to call callbacks on insertion and on removal of
>> USB.
>>
>> The above mentioned code works on ubuntu fine. I have checked that
>> udisks-daemon is running on ubuntu.
>
> Have you verified that udisks-daemon is running on Tizen? Run dbus-monitor --
> system and see if the signals are emitted when you insert a USB device and see
> if udisksctl dump shows the device after it's been inserted.
>

+1

>> ~~~ Information
>> contained and transmitted by this e-mail is confidential and proprietary to
>> IGATE and its affiliates and is intended for use only by the recipient. If
>> you are not the intended recipient, you are hereby notified that any
>> dissemination, distribution, copying or use of this e-mail is strictly
>> prohibited and you are requested to delete this e-mail immediately and
>> notify the originator or mailad...@igate.com .
>> IGATE does not enter into any agreement with any party by e-mail. Any views
>> expressed by an individual do not necessarily reflect the view of IGATE.
>> IGATE is not responsible for the consequences of any actions taken on the
>> basis of information provided, through this email. The contents of an
>> attachment to this e-mail may contain software viruses, which could damage
>> your own computer system. While IGATE has taken every reasonable precaution
>> to minimise this risk, we cannot accept liability for any damage which you
>> sustain as a result of software viruses. You should carry out your own
>> virus checks before opening an attachment. To know more about IGATE please
>> visit www.igate.com .
>
> Please ask your IT admins to remove the message above. Your email is not
> confidential, since it was sent to the entire world to see.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> ___
> IVI mailing list
> IVI@lists.tizen.org
> https://lists.tizen.org/listinfo/ivi
___
IVI mailing list
IVI@lists.tizen.org
https://lists.tizen.org/listinfo/ivi


Re: USB insertion event on Tizen through dbus

2014-09-08 Thread Thiago Macieira
On Monday 08 September 2014 09:46:44 Ruchi Sharma wrote:
> Hi All,
> 
> I am working on Tizen IVI March release.
> I am trying to get USB insertion/removal events through dbus APIs. I am
> using UDisks service. Below is the snapshot of code:
> 
> connection = dbus_g_bus_get(DBUS_BUS_SYSTEM,NULL);
> proxy=dbus_g_proxy_new_for_name(connection,"org.freedesktop.UDisks","/org/fr
> eedesktop/UDisks","org.freedesktop.UDisks");
> 
> dbus_g_proxy_add_signal(proxy,"DeviceAdded",DBUS_TYPE_G_OBJECT_PATH,
> G_TYPE_INVALID);
> dbus_g_proxy_connect_signal(proxy,"DeviceAdded",(GCallback)device_added,NUL
> L,NULL);
> 
> dbus_g_proxy_add_signal(proxy,"DeviceRemoved",DBUS_TYPE_G_OBJECT_PATH,
> G_TYPE_INVALID);
> dbus_g_proxy_connect_signal(proxy,"DeviceRemoved",(GCallback)device_removed
> ,NULL,NULL);
> 
> I am checking "connection" and "proxy" and they are not null.

First of all, please do not write any new code using dbus-glib. It's 
maintainer has publicly asked that people don't do that. That library is 
entirely deprecated and code should move off it as soon as possible.

> But still I am not able to call callbacks on insertion and on removal of
> USB.
> 
> The above mentioned code works on ubuntu fine. I have checked that
> udisks-daemon is running on ubuntu.

Have you verified that udisks-daemon is running on Tizen? Run dbus-monitor --
system and see if the signals are emitted when you insert a USB device and see 
if udisksctl dump shows the device after it's been inserted.

> ~~~ Information
> contained and transmitted by this e-mail is confidential and proprietary to
> IGATE and its affiliates and is intended for use only by the recipient. If
> you are not the intended recipient, you are hereby notified that any
> dissemination, distribution, copying or use of this e-mail is strictly
> prohibited and you are requested to delete this e-mail immediately and
> notify the originator or mailad...@igate.com .
> IGATE does not enter into any agreement with any party by e-mail. Any views
> expressed by an individual do not necessarily reflect the view of IGATE.
> IGATE is not responsible for the consequences of any actions taken on the
> basis of information provided, through this email. The contents of an
> attachment to this e-mail may contain software viruses, which could damage
> your own computer system. While IGATE has taken every reasonable precaution
> to minimise this risk, we cannot accept liability for any damage which you
> sustain as a result of software viruses. You should carry out your own
> virus checks before opening an attachment. To know more about IGATE please
> visit www.igate.com .

Please ask your IT admins to remove the message above. Your email is not 
confidential, since it was sent to the entire world to see.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

___
IVI mailing list
IVI@lists.tizen.org
https://lists.tizen.org/listinfo/ivi


USB insertion event on Tizen through dbus

2014-09-08 Thread Ruchi Sharma
Hi All,

I am working on Tizen IVI March release.
I am trying to get USB insertion/removal events through dbus APIs. I am using 
UDisks service.
Below is the snapshot of code:

connection = dbus_g_bus_get(DBUS_BUS_SYSTEM,NULL);
proxy=dbus_g_proxy_new_for_name(connection,"org.freedesktop.UDisks","/org/freedesktop/UDisks","org.freedesktop.UDisks");

dbus_g_proxy_add_signal(proxy,"DeviceAdded",DBUS_TYPE_G_OBJECT_PATH, 
G_TYPE_INVALID);
dbus_g_proxy_connect_signal(proxy,"DeviceAdded",(GCallback)device_added,NULL,NULL);

dbus_g_proxy_add_signal(proxy,"DeviceRemoved",DBUS_TYPE_G_OBJECT_PATH, 
G_TYPE_INVALID);
dbus_g_proxy_connect_signal(proxy,"DeviceRemoved",(GCallback)device_removed,NULL,NULL);

I am checking "connection" and "proxy" and they are not null.
But still I am not able to call callbacks on insertion and on removal of USB.

The above mentioned code works on ubuntu fine. I have checked that 
udisks-daemon is running on ubuntu.

Can anybody help me on this or is there any other way to get evets of USB 
insertion/removal?
Thanks !!

Regards,
Ruchi

~~Disclaimer~~~
Information contained and transmitted by this e-mail is confidential and 
proprietary to IGATE and its affiliates and is intended for use only by the 
recipient. If you are not the intended recipient, you are hereby notified that 
any dissemination, distribution, copying or use of this e-mail is strictly 
prohibited and you are requested to delete this e-mail immediately and notify 
the originator or mailad...@igate.com . IGATE does 
not enter into any agreement with any party by e-mail. Any views expressed by 
an individual do not necessarily reflect the view of IGATE. IGATE is not 
responsible for the consequences of any actions taken on the basis of 
information provided, through this email. The contents of an attachment to this 
e-mail may contain software viruses, which could damage your own computer 
system. While IGATE has taken every reasonable precaution to minimise this 
risk, we cannot accept liability for any damage which you sustain as a result 
of software viruses. You should carry out your own virus checks before opening 
an attachment. To know more about IGATE please visit www.igate.com 
.

___
IVI mailing list
IVI@lists.tizen.org
https://lists.tizen.org/listinfo/ivi