Reputation: 7407
I am creating an iOS application that should connect to a custom BLE device. I need to iOS app to send 2 HEX commands, one to enable a part of the device and another to request for Data.
Is there any way in iOS to send/receive custom HEX data, other than working with services & characteristics?
Upvotes: 7
Views: 2284
Reputation:
Yes you can send data over ble device. I've implemented already. By implementing peripheral object's writevalue method to send data on given characteristics of your ble devices. And also for getting data back from the BLE devices you could use peripheral object's readValue method. Data will be started in update delegate method of bluetooth framework
Upvotes: 0
Reputation: 5542
The other answer is accidentally right, but for the wrong reasons.
Of course it is possible in BLE to send any kind of data, not just GATT. It's just that iOS forces you to work with GATT. There are no iOS APIs for anything else. So, yes, it is iOS that prevents you from doing it.
If you wouldn't be forced to work with GATT, there would be some other options:
Upvotes: 1
Reputation: 4331
No that is not possible, but the reason for this is not iOS but that the 'services' and 'characteristics' are just part of how the BLE protocol is defined.
Official spec: https://developer.bluetooth.org/TechnologyOverview/Pages/BLE.aspx
Generic Attribute Profile
The latest Bluetooth specification uses a service-based architecture based on the attribute protocol (ATT). All communication in low energy takes place over the Generic Attribute Profile (GATT). An application or another profile uses the GATT profile so a client and server can interact in a structured way.
The server contains a number of attributes, and the GATT Profile defines how to use the Attribute Protocol to discover, read, write and obtain indications. These features support a service-based architecture. The services are used as defined in the profile specifications. GATT enables you to expose service and characteristics defined in the profile specification.
Upvotes: 4