Harald.HCI.Transport.UART.Framing (harald v0.3.0) View Source
A framer module that defines a frame as a HCI packet.
Reference: Version 5.0, Vol 2, Part E, 5.4
Link to this section Summary
Functions
Returns a tuple like {remaining_desired_length, part_of_bin, rest_of_bin}.
Link to this section Functions
Returns a tuple like {remaining_desired_length, part_of_bin, rest_of_bin}.
iex> binary_split(<<1, 2, 3, 4>>, 0)
{0, <<>>, <<1, 2, 3, 4>>}
iex> binary_split(<<1, 2, 3, 4>>, 2)
{0, <<1, 2>>, <<3, 4>>}
iex> binary_split(<<1, 2, 3, 4>>, 4)
{0, <<1, 2, 3, 4>>, <<>>}
iex> binary_split(<<1, 2, 3, 4>>, 6)
{2, <<1, 2, 3, 4>>, <<>>}