diff --git a/libraries/AP_HAL_Linux/UARTDriver.cpp b/libraries/AP_HAL_Linux/UARTDriver.cpp index 2d9917f836..47bc44596a 100644 --- a/libraries/AP_HAL_Linux/UARTDriver.cpp +++ b/libraries/AP_HAL_Linux/UARTDriver.cpp @@ -45,7 +45,7 @@ LinuxUARTDriver::LinuxUARTDriver(bool default_console) : /* set the tty device to use for this UART */ -void LinuxUARTDriver::set_device_path(char *path) +void LinuxUARTDriver::set_device_path(const char *path) { device_path = path; } diff --git a/libraries/AP_HAL_Linux/UARTDriver.h b/libraries/AP_HAL_Linux/UARTDriver.h index dcde89abf8..10acca7aa5 100644 --- a/libraries/AP_HAL_Linux/UARTDriver.h +++ b/libraries/AP_HAL_Linux/UARTDriver.h @@ -25,7 +25,7 @@ public: size_t write(uint8_t c); size_t write(const uint8_t *buffer, size_t size); - void set_device_path(char *path); + void set_device_path(const char *path); virtual void _timer_tick(void); @@ -58,7 +58,7 @@ private: uint64_t _last_write_time; protected: - char *device_path; + const char *device_path; volatile bool _initialised; // we use in-task ring buffers to reduce the system call cost // of ::read() and ::write() in the main loop