Created
May 25, 2016 05:10
-
-
Save shirish47/1d1ac7cf200cd4634c0233da14cfdbb2 to your computer and use it in GitHub Desktop.
BLE central multiple launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(sState==NSETSERVICESTATE){ | |
Serial.println("Going to locate service"); | |
sState=DISCOVERINGSERVICE; | |
ble.gattClient().launchServiceDiscovery(chandle.connHandle, ServiceCallBack, CharacteristicCallBack, service1_uuid,chars_uuid1); | |
}else if(sState==FOUNDSERVICE && !ble.gattClient().isServiceDiscoveryActive()){ | |
Serial.println(" Discovering Chars"); | |
// if(charB1.cs==NSETCHARSTATE) | |
// { | |
// Serial.println("Searching CharB1."); | |
// charB1.cs=DISCOVERINGCHAR; | |
// ble.gattClient().launchServiceDiscovery(chandle.connHandle, ServiceCallBack, CharacteristicCallBack, service1_uuid,chars_uuid1); | |
// }else | |
if(charB2.cs==NSETCHARSTATE && charB1.cs==CHARFOUND && notifyset) | |
{ | |
notifyset=false; | |
printchar(chars1); | |
delay(1000); | |
Serial.println("Searching CharB2."); | |
charB2.cs=DISCOVERINGCHAR; | |
ble.gattClient().launchServiceDiscovery(chandle.connHandle, ServiceCallBack2, CharacteristicCallBack2, service1_uuid,chars_uuid2); | |
}else if(charB3.cs==NSETCHARSTATE && charB2.cs==CHARFOUND) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment