本文整理汇总了Java中com.samsung.android.sdk.bt.gatt.BluetoothGattService.getCharacteristic方法的典型用法代码示例。如果您正苦于以下问题:Java BluetoothGattService.getCharacteristic方法的具体用法?Java BluetoothGattService.getCharacteristic怎么用?Java BluetoothGattService.getCharacteristic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.samsung.android.sdk.bt.gatt.BluetoothGattService
的用法示例。
在下文中一共展示了BluetoothGattService.getCharacteristic方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DummyReadForSecLevelCheck
import com.samsung.android.sdk.bt.gatt.BluetoothGattService; //导入方法依赖的package包/类
public void DummyReadForSecLevelCheck(BluetoothDevice device) {
boolean result = false;
if (mBluetoothGatt != null && device != null) {
BluetoothGattService disService = mBluetoothGatt.getService(device, DIS_UUID);
if (disService == null) {
showMessage("Dis service not found!");
return;
}
BluetoothGattCharacteristic firmwareIdCharc = disService.getCharacteristic(FIRMWARE_REVISON_UUID);
if (firmwareIdCharc == null) {
showMessage("firmware revison charateristic not found!");
return;
}
result = mBluetoothGatt.readCharacteristic(firmwareIdCharc);
if (result == false) {
showMessage("firmware revison reading is failed!");
}
}
}
示例2: enableHRNotification
import com.samsung.android.sdk.bt.gatt.BluetoothGattService; //导入方法依赖的package包/类
public void enableHRNotification(BluetoothDevice device) {
boolean result = false;
Log.i(TAG, "enableHRNotification ");
isNoti = true;
BluetoothGattService mHRP = mBluetoothGatt.getService(device, HRP_SERVICE);
if (mHRP == null) {
Log.e(TAG, "HRP service not found!");
return;
}
BluetoothGattCharacteristic mHRMcharac = mHRP.getCharacteristic(HEART_RATE_MEASUREMENT_CHARAC);
if (mHRMcharac == null) {
Log.e(TAG, "HEART RATE MEASUREMENT charateristic not found!");
return;
}
BluetoothGattDescriptor mHRMccc = mHRMcharac.getDescriptor(CCC);
if (mHRMccc == null) {
Log.e(TAG, "CCC for HEART RATE MEASUREMENT charateristic not found!");
return;
}
result = mBluetoothGatt.readDescriptor(mHRMccc);
if (result == false) {
Log.e(TAG, "readDescriptor() is failed");
return;
}
}
示例3: ResetEnergyExpended
import com.samsung.android.sdk.bt.gatt.BluetoothGattService; //导入方法依赖的package包/类
public void ResetEnergyExpended(BluetoothDevice device) {
Log.i(TAG, "ResetEnergyExpended ");
BluetoothGattService mHRP = mBluetoothGatt.getService(device, HRP_SERVICE);
if (mHRP == null) {
Log.e(TAG, "HRP service not found!");
return;
}
BluetoothGattCharacteristic mHRCPcharac = mHRP.getCharacteristic(HeartRate_ControlPoint);
if (mHRCPcharac == null) {
Log.e(TAG, "HEART RATE Copntrol Point charateristic not found!");
return;
}
byte[] value = new byte[1];
value[0] = (byte) RESET_ENERGY_EXPANDED;
mHRCPcharac.setValue(value);
mBluetoothGatt.writeCharacteristic(mHRCPcharac);
}
示例4: disableNotification
import com.samsung.android.sdk.bt.gatt.BluetoothGattService; //导入方法依赖的package包/类
public void disableNotification(BluetoothDevice device) {
BluetoothGattService mHRP = mBluetoothGatt.getService(device, HRP_SERVICE);
if (mHRP == null) {
Log.e(TAG, "HRP service not found!");
return;
}
BluetoothGattCharacteristic mHRMcharac = mHRP.getCharacteristic(HEART_RATE_MEASUREMENT_CHARAC);
if (mHRMcharac == null) {
Log.e(TAG, "HEART RATE MEASUREMENT charateristic not found!");
return;
}
BluetoothGattDescriptor mHRMccc = mHRMcharac.getDescriptor(CCC);
if (mHRMccc == null) {
Log.e(TAG, "CCC for HEART RATE MEASUREMENT charateristic not found!");
return;
}
byte[] value = mHRMccc.getValue();
if (value != null && value[0] == BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE[0]) {
enableNotification(false, mHRMcharac);
}
}
示例5: getBodySensorLoc
import com.samsung.android.sdk.bt.gatt.BluetoothGattService; //导入方法依赖的package包/类
public void getBodySensorLoc(BluetoothDevice device) {
Log.i(TAG, "getBodySensorLoc");
BluetoothGattService mHRP = mBluetoothGatt.getService(device, HRP_SERVICE);
if (mHRP == null) {
Log.e(TAG, "getBodySensorLoc: mHRP = null");
return;
}
BluetoothGattCharacteristic mBSLcharac = mHRP.getCharacteristic(BODY_SENSOR_LOCATION);
if (mBSLcharac == null) {
Log.e(TAG, "getBodySensorLoc: mBSLcharac = null");
return;
}
mBluetoothGatt.readCharacteristic(mBSLcharac);
}
示例6: read_uuid_read_25
import com.samsung.android.sdk.bt.gatt.BluetoothGattService; //导入方法依赖的package包/类
public void read_uuid_read_25(BluetoothDevice device) {
Log.i(TAG, "read 0x2A25 uuid charachteristic");
BluetoothGattService mDI = mBluetoothGatt.getService(device, DEVICE_INFORMATION);
if (mDI == null) {
Log.e(TAG, "Device Information Service Not Found!!!");
return;
}
BluetoothGattCharacteristic mSNS = mDI.getCharacteristic(SERIAL_NUMBER_STRING);
if (mSNS == null) {
Log.e(TAG, "Serial Number String Characteristic Not Found!!!");
return;
}
mBluetoothGatt.readCharacteristic(mSNS);
}
示例7: read_uuid_read_29
import com.samsung.android.sdk.bt.gatt.BluetoothGattService; //导入方法依赖的package包/类
public void read_uuid_read_29(BluetoothDevice device) {
Log.i(TAG, "read 0x2A29 uuid charachteristic");
BluetoothGattService mDI = mBluetoothGatt.getService(device, DEVICE_INFORMATION);
if (mDI == null) {
Log.e(TAG, "Device Information Service Not Found!!!");
return;
}
BluetoothGattCharacteristic mMNS = mDI.getCharacteristic(MANUFATURE_NAME_STRING);
if (mMNS == null) {
Log.e(TAG, "Manufacture Name String Characteristic Not Found!!!");
return;
}
mBluetoothGatt.readCharacteristic(mMNS);
}
示例8: read_uuid_read_2A
import com.samsung.android.sdk.bt.gatt.BluetoothGattService; //导入方法依赖的package包/类
public void read_uuid_read_2A(BluetoothDevice device) {
Log.i(TAG, "read 0x2A2A uuid charachteristic");
BluetoothGattService mDI = mBluetoothGatt.getService(device, DEVICE_INFORMATION);
if (mDI == null) {
Log.e(TAG, "Device Information Service Not Found!!!");
return;
}
BluetoothGattCharacteristic mICDL = mDI.getCharacteristic(ICDL);
if (mICDL == null) {
Log.e(TAG, "IEEE Characteristic data string Not Found!!!");
return;
}
mBluetoothGatt.readCharacteristic(mICDL);
}
示例9: disableHRNotification
import com.samsung.android.sdk.bt.gatt.BluetoothGattService; //导入方法依赖的package包/类
public void disableHRNotification(BluetoothDevice device) {
BluetoothGattService mHRP = mBluetoothGatt.getService(device, HRP_SERVICE);
if (mHRP == null) {
Log.e(TAG, "HRP service not found!");
return;
}
BluetoothGattCharacteristic mHRMcharac = mHRP.getCharacteristic(HEART_RATE_MEASUREMENT_CHARAC);
if (mHRMcharac == null) {
Log.e(TAG, "HEART RATE MEASUREMENT charateristic not found!");
return;
}
enableNotification(false, mHRMcharac);
}