BFModule.CLComm.clsCLAllSerial

class BFModule.CLComm.clsCLAllSerial

Bases: pybind11_object

Python Wrapper class around the clAllSerial functions.

__init__(self: BFModule.CLComm.clsCLAllSerial) None

Methods

FlushPort(self)

Discards any bytes that are available in the input buffer.

GetNumBytesAvailable(self)

Returns the number of bytes that are received, but not yet read out of the the serial device.

GetSupportedBaudRates(self)

Returns the valid baud rates of the interface.

SerialClose(self)

Closes the serial device and cleans up resources associated with it.

SerialInit(*args, **kwargs)

Overloaded function.

SerialRead(self, NumBytesToRead, SerialTimeout)

Reads data from the serial device.

SerialReadEx(self, NumBytesToRead, SerialTimeout)

Reads data from the serial device.

SerialWrite(self, message, serialTimeout)

This method writes a string of characters to the serial device.

SetBaudRate(self, baudRate)

Query the board number of the opened CXP register device.

__init__(self)

Attributes

PortInfo

Returns a PortInfo object which contains information regarding the opened port.

FlushPort(self: BFModule.CLComm.clsCLAllSerial) None

Discards any bytes that are available in the input buffer.

GetNumBytesAvailable(self: BFModule.CLComm.clsCLAllSerial) int

Returns the number of bytes that are received, but not yet read out of the the serial device.

Return type

int

Returns

Returns the number of bytes that are received, but not yet read out of the the serial device.

Raises
  • ValueError – if the board is not a CXP device.

  • RuntimeError – if timed out waiting for acknowledgement.

  • RuntimeError – if error code in acknowledgement from camera.

GetSupportedBaudRates(self: BFModule.CLComm.clsCLAllSerial) int

Returns the valid baud rates of the interface. The return value is represented as a bitfield with the bitfield values be as follows:

  • CL_BAUDRATE_9600   - bit 1

  • CL_BAUDRATE_19200  - bit 2

  • CL_BAUDRATE_38400  - bit 3

  • CL_BAUDRATE_57600  - bit 4

  • CL_BAUDRATE_115200 - bit 5

  • CL_BAUDRATE_230400 - bit 6

  • CL_BAUDRATE_460800 - bit 7

  • CL_BAUDRATE_921600 - bit 8

Return type

int8

Returns

Returns the valid baud rates of the interface.

Raises
  • ValueError – if the board is not a CXP device.

  • RuntimeError – if timed out waiting for acknowledgement.

  • RuntimeError – if error code in acknowledgement from camera.

property PortInfo

Returns a PortInfo object which contains information regarding the opened port.

Type

PortInfo

SerialClose(self: BFModule.CLComm.clsCLAllSerial) None

Closes the serial device and cleans up resources associated with it. Does nothing, if the device is not Initialized.

Return type

void

SerialInit(*args, **kwargs)

Overloaded function.

  1. SerialInit(self: BFModule.CLComm.clsCLAllSerial) -> None

    Opens the board select dialog, and initializes the chosen device.

    Return Type

    void

  2. SerialInit(self: BFModule.CLComm.clsCLAllSerial, BoardNumber: int) -> None

    Initializes the device referred to by serialIndex. Only CL boards are considered a serial device.

    Parameters
    • SerialIndex (int) - The serial device number to open.

    Return Type

    void

    Raises
    • ValueError - Not a valid index.

    • ValueError - The serial device specified by serialIndex was not found.

SerialRead(self: BFModule.CLComm.clsCLAllSerial, NumBytesToRead: int, SerialTimeout: int) str

Reads data from the serial device.

Parameters
  • NumBytesToRead (int) – The number of bytes to be read from the serial device.

  • SerialTimeout (int) – Indicates the timeout value in miliseconds.

Return type

str

Returns

Returns the data read from the serial device as a string.

Raises
  • ValueError – The serial reference is not valid.

  • ValueError – A NULL pointer was passed into the function.

  • RuntimeError – The timeout has elapsed.

  • RuntimeError – Error with the receiver FIFO during initialization.

SerialReadEx(self: BFModule.CLComm.clsCLAllSerial, NumBytesToRead: int, SerialTimeout: int) str

Reads data from the serial device.

Parameters
  • NumBytesToRead (int) – The number of bytes to be read from the serial device.

  • SerialTimeout (int) – Indicates the timeout value in miliseconds.

Return type

str

Returns

Returns the data read from the serial device as a string.

Raises
  • ValueError – The serial reference is not valid.

  • ValueError – A NULL pointer was passed into the function.

  • RuntimeError – The timeout has elapsed.

  • RuntimeError – Error with the receiver FIFO during initialization.

SerialWrite(self: BFModule.CLComm.clsCLAllSerial, message: str, serialTimeout: int) int

This method writes a string of characters to the serial device.

Parameters
  • message (str) – The string message to send to the serial device.

  • serialTimeout (int) – Indicates the timeout value in miliseconds.

Return type

int

Returns

The number of bytes written to the port.

SetBaudRate(self: BFModule.CLComm.clsCLAllSerial, baudRate: BFModule.CLComm.BaudRates) None

Query the board number of the opened CXP register device.

Parameters

baudRate – (BaudRates) The baud rate you want to use.

Return type

void

Raises
  • ValueError – if the board is not a CXP device.

  • RuntimeError – if timed out waiting for acknowledgement.

  • RuntimeError – if error code in acknowledgement from camera.