From c1a00595d40a1bdc1c3528af9f15e22fb42c6839 Mon Sep 17 00:00:00 2001 From: Austin Morlan Date: Thu, 30 Nov 2017 09:02:53 -0800 Subject: [PATCH 1/2] Make module enable/disable commands public --- api/include/oscc.h | 72 +++++++++++++++++++++++++++++++++++++++++ api/src/internal/oscc.h | 18 ----------- 2 files changed, 72 insertions(+), 18 deletions(-) diff --git a/api/include/oscc.h b/api/include/oscc.h index 39c06314..52765ec0 100644 --- a/api/include/oscc.h +++ b/api/include/oscc.h @@ -72,6 +72,78 @@ oscc_result_t oscc_enable( void ); oscc_result_t oscc_disable( void ); +/** + * @brief Send enable command to brake module. + * + * @param [void] + * + * @return OSCC_ERROR or OSCC_OK + * + */ +oscc_result_t oscc_enable_brakes( + void ); + + +/** + * @brief Send enable command to steering module. + * + * @param [void] + * + * @return OSCC_ERROR or OSCC_OK + * + */ +oscc_result_t oscc_enable_steering( + void ); + + +/** + * @brief Send enable command to throttle module. + * + * @param [void] + * + * @return OSCC_ERROR or OSCC_OK + * + */ +oscc_result_t oscc_enable_throttle( + void ); + + +/** + * @brief Send disable command to brake module. + * + * @param [void] + * + * @return OSCC_ERROR or OSCC_OK + * + */ +oscc_result_t oscc_disable_brakes( + void ); + + +/** + * @brief Send disable command to steering module. + * + * @param [void] + * + * @return OSCC_ERROR or OSCC_OK + * + */ +oscc_result_t oscc_disable_steering( + void ); + + +/** + * @brief Send disable command to throttle module. + * + * @param [void] + * + * @return OSCC_ERROR or OSCC_OK + * + */ +oscc_result_t oscc_disable_throttle( + void ); + + /** * @brief Publish message with requested brake pedal position to * brake module. diff --git a/api/src/internal/oscc.h b/api/src/internal/oscc.h index e86edf2e..e3137ae6 100644 --- a/api/src/internal/oscc.h +++ b/api/src/internal/oscc.h @@ -38,24 +38,6 @@ oscc_result_t oscc_can_write( oscc_result_t oscc_async_enable( int socket ); -oscc_result_t oscc_enable_brakes( - void ); - -oscc_result_t oscc_enable_steering( - void ); - -oscc_result_t oscc_enable_throttle( - void ); - -oscc_result_t oscc_disable_brakes( - void ); - -oscc_result_t oscc_disable_steering( - void ); - -oscc_result_t oscc_disable_throttle( - void ); - void oscc_update_status( ); From 08b282e21ccb8e958ff32fd6e519c8b6cdef53da Mon Sep 17 00:00:00 2001 From: Boris Bidault Date: Mon, 28 Jan 2019 14:58:04 -0800 Subject: [PATCH 2/2] refactoring --- api/include/oscc.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/api/include/oscc.h b/api/include/oscc.h index 52765ec0..b12d7976 100644 --- a/api/include/oscc.h +++ b/api/include/oscc.h @@ -80,8 +80,7 @@ oscc_result_t oscc_disable( void ); * @return OSCC_ERROR or OSCC_OK * */ -oscc_result_t oscc_enable_brakes( - void ); +oscc_result_t oscc_enable_brakes( void ); /** @@ -92,8 +91,7 @@ oscc_result_t oscc_enable_brakes( * @return OSCC_ERROR or OSCC_OK * */ -oscc_result_t oscc_enable_steering( - void ); +oscc_result_t oscc_enable_steering( void ); /** @@ -104,8 +102,7 @@ oscc_result_t oscc_enable_steering( * @return OSCC_ERROR or OSCC_OK * */ -oscc_result_t oscc_enable_throttle( - void ); +oscc_result_t oscc_enable_throttle( void ); /** @@ -116,8 +113,7 @@ oscc_result_t oscc_enable_throttle( * @return OSCC_ERROR or OSCC_OK * */ -oscc_result_t oscc_disable_brakes( - void ); +oscc_result_t oscc_disable_brakes( void ); /** @@ -128,8 +124,7 @@ oscc_result_t oscc_disable_brakes( * @return OSCC_ERROR or OSCC_OK * */ -oscc_result_t oscc_disable_steering( - void ); +oscc_result_t oscc_disable_steering( void ); /** @@ -140,8 +135,7 @@ oscc_result_t oscc_disable_steering( * @return OSCC_ERROR or OSCC_OK * */ -oscc_result_t oscc_disable_throttle( - void ); +oscc_result_t oscc_disable_throttle( void ); /**