moving data from an application to an external device
I am trying to find a source of information that will explain how data flows from an application to an external device using a computer running w10
In my situation, the application is Techstream and the external device is an OBDII scanner plugged into a connect in a car. These details are not critical.
here is my guess as to how the data flows:
- before the application is executed, the user must connect the external device to his computer via a communication channel. for simplicity purposes, I am defining that
channel as a USB physical port. - the o/s detects a device on the physical port and from o/s querries, the o/s loads a driver for the external device. in this case, the external device is merely a pass through
device. it accepts a serial stream from the usb physical port and transforms the data into a form recognized by the CAN bus in the car. The data is not altered. merely its form and signal. - the application is started by the user.
- the user, through the application forms a query looking for information from the car.it puts that query at a designated spot in memory. how the application knew where
to put the query data is unknown to me. how the o/s knows that data has been put in that location in memory and is ready to be moved by the driver is unknown to me. - i am guessing the application makes a system call to ????? which actuates the driver to move the data from memory location x to a designated physical port to which the
driver has been assigned. - the data is buffered by the usb port and sent out according to the ability of the external device to receive the data. i am assuming usb protocol defines that data movement.
- the data is passed to the CAN bus in the car by the external device.
- the relevant computer on the CAN bus processes the query and returns the requested data on the CAN bus
- the external device detects data on the CAN bus being sent back in response to the query
- the external device transforms the data according to USB protocol and sends it to the physical usb port.
- the physical usb port in the computer causes the driver to pick up the data and the driver deposits it to some location in memory
- somehow the o/s knows to notify the application that data is available in response to the query the application just sent out.
- i am assuming it is a software interrupt. but maybe it is accomplished through the use of objects which have the ability to set a flag that the application can poll to detect a response.
so that is the best i can do to try and explain how data might move from an applicaiton to an external device. any corrections and better detail will be appreciated. pointing me to a book or article would be gratefully appreciated.
Thank you
bil