User:Devourer09/Project documentation

Graphing program
I used Cairo and I may have also used Pango. I think the graph executable in the directory is the one that outputs the graph PNG image. You may want to check out gnuplot if you find my graphing program too troublesome to modify and use. I didn't realize that in the end I would just be using a shellscript to get this all working. The graph.h and graph.c files are where the graphing functions are defined I guess, and then main4.c is where the entry point is.

Usage of graph
My graph program has a lot of arguments, so I'll explain them here. They are all required and in this order.


 * width is the width of the graph. I forget why it's not the same as the image width but it is different.
 * height is basically the same as the width except for height.
 * xAxisBegin is what value the X axis will start at.
 * xAxisEnd is the value at which the X axis ends.
 * xAxisScale is, I think, what value the X axis will count by starting from xAxisBegin until it reaches xAxisEnd.
 * yAxisBegin same as the X axis version.
 * yAxisEnd same as the X axis version.
 * yAxisScale same as the X axis version.
 * graphTitle is the title of the whole graph.
 * xAxisLabel is the label of the X axis, so you can name it.
 * yAxisLabel is the label of the Y axis, so you can name it.
 * dataFileName is the text file with the values to be plotted.
 * imageWidth is the width of the actual PNG image.
 * imageHeight is the height of the image.
 * pngName is the name of the PNG image you want to be generated.

Important Links

 * Cairo's website has the documentation and such.
 * Cairo API reference
 * Good Cairo tutorial
 * Make a PNG with Cairo
 * How to compile the program
 * Pango API manual

USB driver
So the create.sh bash script actually builds the module from the source file test.c, I believe, into test.ko and then unloads the previous test module in the kernel that hopefully exists, and then will load the new module, and output will be displayed to the console for feedback in case of errors and such. Makefile is the makefile that actually builds the module using KBuild and then the rest of create.sh is just unloading and loading modules. Of course test.c is derived from usb-skeleton.c and edited to our liking. When you write to the device, /dev/spoon, it will make the URB and send it on its way. A read will of course read from the device.

Data app
This program is the foo executable, and it basically talks to the driver by reading and writing to it. I got it to a point where I could actually type in the hex commands on the command line and it would actually send that command and return the data. I was working on getting it so I could put the name of the text file I wanted the data to be stored in, and I could send a command and it would store the data in that file. Once the data was in the file, the graphing program could read the data and create the graphs.

Usage
This usage works.

But I was going to have it look something like this:

And it would end up creating the file if it didn't exist or add to the already existing one.