Java源码示例:com.eveningoutpost.dexdrip.UtilityModels.HM10Attributes

示例1
public void setCharacteristicNotification(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting notification");
    if (mBluetoothGatt != null) {
        mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
        BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
        Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
        descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
        mBluetoothGatt.writeDescriptor(descriptor);
    }
}
 
示例2
public void setCharacteristicIndication(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting indication");
    if (mBluetoothGatt != null) {
        mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
        BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
        Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
        descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
        mBluetoothGatt.writeDescriptor(descriptor);
    }
}
 
示例3
public void setCharacteristicNotification(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting notification");
    if (mBluetoothGatt != null) {
        mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
        BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
        Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
        descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
        mBluetoothGatt.writeDescriptor(descriptor);
    }
}
 
示例4
public void setCharacteristicIndication(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting indication");
    if (mBluetoothGatt != null) {
        mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
        BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
        Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
        descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
        mBluetoothGatt.writeDescriptor(descriptor);
    }
}
 
示例5
public void setCharacteristicNotification(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting notification");
    mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
    Log.i(TAG, "UUID FOUND: " + characteristic.getUuid());
    BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
    Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
    descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
    mBluetoothGatt.writeDescriptor(descriptor);
}
 
示例6
public void setCharacteristicIndication(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting notification");
    mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
    Log.i(TAG, "UUID FOUND: " + characteristic.getUuid());
    BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
    Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
    descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
    mBluetoothGatt.writeDescriptor(descriptor);
}
 
示例7
public void setCharacteristicNotification(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting notification");
    if (mBluetoothGatt != null) {
        mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
        BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
        Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
        descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
        mBluetoothGatt.writeDescriptor(descriptor);
    }
}
 
示例8
public void setCharacteristicIndication(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting indication");
    if (mBluetoothGatt != null) {
        mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
        BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
        Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
        descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
        mBluetoothGatt.writeDescriptor(descriptor);
    }
}
 
示例9
public void setCharacteristicNotification(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting notification");
    if (mBluetoothGatt != null) {
        mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
        BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
        Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
        descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
        mBluetoothGatt.writeDescriptor(descriptor);
    }
}
 
示例10
public void setCharacteristicIndication(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting indication");
    if (mBluetoothGatt != null) {
        mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
        BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
        Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
        descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
        mBluetoothGatt.writeDescriptor(descriptor);
    }
}
 
示例11
public void setCharacteristicNotification(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting notification");
    mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
    Log.i(TAG, "UUID FOUND: " + characteristic.getUuid());
    BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
    Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
    descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
    mBluetoothGatt.writeDescriptor(descriptor);
}
 
示例12
public void setCharacteristicIndication(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting notification");
    mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
    Log.i(TAG, "UUID FOUND: " + characteristic.getUuid());
    BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
    Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
    descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
    mBluetoothGatt.writeDescriptor(descriptor);
}
 
示例13
public void setCharacteristicNotification(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting notification");
    if (mBluetoothGatt != null) {
        mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
        BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
        Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
        descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
        mBluetoothGatt.writeDescriptor(descriptor);
    }
}
 
示例14
public void setCharacteristicIndication(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting indication");
    if (mBluetoothGatt != null) {
        mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
        BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
        Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
        descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
        mBluetoothGatt.writeDescriptor(descriptor);
    }
}
 
示例15
public void setCharacteristicNotification(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting notification");
    mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
    Log.i(TAG, "UUID FOUND: " + characteristic.getUuid());
    BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
    Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
    descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
    mBluetoothGatt.writeDescriptor(descriptor);
}
 
示例16
public void setCharacteristicIndication(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.i(TAG, "Characteristic setting notification");
    mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
    Log.i(TAG, "UUID FOUND: " + characteristic.getUuid());
    BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
    Log.i(TAG, "Descriptor found: " + descriptor.getUuid());
    descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
    mBluetoothGatt.writeDescriptor(descriptor);
}
 
示例17
public void setCharacteristicNotification(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.w(TAG, "Characteristic setting notification");
    mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
    BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
    Log.w(TAG, "Descriptor found: " + descriptor.getUuid());
    descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
    mBluetoothGatt.writeDescriptor(descriptor);
}
 
示例18
public void setCharacteristicIndication(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.w(TAG, "Characteristic setting indication");
    mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
    BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
    Log.w(TAG, "Descriptor found: " + descriptor.getUuid());
    descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
    mBluetoothGatt.writeDescriptor(descriptor);
}
 
示例19
public void setCharacteristicNotification(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.w(TAG, "Characteristic setting notification");
    mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
    Log.w(TAG, "UUID FOUND: " + characteristic.getUuid());
    BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
    Log.w(TAG, "Descriptor found: " + descriptor.getUuid());
    descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
    mBluetoothGatt.writeDescriptor(descriptor);
}
 
示例20
public void setCharacteristicIndication(BluetoothGattCharacteristic characteristic, boolean enabled) {
    Log.w(TAG, "Characteristic setting notification");
    mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
    Log.w(TAG, "UUID FOUND: " + characteristic.getUuid());
    BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(HM10Attributes.CLIENT_CHARACTERISTIC_CONFIG));
    Log.w(TAG, "Descriptor found: " + descriptor.getUuid());
    descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
    mBluetoothGatt.writeDescriptor(descriptor);
}
 
示例21
private static String getDefaultPin() {
    final String bk_pin = Blukon.getPin();
    return bk_pin != null ? bk_pin : HM10Attributes.HM_DEFAULT_BT_PIN;
}
 
示例22
private static String getDefaultPin() {
    final String bk_pin = Blukon.getPin();
    return bk_pin != null ? bk_pin : HM10Attributes.HM_DEFAULT_BT_PIN;
}
 
示例23
private static String getDefaultPin() {
    final String bk_pin = Blukon.getPin();
    return bk_pin != null ? bk_pin : HM10Attributes.HM_DEFAULT_BT_PIN;
}
 
示例24
private static String getDefaultPin() {
    final String bk_pin = Blukon.getPin();
    return bk_pin != null ? bk_pin : HM10Attributes.HM_DEFAULT_BT_PIN;
}