Hi,
I want to add 2 more character attributes to the simpleGATTprofile, and modify the codes as below. The result shows the attributes of character 6 but not character 7. Does anyone know if there is any maximum limit on the number of character attributes? If not, how to make the codes work properly?
Best Regards,
CK Lui
/*********************************************************************
* CONSTANTS
*/
//#define SERVAPP_NUM_ATTR_SUPPORTED 17
#define SERVAPP_NUM_ATTR_SUPPORTED 23
/*********************************************************************
* TYPEDEFS
*/
/*********************************************************************
* GLOBAL VARIABLES
*/
// Simple GATT Profile Service UUID: 0xFFF0
CONST uint8 simpleProfileServUUID[ATT_BT_UUID_SIZE] =
{
LO_UINT16(SIMPLEPROFILE_SERV_UUID), HI_UINT16(SIMPLEPROFILE_SERV_UUID)
};
// Characteristic 1 UUID: 0xFFF1
CONST uint8 simpleProfilechar1UUID[ATT_BT_UUID_SIZE] =
{
LO_UINT16(SIMPLEPROFILE_CHAR1_UUID), HI_UINT16(SIMPLEPROFILE_CHAR1_UUID)
};
....
....
// Simple Profile Characteristic 6 Properties
static uint8 simpleProfileChar6Props = GATT_PROP_WRITE;
// Characteristic 6 Value //debug
static uint8 simpleProfileChar6 = 0;
// Simple Profile Characteristic 6 User Description
static uint8 simpleProfileChar6UserDesp[17] = "Characteristic 6\0";
// Simple Profile Characteristic 7 Properties
static uint8 simpleProfileChar7Props = GATT_PROP_WRITE;
// Characteristic 7 Value //debug
static uint8 simpleProfileChar7 = 0;
// Simple Profile Characteristic 7 User Description
static uint8 simpleProfileChar7UserDesp[17] = "Characteristic 7\0";
/*********************************************************************
* Profile Attributes - Table
*/
static gattAttribute_t simpleProfileAttrTbl[SERVAPP_NUM_ATTR_SUPPORTED] =
{
// Simple Profile Service
{
{ ATT_BT_UUID_SIZE, primaryServiceUUID }, /* type */
GATT_PERMIT_READ, /* permissions */
0, /* handle */
(uint8 *)&simpleProfileService /* pValue */
},
....
....
// Characteristic 6 Declaration
{
{ ATT_BT_UUID_SIZE, characterUUID },
GATT_PERMIT_READ,
0,
&simpleProfileChar6Props
},
// Characteristic Value 6
{
{ ATT_BT_UUID_SIZE, simpleProfilechar6UUID },
GATT_PERMIT_WRITE,
0,
&simpleProfileChar6
},
// Characteristic 6 User Description
{
{ ATT_BT_UUID_SIZE, charUserDescUUID },
GATT_PERMIT_READ,
0,
simpleProfileChar6UserDesp
},
// Characteristic 7 Declaration
{
{ ATT_BT_UUID_SIZE, characterUUID },
GATT_PERMIT_READ,
0,
&simpleProfileChar7Props
},
// Characteristic Value 7
{
{ ATT_BT_UUID_SIZE, simpleProfilechar7UUID },
GATT_PERMIT_WRITE,
0,
&simpleProfileChar7
},
// Characteristic 7 User Description
{
{ ATT_BT_UUID_SIZE, charUserDescUUID },
GATT_PERMIT_READ,
0,
simpleProfileChar7UserDesp
},
};
