Android Open Source - Arduino-Android-BLE-NRF8001 B L E Task






From Project

Back to project page Arduino-Android-BLE-NRF8001.

License

The source code is released under:

MIT License

If you think the Android project Arduino-Android-BLE-NRF8001 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 edu.uci.fallsensor.service;
//  w w  w .j  a v  a  2 s  .  c o m
import android.bluetooth.BluetoothDevice;

import java.util.UUID;

/**
 * Wrapper to manage BLE transactions with BLE devices
 * 
 * @author Sonny
 */
public class BLETask {
    final BLEState state;
    final BluetoothDevice device;
    final UUID serviceUuid;
    final UUID charaUuid;
    final byte[] msgOrCmd;

    public static BLETask newInstance(
            BLEState state, BluetoothDevice device, UUID serviceUuid, UUID charaUuid, byte[] msgOrCmd) {
        return new BLETask(state, device, serviceUuid, charaUuid, msgOrCmd);
    }

    private BLETask(BLEState state, BluetoothDevice device, UUID serviceUuid, UUID charaUuid, byte[] msgOrCmd) {
        this.state = state;
        this.device = device;
        this.serviceUuid = serviceUuid;
        this.charaUuid = charaUuid;
        this.msgOrCmd = msgOrCmd;
    }
    
    public String toString() {
        return new StringBuilder().append(state).append(",")
                .append(device.getName()).append(",")
                .append(serviceUuid).append(",")
                .append(charaUuid).append(",")
                .append(msgOrCmd).toString();
    }
}




Java Source Code List

com.adapters.ListAdapterCheckboxTitle.java
com.adapters.ListAdapterTitleDescription.java
com.adapters.ListAdapterTitleDescription.java
com.adapters.MainViewPagerAdapter.java
com.ble.sensors.NRF8001.java
edu.uci.fallsensor.MainActivity.java
edu.uci.fallsensor.dialog.SensorDialog.java
edu.uci.fallsensor.service.BLEController.java
edu.uci.fallsensor.service.BLEManager.java
edu.uci.fallsensor.service.BLEState.java
edu.uci.fallsensor.service.BLETask.java
edu.uci.fallsensor.service.BluetoothMetaData.java