hal_agent_new_device fails with dbus message errors

brendan powers brendan0powers at gmail.com
Mon Dec 27 09:46:05 PST 2004

I am attempting to write an agent that detects when a floppy has been
removed. However, i am having a problem with the hal_agent_new_device
function. My program pauses at this function an prints
"libhal.c 1612 : Error sending msg: Message did not receive a reply"
Other functions from libhal work perfectly, such as retrieving
properties of deiveces. So my connection to d-bus should be good.
Atached to this message is the source to my agent. It is not commented
well so here is the general flow of the program

Initialize the hal library context
start a thread to run the glib main loop
retrive the block device of the floppy drive(the hal device is passed
as a command line parameter)
loop forever
 Check to see if we can open the floppy device
 if we can and last loop we could not then there is a floppy in the drive
  create a new temporary hal device
  merge the flopy drivers parameters to this device
  set the parnet and the RequireEnable property
  make the new device available to the gdl
 if the floppy was removed
  remove the new device

This is just a proof of concept agent, so i really don't know what i'm doing:-p
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c
Size: 2186 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20041227/3def2c72/main.bin
-------------- next part --------------
hal mailing list
hal at lists.freedesktop.org

More information about the Hal mailing list