Skip to content

Commit f270af4

Browse files
authored
Merge pull request #3551 from smartdevicelink/release/7.0.0
7.0.0 Release
2 parents 0ce7625 + 618a5e0 commit f270af4

File tree

1,095 files changed

+50936
-106526
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,095 files changed

+50936
-106526
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[![Slack Status](http://sdlslack.herokuapp.com/badge.svg)](http://slack.smartdevicelink.com)
2-
[![Build Status](http://opensdl-jenkins.luxoft.com:8080/view/develop/job/develop_nightly_coverage/badge/icon)](http://opensdl-jenkins.luxoft.com:8080/view/develop/job/develop_nightly_coverage/)
2+
[![Build Status](https://opensdl-jenkins.prjdmz.luxoft.com/job/develop_weekly_coverage/badge/icon?subject=UT%20coverage%20build)](https://opensdl-jenkins.prjdmz.luxoft.com/job/develop_weekly_coverage/)
3+
[![Build Status](https://opensdl-jenkins.prjdmz.luxoft.com/view/Smokes/job/Develop_TCP_ATF_Smoke_P/badge/icon?subject=Smoke%20tests)](https://opensdl-jenkins.prjdmz.luxoft.com/view/Smokes/job/Develop_TCP_ATF_Smoke_P/)
4+
[![Build Status](https://opensdl-jenkins.prjdmz.luxoft.com/job/Develop_SDL_Checkstyle/badge/icon?subject=Coding%20style)](https://opensdl-jenkins.prjdmz.luxoft.com/job/Develop_SDL_Checkstyle/)
35

46
# SmartDeviceLink (SDL)
57

@@ -11,14 +13,14 @@ SmartDeviceLink (SDL) is a standard set of protocols and messages that connect a
1113

1214
## SDL Core
1315

14-
The Core component of SDL runs on a vehicle's computing system (head unit). Core’s primary responsibility is to route messages between connected smartphone applications and the vehicle HMI. It can connect a smartphone to a vehicle's head unit via a variety of transport protocols such as Bluetooth, USB, Android AOA, and TCP. Once a connection is established, Core discovers compatible applications and displays them to the driver for interaction via voice or display. The Core component is configured to follow a set of policies defined in its local policy database and updated by a [policy server](https://www.github.com/smartdevicelink/sdl_server). The messaging between a connected application and SDL Core is defined by the [Mobile API](https://github.com/smartdevicelink/sdl_core/blob/master/src/components/interfaces/MOBILE_API.xml) and the messaging between SDL Core and the vehicle is defined by the [HMI API](https://github.com/smartdevicelink/sdl_core/blob/master/src/components/interfaces/HMI_API.xml).
16+
The Core component of SDL runs on a vehicle's computing system (head unit). Core’s primary responsibility is to route messages between connected smartphone applications and the vehicle HMI. It can connect a smartphone to a vehicle's head unit via a variety of transport protocols such as Bluetooth, USB, Android AOA, and TCP. Once a connection is established, Core discovers compatible applications and displays them to the driver for interaction via voice or display. The Core component is configured to follow a set of policies defined in its local policy database and updated by a [policy server](https://www.github.com/smartdevicelink/sdl_server). The messaging between a connected application and SDL Core is defined by the [Mobile API](https://github.com/smartdevicelink/rpc_spec/blob/master/MOBILE_API.xml) and the messaging between SDL Core and the vehicle is defined by the [HMI API](https://github.com/smartdevicelink/sdl_core/blob/master/src/components/interfaces/HMI_API.xml).
1517

1618
Pull Requests Welcome!
1719

1820
## Environment
1921
Currently supported:
2022
* Ubuntu Linux 16.04 with GCC 5.4.x
21-
* Ubuntu Linux 18.04 with GCC 7.3.x
23+
* Ubuntu Linux 18.04 with GCC 7.5.x
2224
* [C++11 standard](https://github.com/smartdevicelink/sdl_evolution/issues/132)
2325

2426
## Getting Started

cppcheck.xml

Whitespace-only changes.

src/3rd_party/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ if (NOT ${Boost_FOUND})
235235
include(ExternalProject)
236236
ExternalProject_Add(
237237
Boost
238-
URL https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
238+
URL https://mirror.bazel.build/dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
239+
URL_HASH SHA256=da3411ea45622579d419bfda66f45cd0f8c32a181d84adfa936f5688388995cf
239240
DOWNLOAD_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
240241
SOURCE_DIR ${BOOST_LIB_SOURCE_DIRECTORY}
241242
CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=system,thread,date_time,filesystem,regex --prefix=${3RD_PARTY_INSTALL_PREFIX}

src/appMain/CMakeLists.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/smartDeviceLink.ini DESTINATION ${CMAKE_CU
167167
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/hmi_capabilities.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
168168
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/sdl_preloaded_pt.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
169169
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/sample_policy_manager.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
170-
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/start.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
171-
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/start_external_proprietary.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
170+
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/core.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
171+
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/core_external_proprietary.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
172172
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
173173
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/init_policy.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
174174
endif ()
@@ -246,15 +246,19 @@ if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
246246
endif ()
247247

248248
if (${EXTENDED_POLICY} STREQUAL "EXTERNAL_PROPRIETARY")
249-
install(FILES start_external_proprietary.sh DESTINATION bin
249+
install(FILES core_external_proprietary.sh DESTINATION bin
250250
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
251-
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE RENAME start.sh)
251+
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE RENAME core.sh)
252252
else()
253-
install(FILES start.sh DESTINATION bin
253+
install(FILES core.sh DESTINATION bin
254254
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
255255
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
256256
endif()
257257

258+
install(FILES start.sh daemon.sh DESTINATION bin
259+
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
260+
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
261+
258262
if(BUILD_TESTS)
259263
add_subdirectory(test)
260264
endif()

src/appMain/core.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
DIR=$(dirname $0)
3+
4+
EXTERNAL_POLICIES=false
5+
if [ "$2" = "true" ]; then
6+
EXTERNAL_POLICIES=true
7+
fi
8+
$DIR/daemon.sh $1 $EXTERNAL_POLICIES
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
DIR=$(dirname $0)
3+
4+
EXTERNAL_POLICIES=true
5+
# Allow for manual override to disable sample policy server
6+
if [ "$2" = "false" ]; then
7+
EXTERNAL_POLICIES=false
8+
fi
9+
$DIR/daemon.sh $1 $EXTERNAL_POLICIES

src/appMain/daemon.sh

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
#!/bin/bash
2+
cd $(dirname $0)
3+
COMMAND=$1
4+
EXTERNAL_POLICIES=$2
5+
DIR=$(pwd)
6+
7+
CORE_PID_FILE=${DIR}/core.pid
8+
CORE_APPLICATION_NAME=smartDeviceLinkCore
9+
PM_PID_FILE=${DIR}/policy_manager.pid
10+
PM_APPLICATION_NAME=sample_policy_manager.py
11+
12+
function core_start() {
13+
if [ -f "$CORE_PID_FILE" ] && [ -n "$(ps -p $(cat $CORE_PID_FILE) -o pid=)" ]; then
14+
echo "Core is already running"
15+
return 1
16+
elif [ -n "$(pgrep -f $CORE_APPLICATION_NAME)" ]; then
17+
echo "Core is already running outside of this script"
18+
echo "All instances of Core can be stopped using the \"kill\" command"
19+
return 2
20+
else
21+
echo "Starting SmartDeviceLink Core"
22+
LD_LIBRARY_PATH=$DIR ${DIR}/${CORE_APPLICATION_NAME} &
23+
CORE_PID=$!
24+
echo $CORE_PID > $CORE_PID_FILE
25+
return 0
26+
fi
27+
}
28+
29+
function core_stop() {
30+
RESULT=1
31+
if [ -f "$CORE_PID_FILE" ] && [ -n "$(ps -p $(cat $CORE_PID_FILE) -o pid=)" ]; then
32+
echo "Stopping SmartDeviceLink Core"
33+
CORE_PID=$(cat $CORE_PID_FILE)
34+
kill $CORE_PID
35+
36+
# If Core doesn't close normally within 10 seconds, force-close it
37+
timeout 10s tail --pid=$CORE_PID -f /dev/null
38+
if [ -n "$(ps -p $CORE_PID -o pid=)" ]; then
39+
echo "Core did not shut down properly, force-killing"
40+
kill -9 $CORE_PID
41+
fi
42+
RESULT=0
43+
fi
44+
45+
if [ -f "$CORE_PID_FILE" ]; then
46+
rm $CORE_PID_FILE
47+
fi
48+
return $RESULT
49+
}
50+
51+
function pm_install_dependencies() {
52+
pip3 list | grep -F tornado > /dev/null
53+
if [ $? -eq 1 ]; then
54+
echo "Installing tornado python package"
55+
sudo -H pip3 install tornado
56+
fi
57+
}
58+
59+
function pm_start() {
60+
if [ -f "$PM_PID_FILE" ] && [ -n "$(ps -p $(cat $PM_PID_FILE) -o pid=)" ]; then
61+
echo "Policy Server is already running"
62+
return 1
63+
elif [ -n "$(pgrep -f $PM_APPLICATION_NAME)" ]; then
64+
echo "Policy Server is already running outside of this script"
65+
echo "All instances of Core can be stopped using the \"kill\" command"
66+
return 2
67+
else
68+
pm_install_dependencies
69+
echo "Starting Policy Manager"
70+
python3 ${DIR}/${PM_APPLICATION_NAME} --pack_port 8088 --unpack_port 8089 --add_http_header --encryption &
71+
PM_PID=$!
72+
echo $PM_PID > $PM_PID_FILE
73+
return 0
74+
fi
75+
}
76+
77+
function pm_stop() {
78+
RESULT=1
79+
if [ -f "$PM_PID_FILE" ] && [ -n "$(ps -p $(cat $PM_PID_FILE) -o pid=)" ]; then
80+
echo "Stopping Policy Manager"
81+
kill -INT $(cat $PM_PID_FILE)
82+
kill -9 $(cat $PM_PID_FILE)
83+
RESULT=0
84+
fi
85+
86+
# Clear PID regardless of whether the process was running or not
87+
if [ -f "$PM_PID_FILE" ]; then
88+
rm $PM_PID_FILE
89+
fi
90+
return $RESULT
91+
}
92+
93+
if [ "$COMMAND" == "stop" ]; then
94+
core_stop
95+
if [ "$?" -ne 0 ]; then
96+
echo "Core is not running (or was started outside of this script)"
97+
fi
98+
99+
if [ "$EXTERNAL_POLICIES" == "true" ]; then
100+
pm_stop
101+
if [ "$?" -ne 0 ]; then
102+
echo "Policy Server is not running (or was started outside of this script)"
103+
fi
104+
fi
105+
elif [ "$COMMAND" == "restart" ]; then
106+
core_stop
107+
if [ "$?" -eq 0 ]; then
108+
core_start
109+
else
110+
echo "Core is not running (or was started outside of this script)"
111+
fi
112+
113+
if [ "$EXTERNAL_POLICIES" == "true" ]; then
114+
pm_stop
115+
if [ "$?" -eq 0 ]; then
116+
pm_start
117+
else
118+
echo "Policy Server is not running (or was started outside of this script)"
119+
fi
120+
fi
121+
elif [ "$COMMAND" == "start" ]; then
122+
core_start
123+
if [ "$EXTERNAL_POLICIES" == "true" ]; then
124+
pm_start
125+
fi
126+
elif [ "$COMMAND" == "kill" ]; then
127+
core_stop
128+
pkill -9 -f $CORE_APPLICATION_NAME
129+
if [ "$?" -eq 0 ]; then
130+
echo "Killed all lingering instances of SDL Core"
131+
fi
132+
133+
if [ "$EXTERNAL_POLICIES" == "true" ]; then
134+
pm_stop
135+
pkill -9 -f $PM_APPLICATION_NAME
136+
if [ "$?" -eq 0 ]; then
137+
echo "Killed all lingering instances of the Policy Server"
138+
fi
139+
fi
140+
else
141+
echo "usage: daemon.sh [start/restart/stop/kill] [use_sample_policy_manager?]"
142+
fi

0 commit comments

Comments
 (0)