Hello everyone,
I'm using simplelink_cc13x2_26x2_sdk_5_20_00_52 with an Launchxl eval board cc26x2 and the Project is based on CCS Projectzero. Creating and Using a custom gatt service.
GATT Valid Range Descriptor (Lower and Upper Range) is not working as expected. Am I doing something wrong? code snippet is a sample with float32 range 0.0 - 1.0.
range 0-25 / 0-4294967295 with uint8 / uint32 was tested and it was also not working.
reading, writing the characteristic value and reading the format type work fine. The valid range descriptor is also found after making the service and characteristic discovery, but reading the valid range descriptor does not work.
// Service declaration static CONST gattAttrType_t Service0Decl = { ATT_UUID_SIZE, Service0UUID }; // Characteristic "Characteristic" Properties (for declaration) static uint8_t Service_CharacteristicProps = GATT_PROP_READ | GATT_PROP_WRITE; // Characteristic "Characteristic" Value variable static uint8_t Service_CharacteristicVal[SERVICE_CHARACTERISTIC_LEN] = {0x3f, 0x80, 0x00, 0x00}; // https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Descriptors/org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml // Characteristic Presentation Format: 0x14: float32; 0x00: no exponent; 0x27AD: unit = percentage; 0x01: Bluetooth SIG namespace; 0x0000: No description static uint8_t Service_CharacteristicFormatType[8] = {0x14, 0x00, 0xAD, 0x27, 0x01, 0x00, 0x00, 0x00}; // Valid range lower = 0.0; upper = 1.0; static uint8_t Service_CharacteristicRange[8] = {0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00}; static gattAttribute_t Service0AttrTbl[] = { // Service Declaration { { ATT_BT_UUID_SIZE, primaryServiceUUID }, GATT_PERMIT_READ, 0, (uint8_t *)&Service0Decl }, // Characteristic Declaration { { ATT_BT_UUID_SIZE, characterUUID }, GATT_PERMIT_READ, 0, &Service_CharacteristicProps }, // Characteristic Value { { ATT_UUID_SIZE, Service_CharacteristicUUID }, GATT_PERMIT_READ | GATT_PERMIT_WRITE, 0, Service_CharacteristicVal }, // Characteristic Presentation Format { { ATT_BT_UUID_SIZE, charFormatUUID }, GATT_PERMIT_READ, 0, (uint8_t *)&Service_CharacteristicFormatType }, // Characteristic Range { { ATT_BT_UUID_SIZE, validRangeUUID }, GATT_PERMIT_READ | GATT_PERMIT_WRITE, 0, (uint8_t *)&Service_CharacteristicRange }, // Characteristic User Description { { ATT_BT_UUID_SIZE, charUserDescUUID}, GATT_PERMIT_READ, 0, "[0...1] : amplitude" }, }
Best regards,
Ben A.