Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file hal_manager.ml
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798(*
* hal_manager.ml
* --------------
* Copyright : (c) 2009, Jeremie Dimino <jeremie@dimino.org>
* Licence : BSD3
*
* This file is a part of obus, an ocaml implementation of D-Bus.
*)openLwtopenOBus_valueincludeOBus_proxy.Privateletmanager()=let%lwtbus=OBus_bus.system()inreturn(OBus_proxy.make(OBus_peer.makebus"org.freedesktop.Hal")["org";"freedesktop";"Hal";"Manager"])openHal_interfaces.Org_freedesktop_Hal_Managerletmake_devicecontextudi=Hal_device.of_proxy(OBus_proxy.make(OBus_context.sendercontext)(OBus_path.of_stringudi))letget_all_devicesproxy=let%lwtcontext,l=OBus_method.call_with_contextm_GetAllDevicesproxy()inreturn(List.map(make_devicecontext)l)letget_all_devices_with_propertiesproxy=let%lwtcontext,l=OBus_method.call_with_contextm_GetAllDevicesWithPropertiesproxy()inreturn(List.map(fun(udi,properties)->(make_devicecontextudi,List.map(fun(name,value)->(name,Hal_device.property_of_variantvalue))properties))l)letdevice_existsproxyudi=OBus_method.callm_DeviceExistsproxy(OBus_path.to_stringudi)letfind_device_string_matchproxykeyvalue=let%lwtcontext,l=OBus_method.call_with_contextm_FindDeviceStringMatchproxy(key,value)inreturn(List.map(make_devicecontext)l)letfind_device_by_capabilityproxycapability=let%lwtcontext,l=OBus_method.call_with_contextm_FindDeviceByCapabilityproxycapabilityinreturn(List.map(make_devicecontext)l)letnew_deviceproxy=let%lwtcontext,udi=OBus_method.call_with_contextm_NewDeviceproxy()inreturn(make_devicecontextudi)letremoveproxydev=OBus_method.callm_Removeproxy(OBus_path.to_string(Hal_device.udidev))letcommit_to_gdlproxytemporary_udiglobal_udi=OBus_method.callm_CommitToGdlproxy(temporary_udi,global_udi)letacquire_global_interface_lockproxyinterface_nameexclusive=OBus_method.callm_AcquireGlobalInterfaceLockproxy(interface_name,exclusive)letrelease_global_interface_lockproxyinterface_name=OBus_method.callm_ReleaseGlobalInterfaceLockproxyinterface_nameletsingleton_addon_is_readyproxycommand_line=OBus_method.callm_SingletonAddonIsReadyproxycommand_lineletdevice_addedproxy=OBus_signal.map_with_contextmake_device(OBus_signal.makes_DeviceAddedproxy)letdevice_removedproxy=OBus_signal.map_with_contextmake_device(OBus_signal.makes_DeviceRemovedproxy)letnew_capabilityproxy=OBus_signal.map_with_context(funcontext(udi,cap)->(make_devicecontextudi,cap))(OBus_signal.makes_NewCapabilityproxy)letglobal_interface_lock_acquiredproxy=OBus_signal.map(fun(interface_name,lock_holder,num_locks)->letnum_locks=Int32.to_intnum_locksin(interface_name,lock_holder,num_locks))(OBus_signal.makes_GlobalInterfaceLockAcquiredproxy)letglobal_interface_lock_releasedproxy=OBus_signal.map(fun(interface_name,lock_holder,num_locks)->letnum_locks=Int32.to_intnum_locksin(interface_name,lock_holder,num_locks))(OBus_signal.makes_GlobalInterfaceLockReleasedproxy)