[Mono-list] USB hardware detection using Mono on Linux
Marek Habersack
grendel at twistedcode.net
Tue Aug 18 08:30:56 EDT 2009
Danny Haak wrote:
> Hi,
Hello,
> That seems like a good approach, but on the HAL site it states that "HAL
> is in maintenance mode - no new features are added. All future
> development focuses on Software/DeviceKit-disks,
> Software/DeviceKit-power, NetworkManager, PulseAudio, udev, ... " [1].
> Therefore, it seems not a good idea to me to use it in new software.
You won't be using HAL directly though. By connecting to DBus and listening for events there you
will separate yourself from whatever backend is being used by DBus to generate and deliver the
notifications (right now it's HAL, tomorrow it might be something else - you won't care).
regards,
marek
>
> Best regards,
> Danny
>
> [1]: http://www.freedesktop.org/wiki/Software/hal
>
> -----Original Message-----
> From: mono-list-bounces at lists.ximian.com
> [mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Adam Tauno
> Williams
> Sent: dinsdag 18 augustus 2009 12:49
> To: mono-list
> Subject: Re: [Mono-list] USB hardware detection using Mono on Linux
>
> On Tue, 2009-08-18 at 12:06 +0200, Danny Haak wrote:
>> Hi all,
>> I am currently writing a piece of software that needs to detect which
>> USB devices are attached to the computer. Event-based notifications of
>
>> attaching and detaching hardware while the software is running is
>> nice, but not required.
>> I first used DeviceKit-Sharp (by Ben Gamari), but when observing a bug
>
>> and asking the DeviceKit mailing-list, Kay Sievers answered: "The
>> DeviceKit daemon is dead and will not run, or be installed on any
>> usual system. You need to use libudev, or the GUdev to retrieve this
>> information." This is a pity, because DeviceKit was working nicely,
>> despite the bug in the daemon.
>> I can't find any Mono-bindings for libudev, and diving deeper in the
>> documentation, libudev seems quite low-level and talking to HAL.
>> Looking for HAL abstractions, I discovered that HAL will be obsolete
>> as well in the near future. This leaves me completely confused about
>> 'the way to go' for hardware detection in Mono on Linux. Is there
>> anybody who can suggest a (sort of) future-proof approach to this?
>
> I believe you can attach to the system D-BUS and you will receive HAL
> events. <http://www.ndesk.org/DBus_Documentation>
> --
> OpenGroupware developer: awilliam at whitemice.org
> <http://whitemiceconsulting.blogspot.com/>
> OpenGroupare & Cyrus IMAPd documenation @
> <http://docs.opengroupware.org/Members/whitemice/wmogag/file_view>
>
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
More information about the Mono-list
mailing list