nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches

◆ contin_array_net_buf_create()

int contin_array_net_buf_create ( struct net_buf * pcm_contin,
struct net_buf const *const pcm_finite,
uint32_t locations,
uint16_t *const _finite_pos )

#include <include/contin_array.h>

Creates a continuous array in the locations in the net_buf as given in locations, from a single channel finite array in a net_buf.

Note
This function serves the purpose of e.g. having a set of audio samples stored in pcm_finite. This can then be fetched in smaller pieces into RAM and played back in a loop using the results in pcm_cont. The function keeps track of the current position in finite_pos, so that the function can be called multiple times and maintain the correct position in pcm_finite.
Parameters
pcm_continPointer to the destination net buf.
Note
The continuous array can be empty. If so, the locations given in locations are filled with the finite array. All other valid locations are zeroed.
Parameters
pcm_finitePointer to the single channel de-interleaved finite array net buf.
locationsLocation(s) to write the finite array to.
Note
If locations is set to zero (mono) the pcm_contin locations must also be set to zero (mono) for the function to operate. If non-zero then all locations must be in the pcm_contin array to for the function to operate.
Parameters
_finite_posVariable used internally. Must be set to 0 for the first run and not changed.
Return values
0If the operation was successful.
EPERMIf any sizes or location is out of range.
ENXIOOn NULL pointer.
EINVALIf the _finite_pos or locations are out of range.