Comments (3)
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.
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.
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)
- Parameter ComPort needed HOT 1
- project error HOT 1
- WebService Issue HOT 3
- Loss of communication hangs obd.net HOT 2
- Nuget packages
- Adding a new PID, struggling...., c# newbie HOT 2
- OBD Port Issue HOT 1
- Extracting Vehicle Identification Number HOT 1
- J1939 Parser HOT 2
- PID 01 For MIL lamp status HOT 2
- Move EnhancedSerialPort and SerialConnection out of OBD.Desktop HOT 2
- Trying on Tesla Model3 HOT 2
- Async-Example throws OperationCanceledException HOT 1
- ATSH Command HOT 1
- Establishing connection HOT 2
- Reading MIL Status & DTCs HOT 4
- clear diagnostic trouble HOT 2
- C#6 compatibility HOT 1
- Supported Pids
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obd.net.