btstack_virtual_memcpy() function
Copy chunk of data into a virtual buffer backed by a physical buffer. Used to provide chunk of data of larger buffer that is constructed on the fly, e.g. serializing data struct For example, copy field2 to buffer, with buffer_offset = 11 field1 field2 field3 field4 field5 filed6 struct: -------|-------|----------|-------------|-------|-------------- buffer: ------------------ result: ----| When also copying field3 and field4 to buffer, with buffer_offset = 11 field1 field2 field3 field4 field5 filed6 struct: -------|-------|----------|-------------|-------|-------------- buffer: ------------------ result: ----|----------|--
Arguments
field_offset
position of field in complete data block
buffer_offset
position of buffer in complete data block
Return value
bytes_copied number of bytes actually stored in buffer