The GATTServApp_RegisterService() registers a list of attribute descriptors and a list of callbacks. When a remote device reads a characteristic value, GATT invokes the read callback and the read callback function returns the characteristic value (via pValue and pLen). Similarly, when remote device writes a characteristic value, GATT invokes the write callback, passing the characteristic value to the write callback.
So my question is, does the attribute array really need the pointer to the value since the value is handled in the read/write callbacks?
For example, in the heartrate sample snippet below, is "&heartRateSensLoc" really needed or used by the GATT server code? or could one pass NULL pointer instead?
// Sensor Location Declaration
{
{ ATT_BT_UUID_SIZE, characterUUID },
GATT_PERMIT_READ,
0,
&heartRateSensLocProps
},
// Sensor Location Value
{
{ ATT_BT_UUID_SIZE, heartRateSensLocUUID },
GATT_PERMIT_READ,
0,
&heartRateSensLoc
},