With the next update I'll post later today, I will also be adding a lot more functionaltity to the plugins. The faker plugin will now read values from a file and use them as the data values it generates rather then just random values. It will set a value of 10 if theres no data in the file. The format of the file it reads would just be comma delimited lines with the Pid as the first item on it followed by the values it should spit out. i.e. for speed from 0 to 60 it would be
Code:
13, 0, 1, 4, 10, 25, 40, 39, 50, 60
The values are generated every 300 milliseconds just like the ELM device normally does. values will repeat once it gets to the end of loaded values.
In conjunction with this, the debug build of the ELM plugin will automatically log all values its set to capture to a new log file named after the current time.
The interface for the plugin also changed slightly, I added a msg id parameter to the create function. This id will be sent to the handle to the window you specify for the hWnd parameter of the create function whenever events occur. Events are now generated every time a new value for a PID is recieved or whenever errors occur in the reading thread. i.e. whenever a packet is read from the COM port this line is called:
Code:
//Send a message to the registered window that a new message was recieved
if (m_hWnd)
PostMessage(m_hWnd, m_nMsgId, eOBDMsgRecievedValue, eOBDPID);
You'll just need to watch for the message id you used in the create call in your windows message loop (In VB I think you'll need the msghook control for this though). Reading the values in a timer will still work just the same too if you don't want to do it event driven.
Also besides MPG, are there any other things your planning on doing with the plugin? Like horsepower! I wanted to add MPG and horsepower to my own app, but between writing the dlls and the other stuff, I've just never had the time to figure out the equations.
Also if you have any other requests for functionality in the plugin format, I plan on freezing the interface format for this API version after the end of this weekend, so no more interface changes will happen after that without changing the API version number.