Android Open Source - BleAdapter Ble Event Adapter






From Project

Back to project page BleAdapter.

License

The source code is released under:

Apache License

If you think the Android project BleAdapter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.indy.labs.android.BleEventAdapter;
//from  w w w.ja  v  a 2 s. com

import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.content.Intent;
import com.indy.labs.android.BleEventAdapter.service.discovery.device.DeviceDiscoveryService;
import com.indy.labs.android.BleEventAdapter.service.gatt.GattService;

public class BleEventAdapter {

    private static BleEventAdapter ourInstance = new BleEventAdapter();

    private BluetoothDevice bluetoothDevice;

    public static BleEventAdapter getInstance() {
        return ourInstance;
    }

    public BluetoothDevice getBluetoothDevice() {
        return bluetoothDevice;
    }

    private void setBluetoothDevice(BluetoothDevice bluetoothDevice) {
        this.bluetoothDevice = bluetoothDevice;
    }

    public void connectDevice(Context context, BluetoothDevice device) {
        context.stopService(new Intent(context, GattService.class));
    }

    public void closeConnection(Context context) {
        context.stopService(new Intent(context, GattService.class));

    }

    public void startScanning(Context context) {
        context.startService(new Intent(context, DeviceDiscoveryService.class));
    }

    public void stopScanning(Context context) {
        context.stopService(new Intent(context, DeviceDiscoveryService.class));
    }
}




Java Source Code List

com.indy.labs.android.BleEventAdapter.BleEventAdapter.java
com.indy.labs.android.BleEventAdapter.BleEventBus.java
com.indy.labs.android.BleEventAdapter.EventLogger.java
com.indy.labs.android.BleEventAdapter.events.CharacteristicChangedEvent.java
com.indy.labs.android.BleEventAdapter.events.CharacteristicReadEvent.java
com.indy.labs.android.BleEventAdapter.events.CharacteristicWriteEvent.java
com.indy.labs.android.BleEventAdapter.events.DescriptorReadEvent.java
com.indy.labs.android.BleEventAdapter.events.DescriptorWriteEvent.java
com.indy.labs.android.BleEventAdapter.events.DiscoveredDevicesEvent.java
com.indy.labs.android.BleEventAdapter.events.DiscoveryServiceEvent.java
com.indy.labs.android.BleEventAdapter.events.GattConnectionStateChangedEvent.java
com.indy.labs.android.BleEventAdapter.events.ReadRemoteRssiEvent.java
com.indy.labs.android.BleEventAdapter.events.ReliableWriteCompleted.java
com.indy.labs.android.BleEventAdapter.events.ScanningEvent.java
com.indy.labs.android.BleEventAdapter.events.ServiceDiscoveredEvent.java
com.indy.labs.android.BleEventAdapter.service.discovery.device.DeviceDiscoveryService.java
com.indy.labs.android.BleEventAdapter.service.gatt.GattConnectionState.java
com.indy.labs.android.BleEventAdapter.service.gatt.GattService.java