ANYONE WITH TROUBLE ON BLE & swift STUFF, this tutorial helped me a lot - https://www.udemy.com/iot-turn-a-light-on-with-your-iphone/learn/#/
I have successfully created a simple scanner view on my iphone6 that will scan the room for all Bluetooth devices and put their name in a table. When you click on that device you connect to the device and on the monitor i can see all of the services and even the characteristics of the device along with their UUID and all. I understand the basics of Bluetooth communication but i don't really understand UUID in terms of writing and weather or not it is the same for every device in the company, or brand or whatever. I was hoping someone could help explain this better to me and also hopefully help walk me through my bigger issue which is to write data to the bluetooth device.
I have a BLE shield for an arduino and i want to control the servo motor with my app. I have seen a few tutorials and some code on github that's got me this far but i can't seem to get the last part. Also I don't want to just copy what they have because I ultimately want to do this without an arduino and just a programmable chip and motor. below is the last part of my code that I am on, looking through the characteristics and printing them out for me to see
func peripheral(peripheral: CBPeripheral, didDiscoverServices error: NSError?) {
print("Service count = \(peripheral.services!.count)")
for service in peripheral.services!{
print("Services = \(peripheral.services!)")
let DemServices = service as CBService
peripheral.discoverCharacteristics(nil, forService: DemServices)
print("All that shit got coded")
}
}
func peripheral(peripheral: CBPeripheral, didDiscoverCharacteristicsForService service: CBService, error: NSError?) {
for characteristicz in service.characteristics!{
print(characteristicz)
}
}
So i want to write to the device and tell the motor connected to whatever pin to move to whatever degree based on what the app sends and if possible, a little more insight on how BLE devices work (UUID, BLE chips, Pins and how to manipulate things attached to them)
PLEASE help and thanks for trying!!