package obus
Pure Ocaml implementation of the D-Bus protocol
Install
Dune Dependency
Authors
Maintainers
Sources
obus-1.2.5.tar.gz
md5=81eb1034c6ef4421a2368a9b352199de
sha512=4b540497188a7d78f4f14f94c6b7fdff47dd06436a34e650ff378dd77bb3e2acb7afd45cd72daf4ddba06e732e9944d560c2882dc37862f1b1f1bb6df37e6205
doc/src/obus.hal/hal_manager.ml.html
Source file hal_manager.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
(* * 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. *) open Lwt open OBus_value include OBus_proxy.Private let manager () = let%lwt bus = OBus_bus.system () in return (OBus_proxy.make (OBus_peer.make bus "org.freedesktop.Hal") [ "org"; "freedesktop"; "Hal"; "Manager" ]) open Hal_interfaces.Org_freedesktop_Hal_Manager let make_device context udi = Hal_device.of_proxy (OBus_proxy.make (OBus_context.sender context) (OBus_path.of_string udi)) let get_all_devices proxy = let%lwt context, l = OBus_method.call_with_context m_GetAllDevices proxy () in return (List.map (make_device context) l) let get_all_devices_with_properties proxy = let%lwt context, l = OBus_method.call_with_context m_GetAllDevicesWithProperties proxy () in return (List.map (fun (udi, properties) -> (make_device context udi, List.map (fun (name, value) -> (name, Hal_device.property_of_variant value)) properties)) l) let device_exists proxy udi = OBus_method.call m_DeviceExists proxy (OBus_path.to_string udi) let find_device_string_match proxy key value = let%lwt context, l = OBus_method.call_with_context m_FindDeviceStringMatch proxy (key, value) in return (List.map (make_device context) l) let find_device_by_capability proxy capability = let%lwt context, l = OBus_method.call_with_context m_FindDeviceByCapability proxy capability in return (List.map (make_device context) l) let new_device proxy = let%lwt context, udi = OBus_method.call_with_context m_NewDevice proxy () in return (make_device context udi) let remove proxy dev = OBus_method.call m_Remove proxy (OBus_path.to_string (Hal_device.udi dev)) let commit_to_gdl proxy temporary_udi global_udi = OBus_method.call m_CommitToGdl proxy (temporary_udi, global_udi) let acquire_global_interface_lock proxy interface_name exclusive = OBus_method.call m_AcquireGlobalInterfaceLock proxy (interface_name, exclusive) let release_global_interface_lock proxy interface_name = OBus_method.call m_ReleaseGlobalInterfaceLock proxy interface_name let singleton_addon_is_ready proxy command_line = OBus_method.call m_SingletonAddonIsReady proxy command_line let device_added proxy = OBus_signal.map_with_context make_device (OBus_signal.make s_DeviceAdded proxy) let device_removed proxy = OBus_signal.map_with_context make_device (OBus_signal.make s_DeviceRemoved proxy) let new_capability proxy = OBus_signal.map_with_context (fun context (udi, cap) -> (make_device context udi, cap)) (OBus_signal.make s_NewCapability proxy) let global_interface_lock_acquired proxy = OBus_signal.map (fun (interface_name, lock_holder, num_locks) -> let num_locks = Int32.to_int num_locks in (interface_name, lock_holder, num_locks)) (OBus_signal.make s_GlobalInterfaceLockAcquired proxy) let global_interface_lock_released proxy = OBus_signal.map (fun (interface_name, lock_holder, num_locks) -> let num_locks = Int32.to_int num_locks in (interface_name, lock_holder, num_locks)) (OBus_signal.make s_GlobalInterfaceLockReleased proxy)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>