We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi
public void displayGattServices(List gattServices) { if (gattServices == null) return; String uuid; String unknownServiceString; unknownServiceString = getResources().getString(string.unknown_service); String unknownCharaString; unknownCharaString = getResources().getString(string.unknown_characteristic); ArrayList<HashMap<String, String>> gattServiceData = new ArrayList<>(); ArrayList<ArrayList<HashMap<String, String>>> gattCharacteristicData = new ArrayList<>(); ArrayList<ArrayList> mGattCharacteristics = new ArrayList<>();
// Loops through available GATT Services. for (BluetoothGattService gattService : gattServices) { HashMap<String, String> currentServiceData = new HashMap<>(); uuid = gattService.getUuid().toString(); String LIST_NAME = "NAME"; currentServiceData.put( LIST_NAME, SampleGattAttributes.lookup(uuid, unknownServiceString)); String LIST_UUID = "UUID"; currentServiceData.put(LIST_UUID, uuid); gattServiceData.add(currentServiceData); ArrayList<HashMap<String, String>> gattCharacteristicGroupData = new ArrayList<>(); List<BluetoothGattCharacteristic> gattCharacteristics = gattService.getCharacteristics(); ArrayList<BluetoothGattCharacteristic> charas = new ArrayList<>(); // Loops through available Characteristics. for (BluetoothGattCharacteristic gattCharacteristic : gattCharacteristics) { charas.add(gattCharacteristic); HashMap<String, String> currentCharaData = new HashMap<>(); uuid = gattCharacteristic.getUuid().toString(); String gattInfo = SampleGattAttributes.lookup(uuid, unknownCharaString); if (gattInfo.equalsIgnoreCase("Heart Rate Measurement")) { currentCharaData.put( LIST_NAME, SampleGattAttributes.lookup(uuid, unknownCharaString)); currentCharaData.put(LIST_UUID, uuid); Utility.showLog("loop", uuid); mBluetoothLeService.setCharacteristicNotification(gattCharacteristic, true); } gattCharacteristicGroupData.add(currentCharaData); } mGattCharacteristics.add(charas); gattCharacteristicData.add(gattCharacteristicGroupData); } }
It will not give Battery value. If i want battery and heart rate same time what i have to do?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi
public void displayGattServices(List gattServices) {
if (gattServices == null) return;
String uuid;
String unknownServiceString;
unknownServiceString = getResources().getString(string.unknown_service);
String unknownCharaString;
unknownCharaString = getResources().getString(string.unknown_characteristic);
ArrayList<HashMap<String, String>> gattServiceData = new ArrayList<>();
ArrayList<ArrayList<HashMap<String, String>>> gattCharacteristicData
= new ArrayList<>();
ArrayList<ArrayList> mGattCharacteristics = new ArrayList<>();
It will not give Battery value. If i want battery and heart rate same time what i have to do?
The text was updated successfully, but these errors were encountered: