Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. -(void) bleAction1
  2. {
  3. self.bleAction([[BleAction alloc] initWithServiceUUID: @"07CD3295-E29F-4EEA-A0EC-617DA6921626"
  4. andCharacteristicUUID: @"98EE2679-917C-4E39-A587-20E31E0BA519"]);
  5. }
  6.  
  7. -(void) bleAction2
  8. {
  9. self.bleAction([[BleAction alloc] initWithServiceUUID: @"2FD8921C-9F28-4257-A1EB-61E6476FD2FF"
  10. andCharacteristicUUID: @"C9D1BE56-9027-4AE3-BE66-9E8BED3A1FC3"]);
  11. }
  12.  
  13. -(void) bleAction(BleAction *action)
  14. {
  15. for(CBService *service in peripheral.services)
  16. {
  17. if([service.UUID isEqual:[CBUUID UUIDWithString:action.serviceUUID]])
  18. {
  19. for(CBCharacteristic *characteristic in service.characteristics)
  20. {
  21. if([characteristic.UUID isEqual:[CBUUID UUIDWithString:action.characteristicUUID]])
  22. {
  23. [peripheral readValueForCharacteristic:characteristic];
  24. return;
  25. }
  26. }
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement