Skip to content
MLTK 0.20.0 documentation logo
Machine Learning Toolkit mltk.utils.jlink_stream.JLinkDataStream
Type to start searching
    MLTK Github Repository
    • Gecko SDK Documentation
    • Tensorflow-Lite Micro Repository
    • Tensorflow Documentation
    • API Reference
    • Utilities
    • J-Link Stream
    MLTK Github Repository
    • Basics
    • Overview
    • Why MLTK?
    • Installation
    • Command-Line
    • Modeling Guides
    • Usage
    • Tutorials
    • API Examples
    • API Reference
      • Model Operations
      • MLTK Model
      • Tensorflow-Lite Micro Model
      • Tensorflow-Lite Model
      • Keras Model
      • Data Preprocessing
      • Utilities
    • Reference Models
    • Reference Datasets
    • C++ Development
    • C++ Examples
    • Audio Related
    • Keyword Spotting Overview
    • Audio Feature Generator
    • Audio Utilities
    • Other Information
    • Frequently Asked Questions
    • Quick Reference
    • Supported Hardware
    • Notebook Examples Guide
    • Settings File
    • Environment Variables
      • buffer_hexdump
      • buffer_unused
      • buffer_used
      • end_time
      • is_opened
      • max_read_size
      • mode
      • name
      • read_data_available
      • timeout
      • write_data_available
      • __init__
      • close
      • flush
      • read
      • read_all
      • write
    • home
    • API Reference
    • Utilities
    • J-Link Stream
    • mltk.utils.jlink_stream.JLinkDataStream

    mltk.utils.jlink_stream.JLinkDataStream¶

    class JLinkDataStream[source]¶

    JLink data stream

    Properties

    buffer_hexdump

    Return a hexdump string

    buffer_unused

    The amount of the device data buffer that is available

    buffer_used

    The amount of the device data buffer used

    end_time

    The absolute time in seconds to timeout reading or writing

    is_opened

    If the stream is opened to the device

    max_read_size

    The maximum amount of data to read

    mode

    The mode the for which the stream was opened, r or w

    name

    The name of the opened stream

    read_data_available

    The amount of data that is ready to be read by the python script

    timeout

    The maximum about of time in seconds to read or write data.

    write_data_available

    The amount of data that can immediately be written

    Methods

    __init__

    close

    Close the data stream with the device

    flush

    Wait while any pending data is transferred to/from the device

    read

    Read data from data stream opened for reading

    read_all

    The the specified amount of data

    write

    Write data to a data stream opened for writing

    __init__(name, mode, ifc, stream_context)[source]¶
    Parameters:
    • name (str) –

    • mode (str) –

    • ifc (DeviceInterface) –

    • stream_context (dict) –

    property name: str¶

    The name of the opened stream

    Return type:

    str

    property mode: str¶

    The mode the for which the stream was opened, r or w

    Return type:

    str

    property is_opened: bool¶

    If the stream is opened to the device

    Return type:

    bool

    property max_read_size: int¶

    The maximum amount of data to read

    Set to -1 to disable limit After each read, this value will decrement by the amount of data read. One this value reaches zero, it must be reset otherwise subsequent reads will always return zero.

    Return type:

    int

    property timeout: float¶

    The maximum about of time in seconds to read or write data. This is only used if the ‘timeout’ argument to the read() or write() APIs is None Set to -1 to never timeout

    Return type:

    float

    property end_time: float¶

    The absolute time in seconds to timeout reading or writing

    Set to None to disable. If end_time > time.time(), then return from the read() or write() API

    Return type:

    float

    property buffer_used: int¶

    The amount of the device data buffer used

    If the stream was opened for reading then this is the amount of data that was previous received from the device and is waiting to be read by the python script.

    If the stream was opened for writing, then this is the amount of data that was previously written and is pending to be sent to the device.

    Return type:

    int

    property buffer_unused: int¶

    The amount of the device data buffer that is available

    Return type:

    int

    property read_data_available: int¶

    The amount of data that is ready to be read by the python script

    Return type:

    int

    property write_data_available: int¶

    The amount of data that can immediately be written

    Return type:

    int

    property buffer_hexdump: str¶

    Return a hexdump string

    Return type:

    str

    close()[source]¶

    Close the data stream with the device

    read(max_size=None, timeout=None)[source]¶

    Read data from data stream opened for reading

    NOTE: The only returns the data that is immediately available. The amount of data returned may be less than max_size.

    Return type:

    bytes

    Parameters:
    • max_size (Optional[int]) –

    • timeout (Optional[float]) –

    read_all(amount, timeout=None, initial_timeout=None, throw_exception=True)[source]¶

    The the specified amount of data

    Return type:

    bytes

    Parameters:
    • amount (int) –

    • timeout (Optional[float]) –

    • initial_timeout (Optional[float]) –

    write(data, timeout=None, flush=False)[source]¶

    Write data to a data stream opened for writing

    Return type:

    int

    Parameters:
    • data (bytes) –

    • timeout (Optional[float]) –

    flush(timeout=None)[source]¶

    Wait while any pending data is transferred to/from the device

    Parameters:

    timeout (Optional[float]) –

    arrow_upwardBack to Top
    Previous mltk.utils.jlink_stream.JlinkStream
    Next mltk.utils.jlink_stream.JlinkCommandStream
    © Copyright 2025, Silicon Labs.
    Last updated on Mar 24, 2025.
    Created using Sphinx 5.3.0. and Material for Sphinx

    Important: We use cookies only for functional and traffic analytics.
    We DO NOT use cookies for any marketing purposes. By using our site you acknowledge you have read and understood our Cookie Policy.

    Got it