summaryrefslogtreecommitdiff
path: root/camera.h
diff options
context:
space:
mode:
authorNick Van Doorn <vandoorn.nick@gmail.com>2018-04-06 11:24:54 -0700
committerNick Van Doorn <vandoorn.nick@gmail.com>2018-04-06 11:24:54 -0700
commite000fd2750b725b1f62ba5712e01d860b559811a (patch)
tree9c6d5bf152671d493a39f361c32adf087667a6d9 /camera.h
parent195bf959d81b157456a66353da1946a7b51cbe33 (diff)
Make serial device configurable
Diffstat (limited to 'camera.h')
-rw-r--r--camera.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/camera.h b/camera.h
index ca8785b..a3291a4 100644
--- a/camera.h
+++ b/camera.h
@@ -47,9 +47,8 @@
#define CAM_BAUD_RATE 38400
#define TTY_TIMEOUT 5000
-static const char TTY_PATH[] = "/dev/ttyHS0";
-
typedef struct {
+ char devPath[256];
int fd; // file descriptor for the serial port
uint8_t serialNum; // camera serial number
uint8_t buff[CAM_BUFF_SIZE]; // uint8_t array to store camera data
@@ -124,8 +123,8 @@ void cam_sendCommand(Camera* cam, uint8_t cmd, uint8_t args[], uint8_t nArgs);
int fd_dataAvail(int fd, int* data);
ssize_t fd_getByte(int fd, uint8_t* data);
LE_SHARED int fd_closeCam(int fd);
-LE_SHARED int fd_openCam();
+LE_SHARED int fd_openCam(char* devPath);
int fd_openSerial(const char* device, int baud);
speed_t fd_convertBaud(int baud);
-#endif \ No newline at end of file
+#endif