OBDX-Pro-Admin / OBDX-Templates

Templates and Examples using OBDX Scantools for Windows and MAUI
1 stars 4 forks source link

Cant read message #3

Open RomanNagornyi opened 6 months ago

RomanNagornyi commented 6 months ago

Hello, I was able to read can message with can hacker, but cant send a message from outside to OBDx. There is a piece of my code. Please tell me what I am missing.


        {
            //Set OBD Protocol to CANBus - returns error code plus protocol byte set.
            AppendToLog("Setting OBD Protocol to HS CAN");
            Tuple<Errors, byte> RsltError2 = await MyOBDXScantool.SetOBDProtocol(Protocols.HSCAN);
            if (RsltError2.Item1 != Errors.Success)
            {
                //Errors possible in set OBD Protocol are: 
                await MyOBDXScantool.Disconnect();
                MessageBox.Show("An error has occured while trying to set OBD Protocol.");
            }
            RsltError2 = await MyOBDXScantool.SetOBDEnabledStatus(1);
            while (true)
            {
                AppendToLog("Searching for response from ECU");
                Tuple<Errors, NetworkMessage> RsltError4 = await MyOBDXScantool.ReadNetworkFrame(2000, 2);
                if (RsltError4.Item1 != Errors.Success)
                {
                    AppendToLog("An error has occured while trying read OBD message.");
                }
            }
        }```
Tazzi3 commented 6 months ago

@RomanNagornyi You need to set a filter as well so the OBDX can begin receiving over the data you want and start sending it to the PC.