I am trying to work with L2CAP channels over BLE. The service discovery, PSM lookup (via characteristics) and such all work fine.
The channel connects and I am able to exchange a couple of packets before the input stream is closed unexpectedly.
Meanwhile, the console reports the following CoreBluetooth messages:
error WARNING: Unknown error: 431
error WARNING: Unknown error: 436
As far as I can tell these error codes are undocumented and the L2CAP documentation is scarce at best. Does anyone know what they mean?
Post
Replies
Boosts
Views
Activity
It currently isn't possible to advertise any form of service data with my UUID over BLE using CBAdvertisementDataServiceDataKey.
Android lets you do this, which is ideal when you want to advertise the CBL2CAPPSM of an L2CAP service (the PSM is only a couple of bytes).
For some reason, iOS doesn't allow this:
Although advertising packets in general can hold a variety of information about the peripheral device, you may advertise only your device’s local name and the UUIDs of any services you want to advertise. That is, when you create your advertising dictionary, you may specify only the following two keys: CBAdvertisementDataLocalNameKey and CBAdvertisementDataServiceUUIDsKey. You receive an error if you specify any other keys. Is there really a good reason for this, or am I missing something?
Is the only workaround to expose a GATT characteristic for the L2CAP PSM? That feels like horrendous amounts of overkill to advertise what is really just a UInt16.