From df8f8f6cb47ccd18c0b9d7e5609e3f762a590ff3 Mon Sep 17 00:00:00 2001 From: Huan Truong Date: Sat, 31 Mar 2018 08:38:08 -0400 Subject: [PATCH] [code-cs] add crankshaft plug/unplug scripts --- src/autoapp/App.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/autoapp/App.cpp b/src/autoapp/App.cpp index b3f92a0..100293e 100644 --- a/src/autoapp/App.cpp +++ b/src/autoapp/App.cpp @@ -98,6 +98,10 @@ void App::stop() void App::aoapDeviceHandler(aasdk::usb::DeviceHandle deviceHandle) { OPENAUTO_LOG(info) << "[App] Device connected."; +#ifdef RASPBERRYPI3 + system("/opt/crankshaft/dumb_suid usb_plug.sh &"); + OPENAUTO_LOG(info) << "[CS] Ran USB Plug script."; +#endif if(androidAutoEntity_ == nullptr) { @@ -154,6 +158,11 @@ void App::onAndroidAutoQuit() androidAutoEntity_->stop(); androidAutoEntity_.reset(); +#ifdef RASPBERRYPI3 + system("/opt/crankshaft/dumb_suid usb_unplug.sh &"); + OPENAUTO_LOG(info) << "[CS] Ran USB Unplug script."; +#endif + if(!isStopped_) { this->waitForDevice();