3.6 Readout

After an Ndigo6G-12 board is initialized and capturing, the captured events can be read from the board with ndigo6g12_read(). The read-out data is packaged in packets (see Chapter 4).

int ndigo6g12_read(ndigo6g12_device *device, ndigo6g12_read_in *in, ndigo6g12_read_out *out)

Reads packets from the board.

If ndigo6g12_read_in::acknowledge_last_read is true, automatically acknowledges the last read packets.

Parameters:
  • device[in] Pointer to the device that should be read.

  • in[in] Pointer to the structure that configures the read call.

  • out[out] Pointer to a structure in which the read-out should be stored.

Returns:

See Function return values.

const char *ndigo6g12_get_last_error_message(ndigo6g12_device *device)

Gets latest error message of device.

Parameters:

device[in] Pointer to the device.

Returns:

char array containing the plain text error message.

const char *ndigo6g12_device_state_to_str(int state)

Convert state to plain text.

The device state is stored in ndigo6g12_fast_info::state.

Parameters:

state[in] See NDIGO6G12_DEVICE_STATE_*

Returns:

char array containing the state as plain text.

struct ndigo6g12_read_in

The parameters of the read commands.

Public Members

crono_bool_t acknowledge_last_read

Automatically acknowledge packets from the previous call of ndigo6g12_read.

Only acknowledged packets will release the memory of the DMA buffer.

struct ndigo6g12_read_out

Struct for the read-out of the Ndigo6G-12 packets.

Public Members

volatile crono_packet *first_packet

Pointer to the first packet.

That is, the pointer that was captured by the call of ndigo6g12_read.

volatile crono_packet *last_packet

Pointer to the last packet.

int error_code

Error code.

Is one of the following:

CRONO_READ_OK

Reading packets from the device was successful.

CRONO_READ_NO_DATA

Trying to read packets does not yield data.

CRONO_READ_INTERNAL_ERROR

Some unhandled error occured. A device reinit is required.

CRONO_READ_TIMEOUT

Trying to read packets does not yield data in the given amount of time.

const char *error_message

Plain text error message.