Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate API and Program #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

matt-garman
Copy link

This is a fairly dramatic change, as I also reformatted most of the code to be a bit more consistent.

In short, I separated the details of the USB functionality from the actual CLI program. I also hid all the details of the USB code into a simple API:

typedef struct usb_temper* usb_temper_t;

usb_temper_t usb_temper_init(int devicenum, int debug, int calibration);
float        usb_temper_get_tempc(usb_temper_t usb_temper);
int          usb_temper_finish(usb_temper_t* usb_temper);

The goal here is just to make everything more modular. This also sets the stage for my next PR, which adds SQLite logging capabilities...

basically just main().  Added sensorapi.[ch] which abstracts all the
USB access into a simple API.  pcsensor.c modified to use the new
API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant