I've just started playing with the BLE code, and come across a couple of things which have caused me problems so far. I thought I'd mention them here in case I'm doing something wrong, or they shouldn't happen or maybe it will help someone else:
- I thought I'd start off with the easiest uuid (or so I thought haha!) - so I set out to use the generic access, and get the device name ...
- So service uuid = 00001800-0000-1000-8000-00805f9b34fb
- Characteristic uuid = 00002a00-0000-1000-8000-00805f9b34fb
- Running this in the simulator works fine to register the profile, but as soon as I try on my watch it crashes. No stack trace or anything. Just "Error: System Error" and "Details: Profile Registration Unhandled Error". Eventually I get around to trying a different (random-ish) uuid and of course that works fine ... So I'm guessing it is just the generic access one that doesn't work - maybe because the system code is using it itself in some way? (as device name is returned in scan results?)
- A second problem that didn't help, is that in the simulator when I call BluetoothLowEnergy.registerProfile() then onProfileRegister() in the delegate is not called, making it hard to check the code. Again it turns out that running on my watch it works differently, and onProfileRegister() is actually called correctly.