Mock

This module defines several functions and classes for mocking a serial port receiving Olimex-EKG-EMG (aka. EXG) packets.

class olimex.mock.FakeSerialByteArray(byte_array, *args, **kwargs)

A class for mocking a serial.Serial object with data from a bytearray.

read()

Return one byte.

class olimex.mock.FakeSerialFromFile(file_path, sample_frequency=125, *args, **kwargs)

A class for mocking a serial.Serial object with data from a file.

read(*args, **kwargs)

Return one byte from buffer.

class olimex.mock.FakeSerialTimedByteArray(byte_array, sample_frequency=125, *args, **kwargs)

A class for mocking a serial.Serial object with data from a bytearray.

read()

Return one byte.

olimex.mock.packet_generator()

Return an EXG formatted packet that contains fake channel data.

This generator produces fake packets of the form sent by the Olimex-EKG-EMG shield.