Back to project page BLEService.
The source code is released under:
Copyright (c) 2014, Ratio LLC. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ...
If you think the Android project BLEService listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.ratio.deviceService.command; /* w w w . ja v a 2 s .com*/ import com.ratio.deviceService.BTLEDeviceManager; import com.ratio.exceptions.DeviceManagerException; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothManager; /** * since commands are executed asynchronously with callbacks, but new commands "blow away" previous commands * if the previous command's callback has not been called, we used a queue in the BluetoothGattCallack, and * requested commands are enqueued, then executed when the previous callback has completed. * @author matt2 * */ public abstract class BTLECommand { protected static final String TAG = BTLECommand.class.getSimpleName(); protected BTLEDeviceManager.BTDeviceInfo mDeviceInfo; public BTLECommand(BTLEDeviceManager.BTDeviceInfo deviceInfo) { mDeviceInfo = deviceInfo; } public abstract boolean execute(BTLEDeviceManager deviceManager) throws DeviceManagerException; }