Advertisement
Guest User

Untitled

a guest
May 25th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. if(sState==NSETSERVICESTATE){
  2. Serial.println("Going to locate service");
  3. sState=DISCOVERINGSERVICE;
  4. ble.gattClient().launchServiceDiscovery(chandle.connHandle, ServiceCallBack, CharacteristicCallBack, service1_uuid,chars_uuid1);
  5. }else if(sState==FOUNDSERVICE && !ble.gattClient().isServiceDiscoveryActive()){
  6. Serial.println(" Discovering Chars");
  7. // if(charB1.cs==NSETCHARSTATE)
  8. // {
  9. // Serial.println("Searching CharB1.");
  10. // charB1.cs=DISCOVERINGCHAR;
  11. // ble.gattClient().launchServiceDiscovery(chandle.connHandle, ServiceCallBack, CharacteristicCallBack, service1_uuid,chars_uuid1);
  12. // }else
  13. if(charB2.cs==NSETCHARSTATE && charB1.cs==CHARFOUND && notifyset)
  14. {
  15.  
  16. notifyset=false;
  17. printchar(chars1);
  18. delay(1000);
  19. Serial.println("Searching CharB2.");
  20. charB2.cs=DISCOVERINGCHAR;
  21. ble.gattClient().launchServiceDiscovery(chandle.connHandle, ServiceCallBack2, CharacteristicCallBack2, service1_uuid,chars_uuid2);
  22. }else if(charB3.cs==NSETCHARSTATE && charB2.cs==CHARFOUND)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement