summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--agl-identity-agent.service.in1
-rw-r--r--btle-advise.service8
-rw-r--r--btle-advise.timer6
4 files changed, 17 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d0d3989..d9d7bd1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,6 +58,8 @@ configure_file(agl-identity-agent.service.in agl-identity-agent.service @ONLY)
INSTALL(FILES
${CMAKE_CURRENT_BINARY_DIR}/agl-identity-agent.service
+ ${CMAKE_CURRENT_SOURCE_DIR}/btle-advise.service
+ ${CMAKE_CURRENT_SOURCE_DIR}/btle-advise.timer
DESTINATION
${PROJECT_DESTINATION}
)
diff --git a/agl-identity-agent.service.in b/agl-identity-agent.service.in
index 6fc779b..5381946 100644
--- a/agl-identity-agent.service.in
+++ b/agl-identity-agent.service.in
@@ -1,5 +1,6 @@
[Unit]
Description=AGL identity agent
+Requires=btle-advise.service
[Service]
User=root
diff --git a/btle-advise.service b/btle-advise.service
new file mode 100644
index 0000000..1a34237
--- /dev/null
+++ b/btle-advise.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=activates advertising of BlueTooth Low-Energy on hci0
+
+[Service]
+Type=oneshot
+ExecStart=/bin/bash -c "rfkill list|sed '/[bB]luetooth/!d;s/:.*//'|xargs -n1 rfkill unblock"
+ExecStart=/bin/bash -c "hcitool dev|tail -n+2|cut -f2|xargs -n1 -IX hciconfig X leadv"
+
diff --git a/btle-advise.timer b/btle-advise.timer
new file mode 100644
index 0000000..b02594c
--- /dev/null
+++ b/btle-advise.timer
@@ -0,0 +1,6 @@
+[Unit]
+Description=Ensure BLE advise is up
+
+[Timer]
+AccuracySec=1min
+OnUnitActiveSec=1min