This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Dear Nordic Semi, please consider allowing CCCD descriptor write using... write?

Hello, long story short:

  • You now must use write request instead of write to write the CCCD descriptor.

  • Allegedly (according to a nordic employee) both types correspond to respectively write type in android API:

    WRITE_TYPE_DEFAULT

and

WRITE_TYPE_NO_RESPONSE
  • Tried both, no effect. Confirmed in my android program that both types are applied.

This is the sniff result, as you can see, both are somehow considered "write" instead of ONE OF THE 2 being "write request":

image description

image description

So in other words, either the ble stack in the softdevice S140 which is running on my board interpreted 2 DISTINCTIVELY different write types as the same, or android API doesn't really have this feature (probably because android people aren't anal-retentive enough to follow a specs to the very T), or I could have made a terrible mistake, but these are all the available write tpyes in android api:

public class BluetoothGattCharacteristic implements Parcelable {
public static final Creator<BluetoothGattCharacteristic> CREATOR = null;
public static final int FORMAT_FLOAT = 52;
public static final int FORMAT_SFLOAT = 50;
public static final int FORMAT_SINT16 = 34;
public static final int FORMAT_SINT32 = 36;
public static final int FORMAT_SINT8 = 33;
public static final int FORMAT_UINT16 = 18;
public static final int FORMAT_UINT32 = 20;
public static final int FORMAT_UINT8 = 17;
public static final int PERMISSION_READ = 1;
public static final int PERMISSION_READ_ENCRYPTED = 2;
public static final int PERMISSION_READ_ENCRYPTED_MITM = 4;
public static final int PERMISSION_WRITE = 16;
public static final int PERMISSION_WRITE_ENCRYPTED = 32;
public static final int PERMISSION_WRITE_ENCRYPTED_MITM = 64;
public static final int PERMISSION_WRITE_SIGNED = 128;
public static final int PERMISSION_WRITE_SIGNED_MITM = 256;
public static final int PROPERTY_BROADCAST = 1;
public static final int PROPERTY_EXTENDED_PROPS = 128;
public static final int PROPERTY_INDICATE = 32;
public static final int PROPERTY_NOTIFY = 16;
public static final int PROPERTY_READ = 2;
public static final int PROPERTY_SIGNED_WRITE = 64;
public static final int PROPERTY_WRITE = 8;
public static final int PROPERTY_WRITE_NO_RESPONSE = 4;
public static final int WRITE_TYPE_DEFAULT = 2;
public static final int WRITE_TYPE_NO_RESPONSE = 1;
public static final int WRITE_TYPE_SIGNED = 4;

And the nrfTool box example on github is using WRITE_TYPE_DEFAULT.

Please be advised!

I don't want to go lower level with Android NDK and work in there, that would be making something simple over-complicated.

Parents
  • @mitch996 I do understand your disillusion but I would claim that "S140 breaking compatibility with Android mainstream" wasn't really proven yet;) I have seen Android phones sending Write Request (with Response) before and your Android code + logs don't show with certainty if decision which GATT Write method type (with or without Response) is made in low level BT stack of Android phones (so probably even outside direct control of phone manufacturer) or in native Android code (so somewhere between Google/AOSP and handset vendors) or up in Android BLE API/app layer (so potentially able to influence by App developers).

Reply
  • @mitch996 I do understand your disillusion but I would claim that "S140 breaking compatibility with Android mainstream" wasn't really proven yet;) I have seen Android phones sending Write Request (with Response) before and your Android code + logs don't show with certainty if decision which GATT Write method type (with or without Response) is made in low level BT stack of Android phones (so probably even outside direct control of phone manufacturer) or in native Android code (so somewhere between Google/AOSP and handset vendors) or up in Android BLE API/app layer (so potentially able to influence by App developers).

Children
No Data
Related