Show / Hide Table of Contents

Class CanCollection

Class provides capability to read/write CAN data associated with a session.

Inheritance
System.Object
CanCollection
Namespace: MESL.SqlRace.Domain.Collections
Assembly: MESL.SqlRace.Domain.dll
Syntax
public class CanCollection : Object

Methods

AddCanData(Int64, Byte, UInt16, UInt32, Byte[])

Add can data into the session.

Declaration
public void AddCanData(long timeStamp, byte isReceived, ushort busId, uint canId, byte[] message)
Parameters
Type Name Description
System.Int64 timeStamp

Timestamp of CAN message.

System.Byte isReceived

Is CAN message received or transmitted.

System.UInt16 busId

Bus identifier.

System.UInt32 canId

CAN identifier.

System.Byte[] message

CAN message bytes.

GetCanData(Int64, Int64)

Returns all the messages of the requested bus for a given time.

Declaration
public IList<CanInstance> GetCanData(long startTime, long endTime)
Parameters
Type Name Description
System.Int64 startTime

The start time.

System.Int64 endTime

The end time.

Returns
Type Description
System.Collections.Generic.IList<CanInstance>

List of can messages for a given time.

GetCanData(UInt16, Int64, Int64)

Returns all the messages of specific bus id for the requested time.

Declaration
public IList<CanInstance> GetCanData(ushort busId, long startTime, long endTime)
Parameters
Type Name Description
System.UInt16 busId

Bus identifier.

System.Int64 startTime

The start time.

System.Int64 endTime

The end time.

Returns
Type Description
System.Collections.Generic.IList<CanInstance>

CAN instances for a given bus id.

GetCanData(UInt16, UInt32, Int64, Int64)

Returns all the messages of specific CAN id for the requested bus for requested time.

Declaration
public IList<CanInstance> GetCanData(ushort busId, uint canId, long startTime, long endTime)
Parameters
Type Name Description
System.UInt16 busId

Bus identifier.

System.UInt32 canId

CAN identifier.

System.Int64 startTime

The start time.

System.Int64 endTime

The end time.

Returns
Type Description
System.Collections.Generic.IList<CanInstance>

CAN instances for a given CAN id.

GetCanDataSamples(UInt16, Int64, Int32, StepDirection)

Returns all the messages of the requested bus for a given time.

Declaration
public IList<CanInstance> GetCanDataSamples(ushort busId, long startTime, int numberOfSamples = 1, StepDirection direction)
Parameters
Type Name Description
System.UInt16 busId

Bus identifier.

System.Int64 startTime

The start time.

System.Int32 numberOfSamples

Number of requested samples.

StepDirection direction

Direction to search the CAN data.

Returns
Type Description
System.Collections.Generic.IList<CanInstance>

CAN instances for a given bus id.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

Throws exception if number of samples is invalid.

Remove(CanInstance)

Removes the specified CAN data instance.

Declaration
public void Remove(CanInstance canData)
Parameters
Type Name Description
CanInstance canData

The can data instance.

Events

ItemAdded

Event fired when an item is added to the collection

Declaration
public event EventHandler<ItemCanArgs> ItemAdded
Event Type
Type Description
System.EventHandler<ItemCanArgs>
Back to top Generated by DocFX