Beispiel #1
0
 public static extern Int32 PassThruStartMsgFilter(
     UInt32 ChannelID,
     UInt32 FilterType,
     PassThruMsg pMaskMsg,
     PassThruMsg pPatternMsg,
     PassThruMsg pFlowControlMsg,
     out UInt32 pFilterID);
Beispiel #2
0
 /// <summary>
 /// Immediately queue the given message, and re-send at the specified interval.
 /// </summary>
 /// <param name="ChannelID">Channel identifier returned from PassThruConnect</param>
 /// <param name="pMsg">Pointer to a single message structure</param>
 /// <param name="pMsgId">Pointer to periodic-message identifier assigned by the PassThru DLL</param>
 /// <param name="TimeInterval">Interval between the start of successive transmissions, in milliseconds.  Valid range is 5-65535.</param>
 /// <returns>See Status enumeration</returns>
 public PassThruStatus PassThruStartPeriodicMsg(
     UInt32 ChannelID,
     PassThruMsg pMsg,
     out UInt32 pMsgId,
     UInt32 TimeInterval)
 {
     return((PassThruStatus)NativeMock.PassThruStartPeriodicMsg(ChannelID, pMsg, out pMsgId, TimeInterval));
 }
        /// <summary>
        /// Send messages to the ECU.
        /// </summary>
        /// <remarks>This is a single-message hack to get around the marshaling problem w/ PassThruWriteMsgs.</remarks>
        /// <param name="ChannelID">Channel identifier returned from PassThruConnect</param>
        /// <param name="pMsg">Pointer to message structures</param>
        /// <param name="pNumMsgs">Pointer to number of messages to send.  On return, will indicate how many messages were sent before timeout expired (if timeout is nonzero) or how many messages were enqueued (if timeout is zero).</param>
        /// <param name="Timeout">Write timeout, in milliseconds.</param>
        /// <returns>See Status enumeration</returns>
        public PassThruStatus PassThruWriteMsg(
            UInt32 ChannelID,
            PassThruMsg pMsg,
            UInt32 Timeout)
        {
            UInt32 numMsgs = 1;

            return((PassThruStatus)NativeOpenPort20.PassThruWriteMsg(ChannelID, pMsg, ref numMsgs, Timeout));
        }
Beispiel #4
0
        /// <summary>
        /// Read messages and indications from the receive buffer.
        /// </summary>
        /// <param name="ChannelID">Channel identifier returned from PassThruConnect</param>
        /// <param name="pMsg">Pointer to message structures</param>
        /// <param name="pNumMsgs">Indicates how many message structures have been provided; on return, indicates how many messages were received.</param>
        /// <param name="Timeout">Read timeout, in milliseconds.</param>
        /// <returns>See Status enumeration</returns>
        public PassThruStatus PassThruReadMsg(
            UInt32 ChannelID,
            PassThruMsg pMsg,
            UInt32 Timeout)
        {
            UInt32 numMsgs = 1;

            return((PassThruStatus)NativeMock.PassThruReadMsg(ChannelID, pMsg, ref numMsgs, Timeout));
        }
Beispiel #5
0
        /// <summary>
        /// Send messages to the ECU.
        /// </summary>
        /// <remarks>
        /// This is a single-message hack to get around the marshaling problem w/ PassThruWriteMsgs.
        /// </remarks>
        /// <param name="messages">Pointer to message structures</param>
        /// <param name="timeout">Write timeout, in milliseconds.</param>
        public void WriteMessage(
            PassThruMsg message,
            TimeSpan timeout)
        {
            PassThruStatus status = this.implementation.PassThruWriteMsg(
                this.channelId,
                message,
                (UInt32)timeout.TotalMilliseconds);

            PassThruUtility.ThrowIfError(status);
        }
Beispiel #6
0
        /// <summary>
        /// Read messages and indications from the receive buffer.
        /// </summary>
        /// <param name="message">Pointer to message structures</param>
        /// <param name="timeout">Read timeout, in milliseconds.</param>
        /// <returns>True if a message was read, false if not.</returns>
        public bool ReadMessage(
            PassThruMsg message,
            TimeSpan timeout)
        {
            PassThruStatus status = this.implementation.PassThruReadMsg(
                this.channelId,
                message,
                (UInt32)timeout.TotalMilliseconds);

            PassThruUtility.ThrowIfError(status);
            return(true);
        }
Beispiel #7
0
        /// <summary>
        /// Immediately queue the given message, and re-send at the specified interval.
        /// </summary>
        /// <param name="message">Pointer to a single message structure</param>
        /// <param name="interval">Interval between the start of successive transmissions, in milliseconds.  Valid range is 5-65535.</param>
        /// <returns>message ID</returns>
        public UInt32 StartPeriodicMessage(
            PassThruMsg message,
            TimeSpan interval)
        {
            UInt32         messageId;
            PassThruStatus status = this.implementation.PassThruStartPeriodicMsg(
                this.channelId,
                message,
                out messageId,
                (UInt32)interval.TotalMilliseconds);

            PassThruUtility.ThrowIfError(status);
            return(messageId);
        }
Beispiel #8
0
 /// <summary>
 /// Apply a filter to incoming messages.
 /// </summary>
 /// <param name="ChannelID">Channel identifier returned from PassThruConnect</param>
 /// <param name="FilterType">See FilterType enumeration</param>
 /// <param name="pMaskMsg">This message will be bitwise-ANDed with incoming messages to mask irrelevant bits.</param>
 /// <param name="pPatternMsg">This message will be compared with the masked messsage; if equal the FilterType operation will be applied.</param>
 /// <param name="pFlowControlMsg">Must be null for Pass or Block filter types.  For FlowControl filters, points to the CAN ID used for segmented sends and receives.</param>
 /// <param name="pFilterID">Upon return, will be set with an ID for the newly applied filter.</param>
 /// <returns>See Status enumeration</returns>
 public PassThruStatus PassThruStartMsgFilter(
     UInt32 ChannelID,
     UInt32 FilterType,
     PassThruMsg pMaskMsg,
     PassThruMsg pPatternMsg,
     PassThruMsg pFlowControlMsg,
     out UInt32 pFilterID)
 {
     return((PassThruStatus)NativeMock.PassThruStartMsgFilter(
                ChannelID,
                FilterType,
                pMaskMsg,
                pPatternMsg,
                pFlowControlMsg,
                out pFilterID));
 }
Beispiel #9
0
        /// <summary>
        /// Apply a flow-control filter to incoming messages.
        /// </summary>
        /// <param name="ChannelID">Channel identifier returned from PassThruConnect</param>
        /// <param name="FilterType">See FilterType enumeration</param>
        /// <param name="pMaskMsg">This message will be bitwise-ANDed with incoming messages to mask irrelevant bits.</param>
        /// <param name="pPatternMsg">This message will be compared with the masked messsage; if equal the FilterType operation will be applied.</param>
        /// <param name="pFlowControlMsg">Points to the CAN ID used for segmented sends and receives.</param>
        /// <param name="pFilterID">Upon return, will be set with an ID for the newly applied filter.</param>
        /// <returns>message filter ID</returns>
        public UInt32 StartFlowControlMessageFilter(
            PassThruMsg maskMessage,
            PassThruMsg patternMessage,
            PassThruMsg flowControlMessage)
        {
            UInt32         filterId;
            PassThruStatus status = this.implementation.PassThruStartMsgFilter(
                this.channelId,
                (UInt32)PassThruFilterType.FlowControl,
                maskMessage,
                patternMessage,
                flowControlMessage,
                out filterId);

            PassThruUtility.ThrowIfError(status);
            return(filterId);
        }
Beispiel #10
0
        /// <summary>
        /// Apply a pass/block filter to incoming messages.
        /// </summary>
        /// <param name="filterType">See FilterType enumeration</param>
        /// <param name="maskMessage">This message will be bitwise-ANDed with incoming messages to mask irrelevant bits.</param>
        /// <param name="patternMessage">This message will be compared with the masked messsage; if equal the FilterType operation will be applied.</param>
        /// <param name="pFilterID">Upon return, will be set with an ID for the newly applied filter.</param>
        /// <returns>message filter ID</returns>
        public UInt32 StartMessageFilter(
            PassThruFilterType filterType,
            PassThruMsg maskMessage,
            PassThruMsg patternMessage)
        {
            UInt32         filterId;
            PassThruMsg    flowControl = new PassThruMsg(PassThruProtocol.Iso9141);
            PassThruStatus status      = this.implementation.PassThruStartMsgFilter(
                this.channelId,
                (UInt32)filterType,
                maskMessage,
                patternMessage,
                flowControl,
                out filterId);

            PassThruUtility.ThrowIfError(status);
            return(filterId);
        }
Beispiel #11
0
        /// <summary>
        /// Set up the filters for an SSM connection
        /// </summary>
        private void InitializeSsmFilter()
        {
            PassThruMsg maskMsg = new PassThruMsg();

            maskMsg.DataSize = 1;

            PassThruMsg patternMsg = new PassThruMsg();

            patternMsg.DataSize = 1;

            // Might need to make this a private member?
            UInt32 filterId;

            // ErrorInvalidMessage w/ OP20
            PassThruStatus status = this.implementation.PassThruStartMsgFilter(
                this.channelId,
                (UInt32)PassThruFilterType.Pass,
                maskMsg,
                patternMsg,
                null,
                out filterId);

            PassThruUtility.ThrowIfError(status);
        }
Beispiel #12
0
 public static extern Int32 PassThruWriteMsg(
     UInt32 ChannelID,
     PassThruMsg pMsg,
     ref UInt32 pNumMsgs,
     UInt32 Timeout);
Beispiel #13
0
 public static extern Int32 PassThruReadMsg(
     UInt32 ChannelID,
     [In][Out][MarshalAs(UnmanagedType.LPStruct)]
     PassThruMsg pMsg,
     ref UInt32 pNumMsgs,
     UInt32 Timeout);
Beispiel #14
0
 public static extern Int32 PassThruStartPeriodicMsg(
     UInt32 ChannelID,
     PassThruMsg pMsg,
     out UInt32 pMsgId,
     UInt32 TimeInterval);
Beispiel #15
0
 public PassThruStatus PassThruStartMsgFilter(uint ChannelID, uint FilterType, PassThruMsg pMaskMsg, PassThruMsg pPatternMsg, PassThruMsg pFlowControlMsg, out uint pFilterID)
 {
     return((PassThruStatus)this.passThruStartMsgFilter(ChannelID, FilterType, pMaskMsg, pPatternMsg, pFlowControlMsg, out pFilterID));
 }
Beispiel #16
0
 public PassThruStatus PassThruStartPeriodicMsg(uint ChannelID, PassThruMsg pMsg, out uint pMsgId, uint TimeInterval)
 {
     return((PassThruStatus)this.passThruStartPeriodicMsg(ChannelID, pMsg, out pMsgId, TimeInterval));
 }
Beispiel #17
0
        public PassThruStatus PassThruWriteMsg(uint ChannelID, PassThruMsg pMsg, uint Timeout)
        {
            UInt32 numMsgs = 1;

            return((PassThruStatus)this.passThruWriteMsg(ChannelID, pMsg, ref numMsgs, Timeout));
        }