Skip to content

J1939Tp Class

Factory entry point for opening IJ1939TpChannel instances. Non-instantiable.

public static class J1939Tp

Inheritance Object → J1939Tp

Remarks

Two overloads reflect the two ownership patterns, mirroring the ISO-TP factory: - Open(ICanBus, byte, J1939TpOptions) — the channel owns a private ICanBusService that wraps the supplied bus and disposes it when the channel is disposed. Convenient for single-protocol callers. - Open(ICanBusService, byte, J1939TpOptions, bool) — the caller supplies an already-existing service (e.g. shared with an ISO-TP or CANopen instance on the same bus per FR-TP-018/034); with leaveOpen=true (the default) the service outlives the channel.

Methods

J1939Tp.Open(ICanBus, byte, J1939TpOptions) Method

Opens a channel that owns a private CanBusService around bus. Disposing the returned channel disposes that service and detaches from bus; the bus itself is not disposed.

public static CanKit.Pro.J1939Tp.IJ1939TpChannel Open(CanKit.Abstractions.API.Can.ICanBus bus, byte sourceAddress, CanKit.Pro.J1939Tp.J1939TpOptions? options=null);

Parameters

bus ICanBus

sourceAddress Byte

options J1939TpOptions

Returns

IJ1939TpChannel

J1939Tp.Open(ICanBusService, byte, J1939TpOptions, bool) Method

Opens a channel bound to an already-existing service. Multiple channels with different source addresses may share the same service to multiplex several J1939 nodes over one physical bus, or to co-exist with other protocol layers (ISO-TP, CANopen, ...).

public static CanKit.Pro.J1939Tp.IJ1939TpChannel Open(CanKit.Pro.RawCan.ICanBusService service, byte sourceAddress, CanKit.Pro.J1939Tp.J1939TpOptions? options=null, bool leaveOpen=true);

Parameters

service ICanBusService

The demux service. Must not be null.

sourceAddress Byte

The J1939 source address this channel identifies as.

options J1939TpOptions

Channel options; defaults to a fresh J1939TpOptions.

leaveOpen Boolean

When true (default) disposing the channel does not dispose service; the caller retains ownership. When false the channel takes ownership and disposes the service on its own IDisposable.Dispose.

Returns

IJ1939TpChannel