Ejemplo n.º 1
0
        private bool ProcessMessage_OBD(BlockMessage obd_msg, ref BlockMessage ResponseMessage)
        {
            bool bRet = false;

            switch ((ENUM_SID)obd_msg.GetSID())
            {
            case ENUM_SID.ReadDiagnosticTroubleCodesByStatus:
                List <byte> in_list = obd_msg.GetDataList();
                ReadDiagnosticTroubleCodesByStatus_OBD_StatusOfDTC = (uint)in_list.IndexOf(0);
                ReadDiagnosticTroubleCodesByStatus_OBD_GroupOfDTC  = (uint)in_list.IndexOf(1) + ((uint)in_list.IndexOf(2)) << 8;
                PrepareResponse_ReadDiagnosticTroubleCodesByStatus_OBD(obd_msg, ref ResponseMessage);
                bRet = true;
                break;

            case ENUM_SID.StartCommunication:
                PrepareResponse_StartCommunication_OBD(obd_msg, ref ResponseMessage);
                bRet = true;
                break;

            case ENUM_SID.StopCommunication:
                PrepareResponse_StopCommunication_OBD(obd_msg, ref ResponseMessage);
                bRet = true;
                break;

            default:
                break;
            }

            return(bRet);
        }
Ejemplo n.º 2
0
        private BlockMessage PrepareResponse_StopCommunication_ABS(BlockMessage in_msg, ref BlockMessage out_msg)
        {
            List <byte> out_list = new List <byte>();

            out_msg = new BlockMessage((byte)((((uint)MSG_A1A0_MODE.WITH_ADDRESS_INFO) << 6)), in_msg.GetSA(), in_msg.GetTA(),
                                       (byte)(in_msg.GetSID() | RETURN_SID_OR_VALUE), out_list, true);          // for format_4
            return(out_msg);
        }
Ejemplo n.º 3
0
        private BlockMessage PrepareResponse_ReadDiagnosticTroubleCodesByStatus_ABS(BlockMessage in_msg, ref BlockMessage out_msg)
        {
            List <byte> out_list = GenerateQueuedResponseData_ABS();

            out_msg = new BlockMessage((byte)((((uint)MSG_A1A0_MODE.WITH_ADDRESS_INFO) << 6)), in_msg.GetSA(), in_msg.GetTA(),
                                       (byte)(in_msg.GetSID() | RETURN_SID_OR_VALUE), out_list, true);          // for format_4
            return(out_msg);
        }
Ejemplo n.º 4
0
        private BlockMessage PrepareResponse_StartCommunication_OBD(BlockMessage in_msg, ref BlockMessage out_msg)
        {
            List <byte> out_list = new List <byte>();

            out_list.Add((byte)(OBD_KeyByte_for_StartCommunication & 0xff));
            out_list.Add((byte)((OBD_KeyByte_for_StartCommunication >> 8) & 0xff));
            out_msg = new BlockMessage((byte)((((uint)MSG_A1A0_MODE.WITH_ADDRESS_INFO) << 6)), in_msg.GetSA(), in_msg.GetTA(),
                                       (byte)(in_msg.GetSID() | RETURN_SID_OR_VALUE), out_list, false);          // for format_2
            return(out_msg);
        }
Ejemplo n.º 5
0
        private BlockMessage PrepareNegativeResponse_MsgErrort_ReadDiagnosticTroubleCodesByStatus_ABS(BlockMessage in_msg, ref BlockMessage out_msg)
        {
            List <byte> out_list = new List <byte>();

            out_list.Add(in_msg.GetSID());
            out_list.Add(NegativeResponse_MsgError_ReadDiagnosticTroubleCodesByStatus_ResponseCode);
            out_msg = new BlockMessage((byte)((((uint)MSG_A1A0_MODE.WITH_ADDRESS_INFO) << 6)), in_msg.GetSA(), in_msg.GetTA(),
                                       NEGATIVE_RESPONSE_SID, out_list, true);          // for format_4
            return(out_msg);
        }