Function TransportTx_TxAccelerationBuffer(struct HostTransport_Handle *, const struct Transport_Acceleration *, uint8_t, uint16_t)

Function Documentation

int TransportTx_TxAccelerationBuffer(struct HostTransport_Handle *handle, const struct Transport_Acceleration *data, uint8_t count, uint16_t firstIndex)

Forwards acceleration data block to the IN endpoint of host.

Triggers sending data to the the IN endpoint. If USB is busy the data is buffered for a later transmission. To consume all buffered data this function shall be called until -ENODATA is returned (with data and/or count being NULL and/or 0).

Parameters:
  • handle – host transport pimpl

  • data – tx buffer or NULL to consume remaining buffered data

  • count – buffer size or 0 to consume remaining buffered data

  • firstIndex – the tracked index number of the first acceleration in data buffer

Returns:

  • 0 on success (data send in first run),

  • EBUSY if data was buffered,

  • ENODATA if no buffered data available (all data sent),

  • -EINVAL otherwise