IOS BLE Bluetooth - send / receive HEX data

I am creating an iOS application that should connect to a custom BLE device. I need an iOS application to send two HEX commands, one to turn on part of the device, and the other to request data.

Is there a way in iOS to send / receive HEX user data, other than working with services and features?

+7
ios bluetooth bluetooth-lowenergy
source share
2 answers

No, this is not possible, but the reason for this is not in iOS, but because the “services” and “features” are only part of how the BLE protocol is defined.

Official specification: https://developer.bluetooth.org/TechnologyOverview/Pages/BLE.aspx

Common Attributes Profile

The latest Bluetooth specification uses an Attribute Protocol (ATT) service architecture. All communications in low energy conditions occur through the Common Attributes Profile (GATT). An application or other profile uses the GATT profile so that the client and server can interact in a structured way.

The server contains a number of attributes, and the GATT profile determines how to use the Protocol Detection, Read, Write, and Receive attribute. These features support the service architecture. Services are used as defined in the profile specifications. GATT allows you to identify the service and features defined in the profile specification.

+4
source share

Another answer is wrongly right, but for the wrong reasons.

Of course, you can send any data to BLE, not just GATT. It's just that iOS makes you work with GATT . There are no iOS APIs for anything else. So yes, this is iOS that is stopping you from doing this.

If you are not forced to work with GATT, other options are possible:

  • L2CAP Credit-Based Channels - you create a channel that allows you to send the full 23 octets of data to one packet (which in BLE 4.0 and 4.1; 4.2 allows more), in any format that you choose.
  • When accessing the HCI, you can send a custom ACL data packet to avoid the L2CAP header. But you also need to change the other side to make sure that it parses it correctly.
+1
source share

All Articles