Coder Social home page Coder Social logo

Set Service Mode about obd.net HOT 3 CLOSED

darthaffe avatar darthaffe commented on June 9, 2024
Set Service Mode

from obd.net.

Comments (3)

dakriege avatar dakriege commented on June 9, 2024

Recreated a function to send a Service Code 09 , PID 02 Vehicle Vin.

Set mode to : Mode = Mode.RequestVehicleInformation;
When the 0902 command is sent the adapter returns a multi line response.

it doesn't appear that you designed the driver to receive a multiple line response from the adapter.

9/20/2019 7:08:37 AM - Debug - Requesting SC 09 Type VehicleVin ...
9/20/2019 7:08:37 AM - Debug - Requesting SC 09: PID 02 ...
9/20/2019 7:08:37 AM - Verbose - Queuing Command: '0902''
9/20/2019 7:08:37 AM - Verbose - Writing Command: '0902''
9/20/2019 7:08:37 AM - Verbose - Response: 'SEARCHING...'
9/20/2019 7:08:42 AM - Verbose - Response: '014'
9/20/2019 7:08:42 AM - Verbose - Response: '0:490201314654'
9/20/2019 7:08:42 AM - Verbose - Response: '1:4C523446455842'
9/20/2019 7:08:42 AM - Verbose - Response: '2:50413938393934'

OnDataReceived calls FinishLine() for each line returned in the response.
Shouldn't it be testing for '>' end of command, versus FinishLine() on an \r to know the entire response has been sent ?

Finishline() then calls ProcessMessage for each line returned versus concatenating the entire response then calling ProcessMesage.

My VehicleVin data type never gets processed to return the VIN.

It converts the RawData 17 bytes to a String.

I'm going to try some tests in the response processing.

from obd.net.

DarthAffe avatar DarthAffe commented on June 9, 2024

Yes, right now it's not designed to work with multi-line responses, but since the command is finished with the prompt (>) it should be possible to change that without causing too much side effects.
I'm just not sure which is better: Making the result more abstract to distinguish between single/multi-line result or changing everything to handle multiple lines (even if data-commands are always returning only one).

from obd.net.

dakriege avatar dakriege commented on June 9, 2024

Changes made to the driver to support:

PID 01 01 - Monitor Status of DTCs - Added a new PID data type - DTCStatus which returns a single value indicating - Check Engine and number of active DTCs

Added multi-line response support for Service Mode 03 and 0902

Modified - QueuedCommand class - Added a property to to store a multi-line response string
Modified - OnDataReceived() and FinishLine(), InternalProcessMessage(), ProcessResponse(), AbstractOBDData.Load()

OnDataReceived() tests the CurrentCommand.Text for a command 03 (DTC Codes) or a command 0902 (Vin) if either are true a global is set indicating the response is multi-line

If the multi-line global is set the response lines are concatenated and then saved to the raw data buffer. The response classes for the 03 and 0902 are saved as a string. The strings are then parsed in the requestData responses by the application.

Service Mode 03 - Read stored DTC codes - Added a new request data function - RequestDataSC03 which sends the the command '03' to the module. There is no PID.

Service Mode 0902 - Read the VIN - Added a new request Data function - RequestDataSC09

from obd.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.