From e000fd2750b725b1f62ba5712e01d860b559811a Mon Sep 17 00:00:00 2001 From: Nick Van Doorn Date: Fri, 6 Apr 2018 11:24:54 -0700 Subject: Make serial device configurable --- camera.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'camera.h') 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 -- cgit v1.2.3