0

I want to catch commands from bluetooth peripheral in iOS.

Could anyone help me out?

Steven Jiang
  • 1,006
  • 9
  • 21

1 Answers1

1

There are a few ways of doing Bluetooth on iOS, and different ones have different methods:

  • An accessory that's part of the Made for iPhone program (see the answer to this question if you want to know what that entails)
  • A device that uses Bluetooth 4.0 Low Energy mode
  • Talking to another iPhone with GameKit
  • A device using one of the Bluetooth profiles Apple support natively: Hands-free profile, headset profile, A2DP, AVRCP, etc.

To answer those in order:

  1. If you're part of the Made for iPhone program, you'll already know where to find this information, and it's not public: ask your contact at Apple for help.
  2. If your device uses Bluetooth 4.0 Low Energy, look into the Core Bluetooth framework.
  3. If you're trying to get two iPhones talking together, look into GameKit.
  4. If you're working with a device that uses an Apple provided profile, you shouldn't have to do anything, it'll just work. For example, an A2DP device will stream audio played from the phone without needing programmer intervention. You can do a few things to control it: there's a Core Audio function somewhere that lets you choose whether to send audio to a Bluetooth device. If you're trying to support AVRCP, look into handling remote control events.

If your device doesn't fall into any of the above categories, you're probably out of luck and can't use it with iOS.

Community
  • 1
  • 1
Amy Worrall
  • 16,250
  • 3
  • 42
  • 65