hippox-drivers 0.3.1

🦛All indivisible atomic driver units in Hippox.
//! Bluetooth drivers registration

use crate::{DriverCategory, DriverRegistryMap};
use std::collections::HashMap;
use std::sync::Arc;

pub fn register(registry: &mut DriverRegistryMap) {
    let category = DriverCategory::Bluetooth;
    let map = registry.entry(category).or_insert_with(HashMap::new);

    #[cfg(any(feature = "bluetooth", feature = "all"))]
    {
        use crate::drivers::*;

        map.insert(
            "bluetooth_turn_on".to_string(),
            Arc::new(BluetoothTurnOnDriver),
        );
        map.insert(
            "bluetooth_turn_off".to_string(),
            Arc::new(BluetoothTurnOffDriver),
        );
        map.insert("bluetooth_scan".to_string(), Arc::new(BluetoothScanDriver));
        map.insert(
            "bluetooth_pairable".to_string(),
            Arc::new(BluetoothPairableDriver),
        );
        map.insert("bluetooth_pair".to_string(), Arc::new(BluetoothPairDriver));
        map.insert(
            "bluetooth_unpair".to_string(),
            Arc::new(BluetoothUnpairDriver),
        );
        map.insert(
            "bluetooth_list_paired".to_string(),
            Arc::new(BluetoothListPairedDriver),
        );
        map.insert(
            "bluetooth_connect".to_string(),
            Arc::new(BluetoothConnectDriver),
        );
        map.insert(
            "bluetooth_disconnect".to_string(),
            Arc::new(BluetoothDisconnectDriver),
        );
        map.insert(
            "bluetooth_send_file".to_string(),
            Arc::new(BluetoothSendFileDriver),
        );
        map.insert(
            "bluetooth_receive_file".to_string(),
            Arc::new(BluetoothReceiveFileDriver),
        );
        map.insert(
            "bluetooth_serial".to_string(),
            Arc::new(BluetoothSerialDriver),
        );
        map.insert(
            "bluetooth_scan_services".to_string(),
            Arc::new(BluetoothScanServicesDriver),
        );
        map.insert(
            "bluetooth_ble_read".to_string(),
            Arc::new(BluetoothBleReadDriver),
        );
        map.insert(
            "bluetooth_ble_write".to_string(),
            Arc::new(BluetoothBleWriteDriver),
        );
        map.insert(
            "bluetooth_ble_notify".to_string(),
            Arc::new(BluetoothBleNotifyDriver),
        );
        map.insert(
            "bluetooth_adapter_status".to_string(),
            Arc::new(BluetoothAdapterStatusDriver),
        );
        map.insert(
            "bluetooth_set_device_name".to_string(),
            Arc::new(BluetoothSetDeviceNameDriver),
        );
        map.insert(
            "bluetooth_get_mac_address".to_string(),
            Arc::new(BluetoothGetMacAddressDriver),
        );
        map.insert(
            "bluetooth_reject_pairing".to_string(),
            Arc::new(BluetoothRejectPairingDriver),
        );
        map.insert(
            "bluetooth_confirm_pin".to_string(),
            Arc::new(BluetoothConfirmPinDriver),
        );
        map.insert(
            "bluetooth_set_discoverable_timeout".to_string(),
            Arc::new(BluetoothSetDiscoverableTimeoutDriver),
        );
        map.insert(
            "bluetooth_get_connected_devices".to_string(),
            Arc::new(BluetoothGetConnectedDevicesDriver),
        );
        map.insert(
            "bluetooth_device_info".to_string(),
            Arc::new(BluetoothDeviceInfoDriver),
        );
        map.insert(
            "bluetooth_audio_connect".to_string(),
            Arc::new(BluetoothAudioConnectDriver),
        );
        map.insert(
            "bluetooth_audio_disconnect".to_string(),
            Arc::new(BluetoothAudioDisconnectDriver),
        );
        map.insert(
            "bluetooth_hid_connect".to_string(),
            Arc::new(BluetoothHidConnectDriver),
        );
        map.insert(
            "bluetooth_trust_device".to_string(),
            Arc::new(BluetoothTrustDeviceDriver),
        );
        map.insert(
            "bluetooth_delete_device".to_string(),
            Arc::new(BluetoothDeleteDeviceDriver),
        );
        map.insert(
            "bluetooth_le_advertise_start".to_string(),
            Arc::new(BluetoothLeAdvertiseStartDriver),
        );
        map.insert(
            "bluetooth_le_advertise_stop".to_string(),
            Arc::new(BluetoothLeAdvertiseStopDriver),
        );
        map.insert(
            "bluetooth_le_scan_filter".to_string(),
            Arc::new(BluetoothLeScanFilterDriver),
        );
        map.insert(
            "bluetooth_battery_get".to_string(),
            Arc::new(BluetoothBatteryGetDriver),
        );
        map.insert(
            "bluetooth_rssi_get".to_string(),
            Arc::new(BluetoothRssiGetDriver),
        );
        map.insert(
            "bluetooth_firmware_version".to_string(),
            Arc::new(BluetoothFirmwareVersionDriver),
        );
        map.insert(
            "bluetooth_rename_device".to_string(),
            Arc::new(BluetoothRenameDeviceDriver),
        );
        map.insert(
            "bluetooth_profile_list".to_string(),
            Arc::new(BluetoothProfileListDriver),
        );
        map.insert(
            "bluetooth_priority_set".to_string(),
            Arc::new(BluetoothPrioritySetDriver),
        );
        map.insert(
            "bluetooth_auto_connect_toggle".to_string(),
            Arc::new(BluetoothAutoConnectToggleDriver),
        );
        map.insert(
            "bluetooth_set_receive_directory".to_string(),
            Arc::new(BluetoothSetReceiveDirectoryDriver),
        );
    }
}