Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant read message #3

Open
RomanNagornyi opened this issue Feb 21, 2024 · 1 comment
Open

Cant read message #3

RomanNagornyi opened this issue Feb 21, 2024 · 1 comment

Comments

@RomanNagornyi
Copy link

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
Copy link
Collaborator

Tazzi3 commented Feb 21, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants