I'm studying SWRU393 section 5.3.4.2.4 Read/Write Callback functions. It seems that if a client requests a read then the characteristic value is not immediately sent, but rather a callback such as simpleProfile_ReadAttrCB() is first called and the value of pValue and pLen must be set. Upon return of this callback the stack sends the value to the client.
1) Is this a correct interpretation?
2) What is the purpose of requiring us to set the pLen and pValue values, rather than just sending back what the existing characteristic values are?
3) Since I'm not setting the value of pLen and pValue, where was and how much memory was allocated to pValue, and how do I know that I won't exceed it?