ArvDevice

ArvDevice — Abstract base class for device handling

Functions

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── ArvDevice
        ├── ArvFakeDevice
        ╰── ArvGvDevice

Description

ArvDevice is an abstract base class for the control of cameras. It provides an easy access to the camera settings, and to its genicam interface for more advanced uses.

Functions

arv_device_create_stream ()

ArvStream *
arv_device_create_stream (ArvDevice *device,
                          ArvStreamCallback callback,
                          void *user_data);

Creates a new ArvStream for video stream handling. See ArvStreamCallback for details regarding the callback function.

Parameters

device

a ArvDevice

 

callback

a frame processing callback.

[scope call]

user_data

user data for callback .

[allow-none][closure]

Returns

a new ArvStream.

[transfer full]

Since: 0.2.0


arv_device_create_chunk_parser ()

ArvChunkParser *
arv_device_create_chunk_parser (ArvDevice *device);

Create a ArvChunkParser object, to be used for chunk data extraction from ArvBuffer.

Parameters

device

a ArvDevice

 

Returns

a new ArvChunkParser object, NULL on error.

[transfer full]

Since: 0.4.0


arv_device_read_memory ()

gboolean
arv_device_read_memory (ArvDevice *device,
                        guint64 address,
                        guint32 size,
                        void *buffer,
                        GError **error);

Reads size bytes from the device memory.

Parameters

device

a ArvDevice

 

address

memory address

 

size

number of bytes to read

 

buffer

a buffer for the storage of the read data

 

error

a GError placeholder.

[out][allow-none]

Returns

TRUE on success.

[skip]

Since: 0.2.0


arv_device_write_memory ()

gboolean
arv_device_write_memory (ArvDevice *device,
                         guint64 address,
                         guint32 size,
                         void *buffer,
                         GError **error);

Writes size bytes to the device memory.

Parameters

device

a ArvDevice

 

address

memory address

 

size

size of the returned buffer

 

buffer

the buffer read from memory.

[transfer full]

error

a GError placeholder.

[out][allow-none]

Returns

TRUE on success.

[skip]

Since: 0.2.0


arv_device_read_register ()

gboolean
arv_device_read_register (ArvDevice *device,
                          guint64 address,
                          guint32 *value,
                          GError **error);

Reads the value of a device register.

Parameters

device

a ArvDevice

 

address

register address

 

value

a placeholder for the read value.

[out]

error

a GError placeholder.

[out][allow-none]

Returns

TRUE on success.

[skip]

Since: 0.2.0


arv_device_write_register ()

gboolean
arv_device_write_register (ArvDevice *device,
                           guint64 address,
                           guint32 value,
                           GError **error);

Writes value to a device register.

Parameters

device

a ArvDevice

 

address

the register address

 

value

value to write

 

error

a GError placeholder.

[out][allow-none]

Returns

TRUE on success.

[skip]

Since: 0.2.0


arv_device_get_genicam_xml ()

const char *
arv_device_get_genicam_xml (ArvDevice *device,
                            size_t *size);

Gets the Genicam XML data stored in the device memory.

Parameters

device

a ArvDevice

 

size

placeholder for the returned data size (bytes) // BUG: (skip) seems ignored.

[out][allow-none]

Returns

a pointer to the Genicam XML data, owned by the device.

[transfer none]

Since: 0.2.0


arv_device_get_genicam ()

ArvGc *
arv_device_get_genicam (ArvDevice *device);

Retrieves the genicam interface of the given device.

Parameters

device

a ArvDevice

 

Returns

the genicam interface.

[transfer none]

Since: 0.2.0


arv_device_get_feature ()

ArvGcNode *
arv_device_get_feature (ArvDevice *device,
                        const char *feature);

Parameters

device

a ArvDevice

 

feature

feature name

 

Returns

the genicam node corresponding to the feature name, NULL if not found.

[transfer none]

Since: 0.2.0


arv_device_get_status ()

ArvDeviceStatus
arv_device_get_status (ArvDevice *device);

arv_device_execute_command ()

void
arv_device_execute_command (ArvDevice *device,
                            const char *feature);

Execute a genicam command. If an error occur, this function change the device status.

Parameters

device

a ArvDevice

 

feature

feature name

 

Since: 0.2.0


arv_device_get_boolean_feature_value ()

gboolean
arv_device_get_boolean_feature_value (ArvDevice *device,
                                      const char *feature);

Parameters

device

a ArvDevice

 

feature

feature name

 

Returns

the feature value.

If this operation fails, the device status returned by arv_device_get_status() will be changed.

Since: 0.6.0


arv_device_set_boolean_feature_value ()

void
arv_device_set_boolean_feature_value (ArvDevice *device,
                                      const char *feature,
                                      gboolean value);

Set the value of a boolean feature. If this operation fails, the device status returned by arv_device_get_status() will be changed.

Parameters

device

a ArvDevice

 

feature

feature name

 

value

feature value

 

Since: 0.6.0


arv_device_set_string_feature_value ()

void
arv_device_set_string_feature_value (ArvDevice *device,
                                     const char *feature,
                                     const char *value);

arv_device_get_string_feature_value ()

const char *
arv_device_get_string_feature_value (ArvDevice *device,
                                     const char *feature);

arv_device_set_integer_feature_value ()

void
arv_device_set_integer_feature_value (ArvDevice *device,
                                      const char *feature,
                                      gint64 value);

arv_device_get_integer_feature_value ()

gint64
arv_device_get_integer_feature_value (ArvDevice *device,
                                      const char *feature);

arv_device_get_integer_feature_bounds ()

void
arv_device_get_integer_feature_bounds (ArvDevice *device,
                                       const char *feature,
                                       gint64 *min,
                                       gint64 *max);

arv_device_set_float_feature_value ()

void
arv_device_set_float_feature_value (ArvDevice *device,
                                    const char *feature,
                                    double value);

arv_device_get_float_feature_value ()

double
arv_device_get_float_feature_value (ArvDevice *device,
                                    const char *feature);

arv_device_get_float_feature_bounds ()

void
arv_device_get_float_feature_bounds (ArvDevice *device,
                                     const char *feature,
                                     double *min,
                                     double *max);

arv_device_get_available_enumeration_feature_values ()

gint64 *
arv_device_get_available_enumeration_feature_values
                               (ArvDevice *device,
                                const char *feature,
                                guint *n_values);

arv_device_get_available_enumeration_feature_values_as_strings ()

const char **
arv_device_get_available_enumeration_feature_values_as_strings
                               (ArvDevice *device,
                                const char *feature,
                                guint *n_values);

Get all the available values of feature , as strings.

Parameters

device

an ArvDevice

 

feature

feature name

 

n_values

placeholder for the number of returned values

 

Returns

a newly created array of const strings, which must freed after use using g_free.

[array length=n_values][transfer container]

Since: 0.2.0

Types and Values

ArvDevice

typedef struct _ArvDevice ArvDevice;

enum ArvDeviceStatus

Members

ARV_DEVICE_STATUS_UNKNOWN

unknown status

 

ARV_DEVICE_STATUS_SUCCESS

no error has occured

 

ARV_DEVICE_STATUS_TIMEOUT

action failed on a timeout

 

ARV_DEVICE_STATUS_WRITE_ERROR

write on a read only node

 

ARV_DEVICE_STATUS_TRANSFER_ERROR

error during data transfer

 

ARV_DEVICE_STATUS_NOT_CONNECTED

device not connected

 

Signal Details

The “control-lost” signal

void
user_function (ArvDevice *device,
               gpointer   user_data)

Signal that the control of the device is lost.

This signal may be emited from a thread different than the main one, so please take care to shared data access from the callback.

Parameters

device

a ArvDevice

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.2.0