A have callback function with this prototype:
void serverAnswer(void *pUserData, int flag);
I need to pass a buffer const uint8_t *buf to this function using the void parameter.
How do i pass the buffer, and how can i access the elements of the buffer in the function?
Example (not working):
Call:
const uint8_t *buf;
int buf_len = 3;
serverAnswer(&buf, buf_len);
Access to buffer:
void serverAnswer(void *pUserData, int flag) {
uint8_t* p = (uint8_t *)pUserData;
uint8_t data = p[0];
}