zoukankan      html  css  js  c++  java
  • Binder

     
    
    import android.bluetooth.BluetoothGatt;
    import android.bluetooth.BluetoothGattCallback;
    
    public interface BleManagerCallbacks {
    
    	/**
    	 * Called when the device has been connected. This does not mean that the application may start communication. A service discovery will be handled automatically after this call. Service discovery
    	 * may ends up with calling {@link #onServicesDiscovered(boolean)} or {@link #onDeviceNotSupported()} if required services have not been found.
    	 */
    	public void onDeviceConnected();
    
    	/**
    	 * Called when user pressed the DISCONNECT button.
    	 */
    	public void onDeviceDisconnecting();
    
    	/**
    	 * Called when the device has disconnected (when the callback returned {@link BluetoothGattCallback#onConnectionStateChange(BluetoothGatt, int, int)} with state DISCONNECTED.
    	 */
    	public void onDeviceDisconnected();
    
    	/**
    	 * Some profiles may use this method to notify user that the link was lost. You must call this method in your Ble Manager instead of {@link #onDeviceDisconnected()} while you discover
    	 * disconnection not initiated by the user.
    	 */
    	public void onLinklossOccur();
    
    	/**
    	 * Called when service discovery has finished and primary services has been found. The device is ready to operate. This method is not called if the primary, mandatory services were not found
    	 * during service discovery. For example in the Blood Pressure Monitor, a Blood Pressure service is a primary service and Intermediate Cuff Pressure service is a optional secondary service.
    	 * Existence of battery service is not notified by this call.
    	 * 
    	 * @param optionalServicesFound
    	 *            if <code>true</code> the secondary services were also found on the device.
    	 */
    	public void onServicesDiscovered(final boolean optionalServicesFound);
    
    	/**
    	 * Method called when all initialization requests has been completed.
    	 */
    	public void onDeviceReady();
    
    	/**
    	 * Called when battery value has been received from the device
    	 * 
    	 * @param value
    	 *            the battery value in percent
    	 */
    	public void onBatteryValueReceived(final int value);
    
    	/**
    	 * Called when an {@link BluetoothGatt#GATT_INSUFFICIENT_AUTHENTICATION} error occurred and the device bond state is NOT_BONDED
    	 */
    	public void onBondingRequired();
    
    	/**
    	 * Called when the device has been successfully bonded
    	 */
    	public void onBonded();
    
    	/**
    	 * Called when a BLE error has occurred
    	 * 
    	 * @param message
    	 *            the error message
    	 * @param errorCode
    	 *            the error code
    	 */
    	public void onError(final String message, final int errorCode);
    
    	/**
    	 * Called when service discovery has finished but the main services were not found on the device. This may occur when connecting to bonded device that does not support required services.
    	 */
    	public void onDeviceNotSupported();
    }
    
  • 相关阅读:
    The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHa
    eclipse中的快捷键或者自动生成某个方法的操作
    mybatis和jadbc的对比
    1.解决数据库的错误:Can't connect to MySQL server on 'localhost' (10061) (2003);2.无法查看源码的问题;3.无法启动tomcat的问题解决
    2017年杭电计算机研究生复试笔试题目
    jfinal +oracle 排序问题
    oracle 找回被删除的数据
    oracle存储过程
    jfinal调用oracle存储过程
    本地连接oraclel --localhost可以连接ip连接不了解决办法
  • 原文地址:https://www.cnblogs.com/iamgoodman/p/4730178.html
Copyright © 2011-2022 走看看