Other Parts Discussed in Thread: CC2564
Hi,
I am working on a project based on CC2564B and MSP430F543x.
I need to make a custom profile in order to read/write a value of 20 Bytes.
I use the SPPLE demo as a reference and made my own profile with custom uuid well (see the following )
static Byte_t phoneNumberServiceValue[20];
static BTPSCONST GATT_Primary_Service_128_Entry_t PHONENUMBER_Service_UUID =
{
PHONENUMBER_SERVICE_BLUETOOTH_UUID_CONSTANT
};
/* The PHONENUMBER RX Characteristic Declaration. */
static BTPSCONST GATT_Characteristic_Declaration_128_Entry_t PHONENUMBER_Rx_Declaration =
{
(GATT_CHARACTERISTIC_PROPERTIES_WRITE_WITHOUT_RESPONSE),
PHONENUMBER_RX_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT
};
/* The PHONENUMBER RX Characteristic Value. */
static BTPSCONST GATT_Characteristic_Value_128_Entry_t PHONENUMBER_Rx_Value =
{
PHONENUMBER_RX_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT,
0,
NULL
};
/* The PHONENUMBER Rx Credits Characteristic Declaration. */
static BTPSCONST GATT_Characteristic_Declaration_128_Entry_t PHONENUMBER_Rx_Credits_Declaration =
{
(GATT_CHARACTERISTIC_PROPERTIES_READ|GATT_CHARACTERISTIC_PROPERTIES_WRITE|GATT_CHARACTERISTIC_PROPERTIES_EXTENDED_PROPERTIES),//|GATT_CHARACTERISTIC_PROPERTIES_WRITE_WITHOUT_RESPONSE),
PHONENUMBER_RX_CREDITS_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT
};
/* The PHONENUMBER Rx Credits Characteristic Value. */
static BTPSCONST GATT_Characteristic_Value_128_Entry_t PHONENUMBER_Rx_Credits_Value =
{
PHONENUMBER_RX_CREDITS_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT,
(20*(sizeof(Byte_t))),
phoneNumberServiceValue
};
BTPSCONST GATT_Service_Attribute_Entry_t PHONENUMBER_Service[] =
{
{GATT_ATTRIBUTE_FLAGS_READABLE, aetPrimaryService128, (Byte_t *)&PHONENUMBER_Service_UUID}, //
{GATT_ATTRIBUTE_FLAGS_READABLE, aetCharacteristicDeclaration128, (Byte_t *)&PHONENUMBER_Rx_Declaration}, //
{GATT_ATTRIBUTE_FLAGS_READABLE_WRITABLE, aetCharacteristicValue128, (Byte_t *)&PHONENUMBER_Rx_Value}, //
{GATT_ATTRIBUTE_FLAGS_READABLE, aetCharacteristicDeclaration128, (Byte_t *)&PHONENUMBER_Rx_Credits_Declaration}, //
{GATT_ATTRIBUTE_FLAGS_READABLE_WRITABLE, aetCharacteristicValue128, (Byte_t *)&PHONENUMBER_Rx_Credits_Value}, //
};
I use a function like register spple in order to add my services at startup, and I have also define my callback well.
I use TI BLE device monitor to test.
I can see my new profile, but I can only read and write 2 bytes.
If I try to write more than 2 bytes I have the error : Writing attributes of length gt 2 not implemented
Another question is the way to display the value when the read is done. I am making an association with a dummy write tab and it display the first two byte of my tab, but I don't really understand the point here..
Am I making something wrong? Is it possible to assiciate my tab ( static Byte_t phoneNumberServiceValue[20];) to the service value?
Thanks in advance for the help on this forum, good as usual.
Best regards,
Anthony