Colorhug.DeviceQueue

g Colorhug.DeviceQueue Colorhug.DeviceQueue GObject.Object GObject.Object GObject.Object->Colorhug.DeviceQueue

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add (device, cmd, buffer_in, buffer_in_len, buffer_out, buffer_out_len)

boot_flash (device)

clear_calibration (device, calibration_index)

erase_flash (device, address)

get_adc_vref_neg (device, vref)

get_adc_vref_pos (device, vref)

get_calibration (device, calibration_index, calibration, types, description)

get_calibration_map (device, calibration_map)

get_ccd_calibration (device, indexes)

get_color_select (device, color_select)

get_dac_value (device, dac_value)

get_dark_offsets (device, value)

get_firmware_ver (device, major, minor, micro)

get_hardware_version (device, hw_version)

get_integral_time (device, integral_time)

get_leds (device, leds)

get_measure_mode (device, measure_mode)

get_multiplier (device, multiplier)

get_owner_email (device, email)

get_owner_name (device, name)

get_pcb_errata (device, pcb_errata)

get_post_scale (device, post_scale)

get_pre_scale (device, pre_scale)

get_remote_hash (device, remote_hash)

get_serial_number (device, serial_number)

get_temperature (device, temperature)

process (process_flags, cancellable)

process_async (process_flags, cancellable, callback, *user_data)

process_finish (res)

read_firmware (device, data)

read_flash (device, address, data)

read_sram (device, address, data)

reset (device)

self_test (device)

set_calibration (device, calibration_index, calibration, types, description)

set_calibration_ccmx (device, calibration_index, ccmx)

set_calibration_map (device, calibration_map)

set_ccd_calibration (device, indexes)

set_color_select (device, color_select)

set_dac_value (device, dac_value)

set_dark_offsets (device, value)

set_flash_success (device, value)

set_integral_time (device, integral_time)

set_leds (device, leds, repeat, on_time, off_time)

set_measure_mode (device, measure_mode)

set_multiplier (device, multiplier)

set_owner_email (device, email)

set_owner_name (device, name)

set_pcb_errata (device, pcb_errata)

set_post_scale (device, post_scale)

set_pre_scale (device, pre_scale)

set_remote_hash (device, remote_hash)

set_serial_number (device, serial_number)

take_reading_array (device, reading_array)

take_reading_raw (device, take_reading)

take_reading_spectral (device, sram_addr)

take_readings (device, value)

take_readings_xyz (device, calibration_index, value)

verify_firmware (device, data)

verify_flash (device, address, data)

write_eeprom (device, magic)

write_firmware (device, data)

write_flash (device, address, data)

write_sram (device, address, data)

Virtual Methods

Inherited:

GObject.Object (7)

do_device_failed (device, error_message)

do_progress_changed (percentage)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

device-failed

progress-changed

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Colorhug.DeviceQueue(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Colorhug.DeviceQueueClass

classmethod new()
Return type:

Colorhug.DeviceQueue

New in version 0.1.29.

add(device, cmd, buffer_in, buffer_in_len, buffer_out, buffer_out_len)
Parameters:

Adds a raw command to the device queue.

New in version 0.1.29.

boot_flash(device)
Parameters:

device (GUsb.Device) – A GUsb.Device

Boots the device from bootloader to firmware mode.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

clear_calibration(device, calibration_index)
Parameters:

Clears a calibration slot.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

erase_flash(device, address)
Parameters:

Erase program code on the device.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_adc_vref_neg(device, vref)
Parameters:

Gets the ADC Vref- calibration value.

NOTE: This command is available on hardware version: 2

New in version 0.1.31.

get_adc_vref_pos(device, vref)
Parameters:

Gets the ADC Vref+ calibration value.

NOTE: This command is available on hardware version: 2

New in version 0.1.31.

get_calibration(device, calibration_index, calibration, types, description)
Parameters:
  • device (GUsb.Device) – A GUsb.Device

  • calibration_index (int) – The slot position

  • calibration (Colord.Mat3x3) – the 3x3 calibration matrix

  • types (int) – The types the matrix supports

  • description (str) – The description of the calibration

Gets the calibration data.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_calibration_map(device, calibration_map)
Parameters:

Gets the calibration map.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_ccd_calibration(device, indexes)
Parameters:

Gets the CCD spectral calibration indexes. These are “pointers” to specific spectral peaks returned by the CCD.

NOTE: This command is available on hardware version: 2

New in version 0.1.31.

get_color_select(device, color_select)
Parameters:

Gets the selected sensor color.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_dac_value(device, dac_value)
Parameters:

Gets the DAC value.

NOTE: This command is available on hardware version: 2

New in version 1.1.6.

get_dark_offsets(device, value)
Parameters:

Gets the device dark offsets.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_firmware_ver(device, major, minor, micro)
Parameters:
  • device (GUsb.Device) – A GUsb.Device

  • major (int) – The firmware major version

  • minor (int) – The firmware minor version

  • micro (int) – The firmware micro version

Gets the firmware version.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_hardware_version(device, hw_version)
Parameters:

Gets the hardware version.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_integral_time(device, integral_time)
Parameters:

Gets the reading integral time.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_leds(device, leds)
Parameters:

Gets the LED status.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_measure_mode(device, measure_mode)
Parameters:

Gets the measurement mode.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_multiplier(device, multiplier)
Parameters:

Gets the sensor multiplier.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_owner_email(device, email)
Parameters:

Gets the owner email address.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_owner_name(device, name)
Parameters:

Gets the owner name.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_pcb_errata(device, pcb_errata)
Parameters:

Gets the PCB errata level.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_post_scale(device, post_scale)
Parameters:

Gets the post scale value.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_pre_scale(device, pre_scale)
Parameters:

Gets the pre scale value.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_remote_hash(device, remote_hash)
Parameters:

Gets the remote hash stored on the device.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_serial_number(device, serial_number)
Parameters:

Gets the device serial number.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

get_temperature(device, temperature)
Parameters:

Gets the device temperature.

NOTE: This command is available on hardware version: 2

New in version 0.1.29.

process(process_flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if the commands were executed successfully.

Return type:

bool

Processes all commands in the command queue. WARNING: this function is synchronous and will block.

New in version 0.1.29.

process_async(process_flags, cancellable, callback, *user_data)
Parameters:

Processes all commands in the command queue.

New in version 0.1.29.

process_finish(res)
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult

Raises:

GLib.Error

Returns:

True if the request was fulfilled.

Return type:

bool

Gets the result from the asynchronous function.

New in version 0.1.29.

read_firmware(device, data)
Parameters:

Reads firmware on the device.

NOTE: This command is available on hardware version: 1 & 2

New in version 1.2.11.

read_flash(device, address, data)
Parameters:

Read flash code from the device.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

read_sram(device, address, data)
Parameters:

Reads binary data from the SRAM.

NOTE: This command is available on hardware version: 2

New in version 0.1.29.

reset(device)
Parameters:

device (GUsb.Device) – A GUsb.Device

Resets the device back to bootloader mode.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

self_test(device)
Parameters:

device (GUsb.Device) – A GUsb.Device

Performs some self tests on the device.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_calibration(device, calibration_index, calibration, types, description)
Parameters:
  • device (GUsb.Device) – A GUsb.Device

  • calibration_index (int) – The slot position

  • calibration (Colord.Mat3x3) – the 3x3 calibration matrix

  • types (int) – The types the matrix supports

  • description (str) – The description of the calibration

Sets the calibration data.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_calibration_ccmx(device, calibration_index, ccmx)
Parameters:
Raises:

GLib.Error

Return type:

bool

New in version 0.1.29.

set_calibration_map(device, calibration_map)
Parameters:

Sets the calibration map.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_ccd_calibration(device, indexes)
Parameters:

Sets the CCD spectral calibration indexes. These are “pointers” to specific spectral peaks returned by the CCD.

NOTE: This command is available on hardware version: 2

New in version 0.1.31.

set_color_select(device, color_select)
Parameters:

Sets the sensor measurement color.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_dac_value(device, dac_value)
Parameters:

Sets the post scale value.

NOTE: This command is available on hardware version: 1 & 2

New in version 1.1.6.

set_dark_offsets(device, value)
Parameters:

Sets the device dark offsets.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_flash_success(device, value)
Parameters:

Sets the firmware flash success value. Be careful using this function as misuse can result in a ‘bricked’ ColorHug device.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_integral_time(device, integral_time)
Parameters:

Sets the reading integral time.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_leds(device, leds, repeat, on_time, off_time)
Parameters:
  • device (GUsb.Device) – A GUsb.Device

  • leds (int) – The LEDs bitfield

  • repeat (int) – Sets the number of times to repeat the pattern

  • on_time (int) – Set the on time

  • off_time (int) – Set the off time

Sets the LED status.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_measure_mode(device, measure_mode)
Parameters:

Sets the measurement mode.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_multiplier(device, multiplier)
Parameters:

Sets the sensor multiplier.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_owner_email(device, email)
Parameters:

Sets the owner email address.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_owner_name(device, name)
Parameters:

Sets the owner name.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_pcb_errata(device, pcb_errata)
Parameters:

Sets the PCB board errata.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_post_scale(device, post_scale)
Parameters:

Sets the post scale value.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_pre_scale(device, pre_scale)
Parameters:

Sets the pre-scale value.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_remote_hash(device, remote_hash)
Parameters:

Sets the remote hash on the device.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

set_serial_number(device, serial_number)
Parameters:

Sets the device serial number.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

take_reading_array(device, reading_array)
Parameters:

Get an array of raw readings in quick succession.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

take_reading_raw(device, take_reading)
Parameters:

Take a raw reading from the sensor.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

take_reading_spectral(device, sram_addr)
Parameters:

Takes a raw spectral reading.

NOTE: This command is available on hardware version: 2

New in version 0.1.31.

take_readings(device, value)
Parameters:

Take a RGB triplet of readings from the sensor without applying the calibration matrix.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

take_readings_xyz(device, calibration_index, value)
Parameters:

Take an XYZ fully cooked reading from the sensor.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

verify_firmware(device, data)
Parameters:

Verifies firmware on the device.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

verify_flash(device, address, data)
Parameters:

Verify flash code from the device.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

write_eeprom(device, magic)
Parameters:

Writes values to the firmware to be set at device startup.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

write_firmware(device, data)
Parameters:

Writes new firmware to the device.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

write_flash(device, address, data)
Parameters:

Write flash code to the device.

NOTE: This command is available on hardware version: 1 & 2

New in version 0.1.29.

write_sram(device, address, data)
Parameters:

Writes binary data to the SRAM.

NOTE: This command is available on hardware version: 2

New in version 0.1.29.

do_device_failed(device, error_message) virtual
Parameters:
do_progress_changed(percentage) virtual
Parameters:

percentage (int) –

Signal Details

Colorhug.DeviceQueue.signals.device_failed(device_queue, object, p0)
Signal Name:

device-failed

Flags:

RUN_LAST

Parameters:
Colorhug.DeviceQueue.signals.progress_changed(device_queue, object)
Signal Name:

progress-changed

Flags:

RUN_LAST

Parameters: