Dear All,
I have added a custom service and characteristics in the "Project zero" sample code. I am following the "Bluetooth low energy custom profile" document for implementing new services and characteristics.
Under "Task 4 - Add API and callback handling" I can send the static data "4" through the new characteristics. I followed the instruction and wrote as showed below, I couldn't get the data as expected.
I know that I did some mistake in understanding. Please let me know where exactly I made the mistake.
-------------program--------
static bStatus_t sunlightService_ReadAttrCB( uint16_t connHandle, gattAttribute_t *pAttr,
uint8_t *pValue, uint16_t *pLen, uint16_t offset,
uint16_t maxLen, uint8_t method )
{
bStatus_t status = SUCCESS;
if (! memcmp(pAttr->type.uuid, sunlightService_SunlightValueUUID, pAttr->type.len))
{
*pLen = MIN(maxLen, 4 - offset);
memcpy(pValue, pAttr->pValue + offset, *pLen);
}
.
.
.
}
-------------------------------
Thank you,
Prakash S