docs.unity3d.com
    Show / Hide Table of Contents

    Class BusDriver

    Base class for a bus driver using a port filter.

    Inheritance
    Object
    IPortFilter<Byte[]>
    BusDriver
    CommBusDriver
    Inherited Members
    IPortFilter<Byte[]>.Process(IPortType, Byte[], IPortFilter<Byte[]>)
    IPortFilter<Byte[]>.Item[Int32]
    IPortFilter<Byte[]>.Size
    Namespace: Mechatronics.SensorSDK
    Syntax
    public class BusDriver : IPortFilter<byte[]>

    Constructors

    BusDriver(PortType<Byte[]>)

    Initialize the bus driver.

    Declaration
    public BusDriver(PortType<byte[]> port)
    Parameters
    Type Name Description
    PortType<Byte[]> port

    Port that the driver is on.

    Fields

    _address

    Declaration
    protected byte _address
    Field Value
    Type Description
    Byte

    _callback

    Declaration
    protected BusDriver.MessageHandler _callback
    Field Value
    Type Description
    BusDriver.MessageHandler

    _port

    Declaration
    protected PortType<byte[]> _port
    Field Value
    Type Description
    PortType<Byte[]>

    Methods

    Join(Byte, BusDriver.MessageHandler)

    Start listening to messages.

    Declaration
    public virtual bool Join(byte address, BusDriver.MessageHandler handler)
    Parameters
    Type Name Description
    Byte address

    Address to listen at.

    BusDriver.MessageHandler handler

    Handler to callback with messages

    Returns
    Type Description
    Boolean

    Leave(BusDriver.MessageHandler)

    Leave the bus and clean up the handler.

    Declaration
    public virtual void Leave(BusDriver.MessageHandler callback)
    Parameters
    Type Name Description
    BusDriver.MessageHandler callback

    Registered handler to cleanup.

    Process(IPortType, Byte[], IPortFilter<Byte[]>)

    Called by the port on new data to process.

    Declaration
    public override byte[] Process(IPortType port, byte[] Data, IPortFilter<byte[]> previousFilter)
    Parameters
    Type Name Description
    IPortType port

    Calling port

    Byte[] Data

    New data received on the port.

    IPortFilter<Byte[]> previousFilter

    Previous portfilter if it exists, that output the Data.

    Returns
    Type Description
    Byte[]

    Proccessed data.

    Overrides
    Mechatronics.SystemGraph.IPortFilter<System.Byte[]>.Process(Mechatronics.SystemGraph.IPortType, System.Byte[], Mechatronics.SystemGraph.IPortFilter<System.Byte[]>)

    Send(Byte, Byte[])

    Send data on the bus.

    Declaration
    public virtual bool Send(byte toAddress, byte[] data)
    Parameters
    Type Name Description
    Byte toAddress

    Address to send to.

    Byte[] data

    Data to send.

    Returns
    Type Description
    Boolean

    True on success.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023