简体   繁体   中英

Communicating using Core Bluetooth

I am new to Objective c and I want to send simple strings from an iPhone to an arduino an vice versa with Bluetooth. I have read apples information about Core Bluetooth, but I am having trouble understanding it. As I said, all I need the iPhone to do is: 1) connect to the BLE device of the arduino. 2) Send instructions (in the form of strings) 3)get a response from the arduino when the instructions have been carried out, so that the next set of instructions can be sent. I would be very happy if somebody is able to help me with this project

Thanks

You should follow the wwdc presentation on core bluetooth.

You should probably start here

I suggest operate your device with YMSCoreBluetooth . The basic step to operation bluetooth device is:

  1. Search all nearby device by blue tooth scan, you will find all nearby device.
  2. Stop your scan. Connect one of the devices found in response.
  3. Discover all services on the device.
  4. Discover all character in service found by service discover action.
  5. Write your content into character found in 4.
  6. You can read character value from device.

YMSCoreBluetooth let you write your logic in one code block instead of separate delegate.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM