Control requests

system_ctrl_alloc_reply_data - Control requests

Allocates or frees the reply data buffer. This function acts as realloc(), i.e. it changes the size of an already allocated buffer, or frees it if size is set to 0.

int system_ctrl_alloc_reply_data(ctrl_request* req, size_t size, void* reserved);
  • req is the request passed to ctrl_request_custom_handler
  • size is the number of byes to allocate
  • reserved must be set to nullptr (0)

The return value is a system error constant; 0 if successful.

If the allocation is successful, fill in req->reply_data with the data to reply with.