Compare commits

..

202 Commits

Author SHA1 Message Date
15ca153a3e fix resources.qrc 2025-04-20 23:28:34 +03:00
9a79ad1cc4 Convert icons to png 2025-04-20 23:26:30 +03:00
tza
e3f4b852a1 Working version 2025-04-20 20:05:20 +00:00
9f3135066d fix hpp 2025-04-20 21:46:45 +03:00
b27dcec0b9 websocket client boilerplate 2025-04-20 20:06:35 +03:00
25c3c5171c add stacked widget 2025-04-20 19:44:41 +03:00
da5c247339 remove mute/volume from header 2025-04-20 18:21:53 +03:00
f92bd9b3f7 remove mute stuff 2025-04-20 17:59:06 +03:00
da0193dd19 remove leftover volume stuff 2025-04-20 17:50:34 +03:00
7e940ef815 fix oldmenudummy 2025-04-20 17:41:02 +03:00
a3656500e7 add bt now playing and radio 2025-04-20 17:30:30 +03:00
Matthew Hilton
82bffdb514
Merge pull request #24 from SonOfGib/AAP-1.6-crankshaft
Aap 1.6 crankshaft
2025-03-26 21:07:56 +00:00
SonOfGib
160b1552a6
Merge remote-tracking branch 'opencardev/crankshaft-ng' into AAP-1.6-crankshaft 2025-03-26 16:06:08 -04:00
SonOfGib
05a4a0a7d7
Various tweaks
* Fix bluetooth service issues when running on linux pc (experimental.)
* Service factory changes to disable bluetooth and wifi (commented out)
* Include boost logs library.
2025-02-26 20:02:23 -05:00
matt
e1940b90a6
Added CoC 2025-02-07 23:02:12 +00:00
Simon Dean
17d4bfbcda Backport LibGPS updates a79d155bd658eff85036f0d7d29486faac0bf3cc
Backport and merge artefacts from
a5cdf161ad1aefcda5425b5bef56032e1c510219
2025-01-08 18:09:54 +00:00
Simon Dean
d19a4438ca Merge branch 'crankshaft-ng' of https://github.com/opencardev/openauto into crankshaft-ng
# Conflicts:
#	include/f1x/openauto/autoapp/Configuration/Configuration.hpp
#	include/f1x/openauto/autoapp/Configuration/IConfiguration.hpp
#	src/autoapp/Configuration/Configuration.cpp
#	src/autoapp/Service/AndroidAutoEntity.cpp
#	src/autoapp/Service/SensorService.cpp
#	src/autoapp/Service/ServiceFactory.cpp
#	src/autoapp/UI/SettingsWindow.cpp
2025-01-08 17:27:25 +00:00
Matthew Hilton
1a74e9f8d9
Merge pull request #22 from opencardev/fix_libgps
Added libgps fix to support api version >7 and lower.
2025-01-08 00:00:25 +00:00
Matthew Hilton
fb618c0049
Merge pull request #21 from SonOfGib/crankshaft-ng
Disable Wifi Projection + Fix assistant hang/missing audio.
2025-01-07 23:08:31 +00:00
SonOfGib
075c356122
Wireless projection should default to true.
* When ini file was not present, the default value was set to false instead of true.
2025-01-07 18:06:00 -05:00
matt
a79d155bd6
Added libgps fix to support api version >7 and lower. 2025-01-07 23:05:19 +00:00
Simon Dean
64b9c1370f Switch back to CrankShaft branding 2025-01-07 22:35:28 +00:00
Simon Dean
f456ce8dfa Merge remote-tracking branch 'origin/JourneyOS' into crankshaft-ng
# Conflicts:
#	CMakeLists.txt
#	include/f1x/openauto/autoapp/Projection/IVideoOutput.hpp
#	include/f1x/openauto/autoapp/Projection/InputEvent.hpp
#	include/f1x/openauto/autoapp/Service/AndroidAutoEntity.hpp
#	include/f1x/openauto/autoapp/Service/AudioInputService.hpp
#	include/f1x/openauto/autoapp/Service/AudioService.hpp
#	include/f1x/openauto/autoapp/Service/BluetoothService.hpp
#	include/f1x/openauto/autoapp/Service/InputService.hpp
#	include/f1x/openauto/autoapp/Service/MediaSink/GuidanceAudioService.hpp
#	include/f1x/openauto/autoapp/Service/MediaSink/MediaAudioService.hpp
#	include/f1x/openauto/autoapp/Service/MediaSink/VideoService.hpp
#	include/f1x/openauto/autoapp/Service/Sensor/SensorService.hpp
#	include/f1x/openauto/autoapp/Service/VideoService.hpp
#	include/f1x/openauto/autoapp/Service/WifiService.hpp
#	include/f1x/openauto/btservice/AndroidBluetoothServer.hpp
#	src/autoapp/Service/AndroidAutoEntity.cpp
#	src/autoapp/Service/MediaAudioService.cpp
#	src/autoapp/Service/SensorService.cpp
#	src/autoapp/Service/ServiceFactory.cpp
#	src/autoapp/Service/SpeechAudioService.cpp
#	src/autoapp/Service/SystemAudioService.cpp
#	src/autoapp/Service/WifiService.cpp
#	src/autoapp/autoapp.cpp
#	src/btservice/AndroidBluetoothServer.cpp
2025-01-07 22:08:57 +00:00
Sean Gibson
a5cdf161ad Disable Wifi Projection + Fix assistant hang/missing audio. (#2)
* Bonus: Fix assistant hang/missing audio.

* Add new wireless projection config section.
* Add check box to disable/enable wireless projection. Checking this box causes the service factory to skip the bluetooth and wifi services.
2025-01-06 21:11:17 -05:00
Matthew Hilton
5da1376565
Merge pull request #19 from SonOfGib/sonofgib-newdev
SonOfGib Fixes
2024-12-30 22:40:17 +00:00
Simon Dean
880ec80d31 Merge branch 'JourneyOS-DisableUpdates' into Bluetooth-Reworking 2024-11-29 22:14:03 +00:00
Simon Dean
d97edf539b BugFix finalisation of re-worked btservice for Bluetooth Handling.
Redeclare function scoped variables to be on on class object for persistent handling in memory.
2024-11-29 22:13:44 +00:00
Simon Dean
c5ac7113c8 Remove System Updates during transition and swap name from CrankShaft to Journey: Temporary 2024-11-27 11:29:35 +00:00
Simon Dean
361e1467b7 Move remaining Bluetooth Signals to BtService to prevent overlaps. 2024-11-27 11:27:12 +00:00
Simon Dean
28caa06b09 Remove concept of Local and Remote Bluetooth Devices.
They both essentially do the same thing - to return the hardware address, and show whether the adapter is available.

Remove RemoteBluetoothDevice, merge into LocalBluetoothDevice

Introduce routine to SettingsWindow to bring in list of adapters.
2024-11-27 10:02:01 +00:00
Simon Dean
478526b953 Reformat Code 2024-11-27 09:53:07 +00:00
Simon Dean
7f38e16983 Resolve display issue where if Raspberry Pi thinks both HDMI and LCD are enabled, the display width is appearing as two side by side monitors (double width) rather than just using the physical width of the screen. 2024-11-21 13:06:48 +00:00
Simon Dean
b327bd69b2 Added support for new services provided by AASDK and AAP Protocol version 1.6.
Add extensive logging
Add logo for forked version
Resolve display issue where if Raspberry Pi thinks both HDMI and LCD are enabled, the display width is appearing as two side by side monitors (double width) rather than  just using the physical width of the screen.
2024-11-21 13:06:19 +00:00
Simon Dean
e669277eb4 Rename WifiProjectionStatus.cpp to WifiProjectionService.cpp 2024-11-13 15:10:14 +00:00
Simon Dean
173225970f Remove logging. Bolster WifiProjection 2024-11-13 15:09:20 +00:00
Simon Dean
be8c0ab9cd Compiles and Builds, but problems with Video, WiFi Projection and Bluetooth. 2024-11-13 12:25:09 +00:00
Simon Dean
4e36ff016f Add logo for forked version 2024-11-08 12:56:38 +00:00
Simon Dean
406368d8dd Populate WifiProjectionStatus.cpp, NavigationStatusService.cpp 2024-11-08 12:55:54 +00:00
Simon Dean
68759ee2fa Add extensive logging 2024-11-07 17:18:43 +00:00
Simon Dean
5a2a305c04 All modifications for AAP 1.6 2024-11-04 13:51:11 +00:00
SonOfGib
e3aa777467
WIFI service
* Changes to WIFI service to handle messages from Android Auto. This fixes issues reported with AA > 12.6.
* Modifications to support aasdk proto updates.
* Docker cross compile build for RPI.
* Boost log filtering via `openauto-logs.ini` file
2024-10-29 18:50:11 -04:00
SonOfGib
35005a0e54
Readme notes about building.
* Libgps version update
2024-10-24 22:46:07 -04:00
SonOfGib
cdf1992637
Back to libgps 3.17 2024-10-18 21:50:24 -04:00
SonOfGib
f1976fe76c
Fix broken include. 2024-10-18 21:16:17 -04:00
SonOfGib
9faa119a14
Remove wifi service. 2024-10-17 21:28:09 -04:00
Sean Gibson
cc193045b4
Ignore idea files and Clion build folder. 2023-09-06 16:14:02 -04:00
dice14u
9ea379fa8e Make the opencardev aasdk work with newdev 2023-06-16 00:17:32 -04:00
dice14u
dd2c0a445e using aasdk nextdev 2023-06-15 13:10:57 -04:00
Matthew Hilton
0f317bdc3f
Merge pull request #15 from DanielHerr/media-key-handling
Enhanced Media Key Handling
2022-12-15 20:22:54 +00:00
Daniel Herr
8613351fc3
Enhanced Media Key Handling 2022-07-30 22:13:21 -04:00
Matthew Hilton
4e9574ce1f
Create LICENSE 2021-07-10 11:38:42 +01:00
Matthew Hilton
0e84c362b1
Merge pull request #11 from egisz/keyboard-ui
Keyboard support in openauto
2020-11-02 22:21:15 +00:00
egisz
d7fb716975 more fixes to keyboard handling 2020-10-31 07:39:16 +00:00
egisz
e90d99a2ea fix building warnings 2020-10-31 06:12:46 +00:00
egisz
34f8f0759a add 1 and 2 key to settings menu as TAB 2020-10-30 18:01:39 +00:00
egisz
2592d3a6f8 keyboard support in main window, esc key in settings 2020-10-30 17:54:47 +00:00
Matthew Hilton
bc04598aee
Merge pull request #10 from matt2005/csng-alpha55
Csng alpha55
2020-10-13 21:02:52 +01:00
matt
d5e16bc4aa
Added wifi fixes @presslab-us
added Bluetooth fixes @presslab-us
Added local GPS device support @presslab-us
2020-10-11 00:27:14 +01:00
matt
fd3a00a8e3
[QT]
QT 5.15 fixes for alignment errors
2020-10-10 23:28:58 +01:00
matt
2b367721a7
fix compiler errors 2020-10-10 23:28:30 +01:00
matt
c18f0edeb5
[libusb]
Resolve compiler errors
2020-10-10 23:27:37 +01:00
hawkeyexp
fd5ce7ac07 Bringup pre5 2019-06-10 11:38:47 +02:00
hawkeyexp
bfabfd1822 AA Exit fix / Button visibility 2019-03-02 13:01:28 +01:00
hawkeyexp
1020069646 Experimental: Allow higher ping/pong diff 2019-01-29 19:38:11 +01:00
hawkeyexp
5b9ebd7bd4 latest dev 2019-01-28 13:16:17 +01:00
hawkeyexp
03c1518baf update to latest 2019-01-26 20:03:07 +01:00
hawkeyexp
4ebdcd935f update latest dev 2019-01-20 11:00:44 +01:00
hawkeyexp
c63494334b Add new triggers 2019-01-17 15:44:33 +01:00
hawkeyexp
b6c705544b latest dev 2019-01-16 20:45:41 +01:00
hawkeyexp
e653923eb6 Fixes / Apply alpha to old style menu 2019-01-06 11:09:32 +01:00
hawkeyexp
0307adafe8 Latest changes 2019-01-05 00:58:30 +01:00
hawkeyexp
2ed095eed5 Add settings for brightness control / Auto Play / Add CSSTORAGE info / Switchable cursor 2018-12-21 17:38:37 +01:00
hawkeyexp
db48323a19 Add try catch to prevent from exceptions / Add country code to settings / Fix exit in wifi mode 2018-12-17 16:03:48 +01:00
hawkeyexp
f16c3fe54c Cleanup code / Add auto close safety 2018-12-13 17:13:02 +01:00
hawkeyexp
e4ab3e0a29 Make wallpaper eq external / Add disable rtc day/night 2018-12-10 15:30:44 +01:00
hawkeyexp
43bab5a782 Latest fixes 2018-12-07 20:34:49 +01:00
hawkeyexp
60564c0e98 Make tsl2561 configurable / fixes day/night manvirrr 2018-12-07 15:26:47 +01:00
hawkeyexp
1ff179eca4 Remove alpha slider mainwindow / add brightness day/night control to settings / update system notify 2018-12-06 21:19:57 +01:00
hawkeyexp
a7fb685a65 Fix visible conditions 2018-12-06 14:56:05 +01:00
hawkeyexp
fe62796cc9 Fixes / Merge changes from manvirrr 2018-12-06 14:18:22 +01:00
hawkeyexp
fabcc84896 Cleanup assets / Update png format 2018-12-06 00:47:36 +01:00
hawkeyexp
95a329f33d Fix day/night sensor polling 2018-12-05 19:42:39 +01:00
hawkeyexp
cd36c39037 Try day/night code from manvirrr 2018-12-05 15:38:26 +01:00
hawkeyexp
14662664ed latest dev 2018-12-05 13:09:36 +01:00
hawkeyexp
802393d427 Make lux values switchable via setings 2018-11-30 13:32:24 +01:00
hawkeyexp
c30bdeb20b Add day/night by gpio / gui fixes / lux values to gui / video stop by go back 2018-11-30 12:34:23 +01:00
hawkeyexp
3621a20cda Fix label 2018-11-24 15:30:18 +01:00
hawkeyexp
cc2e3d67ba More dynamic gui / player autoplay / add lightsensor to hw setup 2018-11-24 15:24:45 +01:00
hawkeyexp
a06504a2a5 Add player bg / config values for auto play etc / code cnsolidate / clanups 2018-11-21 15:25:47 +01:00
hawkeyexp
6f4defef40 Switch back to system / fix usb detect after settings change 2018-11-15 15:00:47 +01:00
hawkeyexp
5f0d26e64a Remove obsolete usb dialog 2018-11-14 13:50:42 +01:00
hawkeyexp
a87a3eef82 latest 2018-11-14 13:42:38 +01:00
hawkeyexp
e5c031774e Rework triggers / usb /network 2018-11-03 12:17:59 +01:00
hawkeyexp
4e2ebcdd4a Fix startup bug in usb mode 2018-10-23 18:52:04 +02:00
hawkeyexp
03ad005f80 Gui bg rework / remove build id 2018-10-19 22:36:55 +02:00
hawkeyexp
360ffeb6f9 adjust settings menu 2018-10-19 04:04:59 +02:00
hawkeyexp
28180b6efa Add sdoc / Add display wake lock while playing media 2018-10-17 00:43:47 +02:00
hawkeyexp
d1a30439c6 Text correction 2018-10-16 15:25:19 +02:00
hawkeyexp
f3fe0e7e77 Add skip usb detect / start rework system to qprocess 2018-10-12 04:00:40 +02:00
hawkeyexp
ea285c84b0 Optimize settings layout/resizes 2018-10-08 14:50:23 +02:00
hawkeyexp
e3c055984a Add audiotest to gui 2018-10-05 18:53:02 +02:00
hawkeyexp
7d044eee09 Force unmount 2018-10-05 17:19:55 +02:00
hawkeyexp
d81b2c4a69 Add aa wifi entity detect 2018-09-30 18:20:24 +02:00
hawkeyexp
902d450e21 Add blackscreen option for custom commands 2018-09-30 00:52:24 +02:00
hawkeyexp
4d90184c22 Add display blank option 2018-09-29 01:05:37 +02:00
hawkeyexp
0c9600e6e3 Extend settings text / add mp4a 2018-09-28 20:31:00 +02:00
Marc Hillesheim
eeeaef1f4f Add wma for testing 2018-09-27 21:39:49 +02:00
hawkeyexp
bd03a47901 Change mount point 2018-09-27 18:27:53 +02:00
hawkeyexp
2f387c6096 Rework for usb drive handling 2018-09-27 15:56:19 +02:00
hawkeyexp
5234599c90 Implement taglib and use in filescan / player | Extend supported media 2018-09-24 12:14:27 +02:00
hawkeyexp
90ccf5b55a Extend supported filetypes / resize controls 2018-09-23 15:19:45 +02:00
hawkeyexp
be2fb2ccb3 Revert mark current track / Mark last played track on stop 2018-09-22 14:35:32 +02:00
hawkeyexp
d2feacddad Mark current playing track selected 2018-09-22 14:05:06 +02:00
hawkeyexp
5ff5327f43 Rework player usage 2018-09-22 13:29:25 +02:00
hawkeyexp
c7772617a3 Add album next/prev and optimize gui 2018-09-21 13:20:22 +02:00
hawkeyexp
f2e27a8d64 Add mediapaths to settings / gui reworks 2018-09-21 00:15:16 +02:00
hawkeyexp
e26022190e Gui optimize and folder handling player 2018-09-20 17:56:03 +02:00
hawkeyexp
b84aed1f55 Add folder select and scan 2018-09-19 19:35:34 +02:00
hawkeyexp
9a4f1e7080 initial mp3 bringup 2018-09-18 22:16:28 +02:00
hawkeyexp
1b743ef129 Add ntp sync button / optimize timer remove sleep 2018-09-17 13:29:13 +02:00
hawkeyexp
3a7e7593ff latest dev 2018-09-13 14:57:07 +02:00
hawkeyexp
0703904ca1 latest dev 2018-09-10 09:39:49 +02:00
hawkeyexp
72397d880e Reworked settings menu / switchable button alpha and gui toggle 2018-09-07 03:15:36 +02:00
hawkeyexp
873b1e2dde add lost wifi button 2018-09-05 03:03:16 +02:00
hawkeyexp
3a74f7fa1d Bugfixes 2018-09-04 21:41:35 +02:00
hawkeyexp
0bba0e5612 Rework with new gui 2018-08-31 14:08:38 +02:00
hawkeyexp
baae26932c Add bluetooth pair button 2018-08-17 16:13:44 +02:00
hawkeyexp
ed37925b51 Resize label 2018-08-15 23:13:11 +02:00
hawkeyexp
63d784dcbe Add bluetooth stuff 2018-08-15 20:04:53 +02:00
hawkeyexp
4a7fbae6f6 Revert wifi setup which caused breaks / Include cam setup 2018-08-11 14:50:07 +02:00
hawkeyexp
46c2cb075c Change delimater for bug prevention 2018-08-10 22:53:07 +02:00
hawkeyexp
bd36d87bdb Remove testline 2018-08-09 18:08:18 +02:00
hawkeyexp
dcc0c01586 Some rework for custom brightness & slider 2018-08-08 14:52:30 +02:00
hawkeyexp
b7ce5de716 Use brightness values from crankshaft_env.sh / Optimize Handling custom brightness 2018-08-08 02:13:34 +02:00
hawkeyexp
c2990c2421 Fix audioinjector preselection 2018-08-07 22:13:39 +02:00
hawkeyexp
96eeba4ad9 Enable optional hardware setup / Hotfix ignition shutdown 2018-08-07 02:42:29 +02:00
hawkeyexp
10516c7017 Show black bg if kodi is running 2018-08-06 16:10:54 +02:00
hawkeyexp
e936f7439d Show custom brightness command in gui 2018-08-06 13:12:31 +02:00
hawkeyexp
bf69ef7e8a Complete wifi setup / Add Hotspot setup 2018-08-06 01:18:25 +02:00
hawkeyexp
ac5b130e3b Rearange gui / Add wifi setup 2018-08-05 23:24:22 +02:00
hawkeyexp
84f7fafe3a Include external shutdown trigger 2018-08-03 01:42:18 +02:00
hawkeyexp
8fbdd32abb Add ignition_pin/delay to gui 2018-08-02 13:36:46 +02:00
hawkeyexp
2ace4e9198 Resize and pos debug button 2018-07-30 14:14:04 +02:00
hawkeyexp
27799aef76 Fix missing remove: Some reworks and handling changes 2018-07-29 18:17:21 +02:00
hawkeyexp
d6b7bee928 Some reworks and handling changes 2018-07-29 18:15:14 +02:00
hawkeyexp
b8bbddabe0 Fix stupid bug with debug button 2018-07-28 08:31:14 +02:00
hawkeyexp
ba068c0aab Some cosmetics / Lock button during save 2018-07-27 13:40:14 +02:00
hawkeyexp
a64f3341f2 Init debug mode via gui 2018-07-25 20:39:35 +02:00
hawkeyexp
a1472a2546 Optimize custom brightness command 2018-07-25 13:54:20 +02:00
hawkeyexp
26b371385a Init custom brightness command 2018-07-24 22:11:02 +02:00
hawkeyexp
e1fcfdf85e Last fix pulseaudio volume restore 2018-07-23 21:24:19 +02:00
hawkeyexp
2b17b51bb5 Allow disable timers / include iqaudio 2018-07-23 09:37:06 +02:00
hawkeyexp
44acc8ac0a Fixes 2018-07-21 20:35:05 +02:00
hawkeyexp
43d6bee314 Include hardware setup 2018-07-21 17:46:27 +02:00
hawkeyexp
2feff5396e Rework audio setup pulseaudio / system interaction 2018-07-18 16:44:40 +02:00
hawkeyexp
093e79cd7a Release sound card handling 2018-07-16 07:58:21 +02:00
hawkeyexp
c82ea93668 Init sound card handling 2018-07-15 08:48:52 +02:00
hawkeyexp
42ee3289d1 Adjust settings 2018-07-13 21:27:09 +02:00
hawkeyexp
ef00744823 [settings] Extend system config 2018-07-12 13:43:35 +02:00
hawkeyexp
7d889bd58a [gui] Adjust controls layout 2018-07-09 10:51:59 +02:00
hawkeyexp
3514384742 Latest changes 2018-07-09 00:07:37 +02:00
hawkeyexp
9816a04557 Init CS-NG Tab 2018-07-05 08:54:39 +02:00
hawkeyexp
7be4d7db35 [gui] Reduce sleep 2018-07-01 19:59:10 +02:00
hawkeyexp
a2fb124df6 [gui][load] Fix high cpu load / optimizing 2018-07-01 18:29:53 +02:00
hawkeyexp
01fbd163f0 [gui] Fix sliderbug 2018-07-01 04:41:21 +02:00
hawkeyexp
7875c511b5 [gui] Add font usage 2018-06-28 14:58:35 +02:00
hawkeyexp
ff89fe6f11 [gui] Add phone connected string 2018-06-26 20:45:46 +02:00
hawkeyexp
9d60eba90e Add version strings to gui 2018-06-25 20:34:17 +02:00
hawkeyexp
dbfb482c9f [gui][script] rework reboot 2018-06-25 20:34:08 +02:00
hawkeyexp
c72958438f [gui][script] Rearcam / reworks / kodi button / shutdown/reboot buttons 2018-06-22 00:08:36 +02:00
hawkeyexp
3a59525055 [gui][script] Dashcam / Reworks 2018-06-16 02:04:05 +02:00
hawkeyexp
77cdf52cd2 [gui] Rework wallpapers / finish auto day/night switch 2018-06-13 21:09:55 +02:00
hawkeyexp
c8dd7f48ff [gui] Close slider on switching day/night 2018-06-05 16:55:09 +02:00
hawkeyexp
a1f010fa5b [gui] Add dev mode background 2018-06-05 15:53:29 +02:00
hawkeyexp
3f241ee283 [gui] Add clock 2018-05-26 16:31:31 +02:00
hawkeyexp
aa5851442c [gui] Rework brightness slider 2018-05-25 21:53:50 +02:00
hawkeyexp
2deaedbe07 [code] change call of script day/night 2018-05-24 03:18:53 +02:00
hawkeyexp
bdf2befaa2 [code] Announce day / night mode to android auto 2018-05-23 19:53:32 +02:00
hawkeyexp
5440d0e3b0 [gui][script] Switchable day/night mode 2018-05-23 18:11:31 +02:00
Marc Hillesheim
ed96372595 [gui] Make button view forceable 2018-05-21 17:04:50 +02:00
Marc Hillesheim
db2d0e0bd6 [gui][script] Add camera button 2018-05-21 17:03:06 +02:00
Marc Hillesheim
f9ae6f02c9 Revert "[code-cs] add crankshaft plug/unplug scripts"
This reverts commit df8f8f6cb47ccd18c0b9d7e5609e3f762a590ff3.
2018-05-21 16:41:52 +02:00
Marc Hillesheim
77f6f8c30d [gui] Update button images / rework layout 2018-05-21 16:35:44 +02:00
Huan Truong
5d154138bb Merge remote-tracking branch 'f1xpl/master' into HEAD 2018-05-12 05:20:42 -04:00
michal.szwaj
cfb6ebfee1 Create service package 2018-05-04 04:41:28 -04:00
michal.szwaj
84de27cc02 Cleanup entity creation 2018-05-04 04:41:28 -04:00
michal.szwaj
cc062f57e1 Inject list of services instead of service factory 2018-05-04 04:41:28 -04:00
michal.szwaj
bd0264501a Inject messenger to the entity 2018-05-04 04:41:28 -04:00
michal.szwaj
57b10e086a Split ping method to send and schedule 2018-05-04 04:41:28 -04:00
michal.szwaj
a8d8a83e12 Standarize behavior of pinger cancel 2018-05-04 04:41:28 -04:00
michal.szwaj
b50e1d658e Fix invalid inheritance of enable_shared_from_this 2018-05-04 04:41:28 -04:00
michal.szwaj
d93baa88cb Draft of ping implementation 2018-05-04 04:41:28 -04:00
michal.szwaj
05df5328cd Set socket options to detect broken connection 2018-05-04 04:41:28 -04:00
michal.szwaj
2f0bf11e4b Adjust audio device buffer size 2018-05-04 04:41:28 -04:00
Michal Szwaj
f8de16c714 Update Readme.md 2018-05-04 04:41:28 -04:00
michal.szwaj
1fd7b6f529 Use specialized erase_begin to remove read data from sequential buffer 2018-05-04 04:41:28 -04:00
Huan Truong
df8f8f6cb4 [code-cs] add crankshaft plug/unplug scripts 2018-05-04 04:41:28 -04:00
Huan Truong
88f61a3c4d [code] fix hide cursor procedure 2018-05-04 04:41:28 -04:00
Huan Truong
46dcd609bd [tweak] make QT audio default backend instead of RtAudio 2018-05-04 04:41:28 -04:00
Huan Truong
eed0c9b35b [code] more debugging for touchscreen detection 2018-05-04 04:41:28 -04:00
Huan Truong
099f14d3de [config] added touchscreen auto-detection 2018-03-31 01:49:00 -04:00
Huan Truong
16a09529e8 [GUI] New assets and functionalities to Crankshaft 2018-03-31 00:12:32 -04:00
259 changed files with 32566 additions and 8838 deletions

22
.gitignore vendored
View File

@ -1,23 +1,9 @@
# Add any directories, files, or patterns you don't want to be tracked by version control
.vscode/
lib/
bin/
.idea/
build/
.vscode/
openauto.ini
CMakeLists.txt.user
cmake-build-*/
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
*_autogen/
*.pb.cc
*.pb.h
/cmake-build-*/
.idea/

View File

@ -1,128 +1,178 @@
cmake_minimum_required(VERSION 3.5.1)
set (openauto_VERSION_MAJOR 2)
set (openauto_VERSION_MINOR 1)
set (openauto_VERSION_PATCH 0)
project(openauto CXX)
project(openauto
VERSION ${openauto_VERSION_MAJOR}.${openauto_VERSION_MINOR}.${openauto_VERSION_PATCH}
LANGUAGES CXX)
message(STATUS "OpenAuto")
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
endif()
option(NOPI "Build for Non Raspberry Pi" OFF)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(base_directory ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
# Set Compile Versions
set(OPENAUTO_BUILD_DATE 20241124) # Binary Release Build Date
set(OPENAUTO_BUILD_MAJOR_RELEASE 4) # Binary Release Build Major Number
set(OPENAUTO_BUILD_MINOR_RELEASE 1) # Binary Release Build Minor Number
set(OPENAUTO_BUILD_INCREMENTAL 0) # Binary Build Version - Increment for Each Build
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake_modules/")
SET(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -Wall -pedantic")
# Configure CMAKE
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -Wall -pedantic -fPIC")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-g -O3")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi")
# Default to Release mode unless overridden with -DCMAKE_BUILD_TYPE=Debug on cmake command
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Forcing Release build type")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,/usr/local/qt5/lib")
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
# Paths
set(resources_directory ${CMAKE_CURRENT_SOURCE_DIR}/assets)
set(sources_directory ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(include_directory ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules/")
# Configure Boost
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
add_definitions(-DBOOST_ALL_DYN_LINK)
find_package(Boost REQUIRED COMPONENTS system log OPTIONAL_COMPONENTS unit_test_framework)
find_package(libusb-1.0 REQUIRED)
find_package(Qt5 COMPONENTS Multimedia MultimediaWidgets Bluetooth Qml Quick QuickWidgets WebSockets REQUIRED)
find_package(Protobuf REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(rtaudio REQUIRED)
find_package(aasdk REQUIRED)
find_package(h264 REQUIRED)
find_package(Threads)
include(${base_directory}/cmake_modules/gitversion.cmake)
if(RPI_BUILD)
find_package(libomx)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
message(STATUS "Disabling Boost DEBUG logs")
add_definitions(-DNDEBUG)
endif()
if(GST_BUILD)
find_package(GObject)
find_package(Qt5GStreamer)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GST REQUIRED
gstreamer-1.0>=1.4
gstreamer-sdp-1.0>=1.4
gstreamer-video-1.0>=1.4
gstreamer-app-1.0>=1.4)
add_definitions(-DUSE_GST)
if(RPI_BUILD)
add_definitions(-DRPI)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/functions.cmake)
findRpiRevision( RPI_REVISION )
math(EXPR RPI_MODEL "(0x${RPI_REVISION}>>4)&0xFF")
message( "-- Raspberry Pi Model: ${RPI_MODEL}" )
if(RPI_MODEL EQUAL 17)
message("Raspberry Pi 4 Found")
add_definitions(-DPI4)
endif(RPI_MODEL EQUAL 17)
endif(RPI_BUILD)
message(STATUS "${GST_LIBRARIES}")
endif(GST_BUILD)
if (WIN32)
set(WINSOCK2_LIBRARIES "ws2_32")
endif (WIN32)
add_subdirectory(btservice_proto)
set(BTSERVICE_PROTO_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${BTSERVICE_PROTO_INCLUDE_DIRS})
if (DEFINED NOPI)
message(STATUS "Configuring for Non-Raspberry Pi")
else()
message(STATUS "Configuring for RaspberryPi")
add_definitions(-DUSE_OMX -DOMX_SKIP64BIT -DRASPBERRYPI3)
set(BCM_HOST_LIBRARIES "/opt/vc/lib/libbcm_host.so")
set(BCM_HOST_INCLUDE_DIRS "/opt/vc/include")
set(ILCLIENT_INCLUDE_DIRS "/opt/vc/src/hello_pi/libs/ilclient")
set(ILCLIENT_LIBRARIES "/opt/vc/src/hello_pi/libs/ilclient/libilclient.a;/opt/vc/lib/libvcos.so;/opt/vc/lib/libvcilcs.a;/opt/vc/lib/libvchiq_arm.so")
endif ()
add_subdirectory(openauto)
add_subdirectory(autoapp)
add_dependencies(autoapp btservice_proto)
# Building on a Mac requires Abseil
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") # macOS
message(STATUS "MacOS System Detected")
add_definitions(-DMAC_OS)
find_package(protobuf REQUIRED CONFIG)
find_package(absl REQUIRED)
set(CMAKE_PREFIX_PATH "/usr/local/opt/qt@5" ${CMAKE_PREFIX_PATH})
list(APPEND CMAKE_PREFIX_PATH /usr/local/opt/util-linux)
list(APPEND CMAKE_PREFIX_PATH /usr/local/opt/taglib)
include(FindProtobuf)
else ()
find_package(Protobuf REQUIRED)
endif ()
set (openauto_VERSION_PATCH ${_build_version})
set (openauto_VERSION_STRING ${openauto_VERSION_MAJOR}.${openauto_VERSION_MINOR}.${openauto_VERSION_PATCH})
set_target_properties(openauto PROPERTIES VERSION ${openauto_VERSION_STRING}
SOVERSION ${openauto_VERSION_MAJOR})
message(INFO " Project Version: ${openauto_VERSION_STRING}")
find_package(aap_protobuf REQUIRED)
find_package(aasdk REQUIRED)
find_package(Boost REQUIRED COMPONENTS system log_setup log OPTIONAL_COMPONENTS unit_test_framework)
find_package(libusb-1.0 REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS DBus Multimedia MultimediaWidgets Bluetooth Network WebSockets)
find_package(OpenSSL REQUIRED)
find_package(rtaudio REQUIRED)
find_package(taglib REQUIRED)
find_package(blkid REQUIRED)
find_package(gps REQUIRED)
install(DIRECTORY lib DESTINATION lib COMPONENT libraries)
install(DIRECTORY include DESTINATION include COMPONENT headers)
install(DIRECTORY bin DESTINATION bin COMPONENT applications)
include_directories(${CMAKE_CURRENT_BINARY_DIR}
${Qt5Multimedia_INCLUDE_DIRS}
${Qt5MultimediaWidgets_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Bluetooth_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR}
${RTAUDIO_INCLUDE_DIRS}
${TAGLIB_INCLUDE_DIRS}
${BLKID_INCLUDE_DIRS}
${BCM_HOST_INCLUDE_DIRS}
${ILCLIENT_INCLUDE_DIRS}
${include_directory}
${PROTOBUF_INCLUDE_DIR}
${AAP_PROTOBUF_INCLUDE_DIR}
${AASDK_INCLUDE_DIR})
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "OpenDsh") #required
SET(CPACK_PACKAGE_VENDOR "OpenDsh")
set(CPACK_PACKAGE_VERSION ${openauto_VERSION_STRING})
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_COMPONENTS_ALL applications libraries headers Unspecified)
set(CPACK_COMPONENT_APPLICATIONS_DISPLAY_NAME "Applications")
set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ Headers")
set(CPACK_COMPONENT_APPLICATIONS_DESCRIPTION
"Applications provided by OpenAuto")
set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION
"Static libraries used to build programs with OpenAuto")
set(CPACK_COMPONENT_HEADERS_DESCRIPTION
"C/C++ header files for use with OpenAuto")
set(CPACK_COMPONENT_LIBRARIES_GROUP "Development")
set(CPACK_COMPONENT_HEADERS_GROUP "Development")
set(CPACK_COMPONENT_GROUP_DEVELOPMENT_EXPANDED ON)
set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
"All of the tools you'll ever need to develop software")
set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
set(CPACK_COMPONENT_APPLICATIONS_DEPENDS libraries)
set(CPACK_ALL_INSTALL_TYPES Full Developer)
set(CPACK_INSTALL_TYPE_FULL_DISPLAY_NAME "Everything")
set(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Developer Full)
set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
set(CPACK_COMPONENT_APPLICATIONS_INSTALL_TYPES Full)
INCLUDE(CPack)
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
set(common_include_directory ${include_directory}/f1x/openauto/Common)
set(autoapp_sources_directory ${sources_directory}/autoapp)
set(autoapp_include_directory ${include_directory}/f1x/openauto/autoapp)
file(GLOB_RECURSE autoapp_source_files ${autoapp_sources_directory}/*.ui ${autoapp_sources_directory}/*.cpp ${autoapp_include_directory}/*.hpp ${autoapp_include_directory}/*.h ${common_include_directory}/*.hpp ${resources_directory}/*.qrc)
add_executable(autoapp ${autoapp_source_files})
target_include_directories(autoapp PUBLIC ${AAP_PROTOBUF_INCLUDE_DIR} ${AASDK_INCLUDE_DIR})
target_link_libraries(autoapp PUBLIC
libusb
Qt5::WebSockets
${Boost_LIBRARIES}
${Qt5DBus_LIBRARIES}
${Qt5Multimedia_LIBRARIES}
${Qt5MultimediaWidgets_LIBRARIES}
${Qt5Bluetooth_LIBRARIES}
${Qt5Network_LIBRARIES}
${BCM_HOST_LIBRARIES}
${ILCLIENT_LIBRARIES}
${WINSOCK2_LIBRARIES}
${RTAUDIO_LIBRARIES}
${TAGLIB_LIBRARIES}
${BLKID_LIBRARIES}
${GPS_LIBRARIES}
${PROTOBUF_LIBRARIES}
${AAP_PROTOBUF_LIB_DIR}
${AASDK_LIB_DIR})
set(PROGRAM_VERSION_STRING "${OPENAUTO_BUILD_MAJOR_RELEASE}.${OPENAUTO_BUILD_MINOR_RELEASE}.${OPENAUTO_BUILD_INCREMENTAL}+${OPENAUTO_BUILD_DATE}")
message(STATUS "Project Version: ${PROGRAM_VERSION_STRING}")
set(btservice_sources_directory ${sources_directory}/btservice)
set(btservice_include_directory ${include_directory}/f1x/openauto/btservice)
file(GLOB_RECURSE btservice_source_files ${btservice_sources_directory}/*.cpp ${btservice_include_directory}/*.hpp ${autoapp_sources_directory}/Configuration/*.cpp ${autoapp_includes_directory}/Configuration/*.hpp ${common_include_directory}/*.hpp)
add_executable(btservice ${btservice_source_files}
src/btservice/BluetoothHandler.cpp)
target_link_libraries(btservice PUBLIC
${Boost_LIBRARIES}
${Qt5Bluetooth_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5MultimediaWidgets_LIBRARIES}
${PROTOBUF_LIBRARIES}
${AAP_PROTOBUF_LIB_DIR})
set_target_properties(autoapp
PROPERTIES VERSION ${PROGRAM_VERSION_STRING} SOVERSION ${OPENAUTO_BUILD_INCREMENTAL})
# Install rules
#install(TARGETS autoapp btservice
# EXPORT aasdkTargets
# RUNTIME DESTINATION bin
#)

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM scratch
ADD rootfs.tar.xz /
CMD ["bash"]

674
LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -1,6 +1,13 @@
# OpenAuto
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)
### Support project
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=R4HXE5ESDR4U4)
For support of other platforms please contact me at f1xstudiopl@gmail.com
### Community
[![Join the chat at https://gitter.im/publiclab/publiclab](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/openauto_androidauto/Lobby)
@ -9,28 +16,6 @@ OpenAuto is an AndroidAuto(tm) headunit emulator based on aasdk library and Qt l
[See demo video](https://www.youtube.com/watch?v=k9tKRqIkQs8)
### Build Guide
#### Local build instructions for Raspberry Pi
Having <a href="https://github.com/openDsh/aasdk">aasdk</a> built and install first is a prequisite for this task. Please complete the necessary aasdk steps before proceeding here.
```sudo apt-get update
sudo apt-get -y install cmake build-essential git
sudo apt-get install libboost-all-dev libusb-1.0.0-dev libssl-dev cmake libprotobuf-dev protobuf-c-compiler protobuf-compiler libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediawidgets5 qtmultimedia5-dev libqt5bluetooth5 libqt5bluetooth5-bin qtconnectivity5-dev pulseaudio librtaudio-dev
git clone https://github.com/OpenDsh/openauto
mkdir openauto_build; cd openauto_build
cmake -DCMAKE_BUILD_TYPE=Release -DRPI3_BUILD=TRUE -DAASDK_INCLUDE_DIRS="../aasdk/include" -DAASDK_LIBRARIES="../aasdk/lib/libaasdk.so" -DAASDK_PROTO_INCLUDE_DIRS="../aasdk" -DAASDK_PROTO_LIBRARIES="../aasdk/lib/libaasdk_proto.so" ../openauto
make -j2
sudo make install
```
The executable binary can then be found at ~/openauto/bin/autoapp
### Supported functionalities
- 480p, 720p and 1080p with 30 or 60 FPS
- RaspberryPI 3 hardware acceleration support to decode video stream (up to 1080p@60!)
@ -65,5 +50,24 @@ Copyrights (c) 2018 f1x.studio (Michal Szwaj)
- Broadcom ilclient from RaspberryPI 3 firmware
- OpenMAX IL API
### Building
#### Amd64
Install the packages specified in the [prebuilts](https://github.com/opencardev/prebuilts) repository. Qt5 is required, versions packaged in modern Ubuntu and Debian
seem to work fine.
You will also likely need to install the udev rules from `prebuilts`
You need to point some CMAKE variables at your `aasdk` files.
```text
-DAASDK_INCLUDE_DIRS=<path_to_aasdk_repo>/include
-DAASDK_LIBRARIES=<path_to_aasdk_repo>/lib/libaasdk.so
DAASDK_PROTO_INCLUDE_DIRS=<path_to_aasdk_build>
-DAASDK_PROTO_LIBRARIES=<path_to_aasdk_repo>/lib/libaasdk_proto.so
```
#### Raspberry Pi
Just run the scripts in the `prebuilts` repository for `aasdk` and `openauto`. It is possible to cross compile if your raspberry pi is too slow to compile the code itself.
However, its easiest to just develop on a more capable `amd64` device.
### Remarks
**This software is not certified by Google Inc. It is created for R&D purposes and may not work as expected by the original authors. Do not use while driving. You use this software at your own risk.**
**This software is not certified by Google Inc. It is created for R&D purposes and may not work as expected by the original authors. Do not use while driving. You use this software at your own risk.**

15
RELEASE.txt Normal file
View File

@ -0,0 +1,15 @@
Release Notes
20241124 - 4.1.0 - Bluetooth Updates
* Rename BluetootAdapterType to BluetoothAdapterType, and change from NONE, LOCAL, REMOTE to NONE, LOCAL, EXTERNAL to better match available settings
* getLocalAddress() on Dummy, Local and Remote bluetooth changed to getAdapterAddress()
* Removed RemoteBluetoothDevice replacing all references with LocalBluetoothDevice. RemoteBluetoothDevice is a wrapper essentially with all pairing work handled by btservice.
* Pairing overlaps between btservice and LocalBluetoothDevice - removed duplicated elements from LocalBluetoothDevice to rely on btservice.
* Swap Bluetooth dropdown in Settings from none, builtin or external, to showing a list of detected Bluetooth Adapters. Write hardware address to config file.
20241121 - 4.0.0 - AAP 1.6 Support
* Added support for new services provided by AASDK and AAP Protocol version 1.6.
* Add extensive logging
* Add logo for forked version
* Resolve display issue where if Raspberry Pi thinks both HDMI and LCD are enabled, the display width is appearing as two side by side monitors (double width) rather than just using the physical width of the screen.

BIN
assets/Roboto-Regular.ttf Normal file

Binary file not shown.

BIN
assets/aausb-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
assets/aawifi-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
assets/album-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 896 B

After

Width:  |  Height:  |  Size: 896 B

View File

Before

Width:  |  Height:  |  Size: 935 B

After

Width:  |  Height:  |  Size: 935 B

BIN
assets/back-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

BIN
assets/black.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

View File

Before

Width:  |  Height:  |  Size: 931 B

After

Width:  |  Height:  |  Size: 931 B

BIN
assets/brightness-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

BIN
assets/bug-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

BIN
assets/camera-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

BIN
assets/coverlogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
assets/cursor-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/day-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

BIN
assets/eye-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

BIN
assets/home-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

BIN
assets/ico_info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

BIN
assets/ico_warning.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

BIN
assets/journey.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

BIN
assets/list-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 B

BIN
assets/lock-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

BIN
assets/mp3-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

BIN
assets/next-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

BIN
assets/nextbig-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
assets/night-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

BIN
assets/pause-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

BIN
assets/play-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

BIN
assets/player-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

BIN
assets/power-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

BIN
assets/prev-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

BIN
assets/prevbig-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 816 B

After

Width:  |  Height:  |  Size: 816 B

BIN
assets/rearcam-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

BIN
assets/reboot-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

BIN
assets/record-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

BIN
assets/recordactive-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

48
assets/resources.qrc Normal file
View File

@ -0,0 +1,48 @@
<RCC>
<qresource prefix="/">
<file>ico_warning.png</file>
<file>ico_info.png</file>
<file>radio.png</file>
<file>song.png</file>
<file>bluetooth.png</file>
<file>artist.png</file>
<file>album.png</file>
<file>aausb-hot.png</file>
<file>aawifi-hot.png</file>
<file>cursor-hot.png</file>
<file>power-hot.png</file>
<file>settings-hot.png</file>
<file>sleep-hot.png</file>
<file>wifi-hot.png</file>
<file>brightness-hot.png</file>
<file>camera-hot.png</file>
<file>day-hot.png</file>
<file>night-hot.png</file>
<file>record-hot.png</file>
<file>stop-hot.png</file>
<file>save-hot.png</file>
<file>reboot-hot.png</file>
<file>back-hot.png</file>
<file>rearcam-hot.png</file>
<file>recordactive-hot.png</file>
<file>lock-hot.png</file>
<file>volume-hot.png</file>
<file>bug-hot.png</file>
<file>eye-hot.png</file>
<file>skin-hot.png</file>
<file>mp3-hot.png</file>
<file>play-hot.png</file>
<file>prev-hot.png</file>
<file>next-hot.png</file>
<file>pause-hot.png</file>
<file>prevbig-hot.png</file>
<file>nextbig-hot.png</file>
<file>list-hot.png</file>
<file>home-hot.png</file>
<file>player-hot.png</file>
<file>coverlogo.png</file>
<file>black.png</file>
<file>album-hot.png</file>
<file>Roboto-Regular.ttf</file>
</qresource>
</RCC>

BIN
assets/save-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

BIN
assets/settings-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

BIN
assets/skin-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

BIN
assets/sleep-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

View File

Before

Width:  |  Height:  |  Size: 821 B

After

Width:  |  Height:  |  Size: 821 B

BIN
assets/stop-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

BIN
assets/volume-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

BIN
assets/wifi-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

View File

@ -1,33 +0,0 @@
add_executable(autoapp
autoapp.cpp
UI/connectdialog.ui
UI/ConnectDialog.cpp
UI/mainwindow.ui
UI/MainWindow.cpp
UI/settingswindow.ui
UI/SettingsWindow.cpp
assets/resources.qrc
${CMAKE_SOURCE_DIR}/include/autoapp/UI/ConnectDialog.hpp
${CMAKE_SOURCE_DIR}/include/autoapp/UI/MainWindow.hpp
${CMAKE_SOURCE_DIR}/include/autoapp/UI/SettingsWindow.hpp
)
target_include_directories(autoapp PRIVATE
${CMAKE_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(autoapp
Qt5::WebSockets
openauto
)
if(RPI_BUILD AND NOT GST_BUILD)
target_link_libraries(autoapp omx)
endif()
set_target_properties(autoapp
PROPERTIES INSTALL_RPATH_USE_LINK_PATH 1)
install(TARGETS autoapp
RUNTIME DESTINATION bin)

View File

@ -1,128 +0,0 @@
#include <QMessageBox>
#include "autoapp/UI/ConnectDialog.hpp"
#include "ui_connectdialog.h"
namespace autoapp
{
namespace ui
{
ConnectDialog::ConnectDialog(boost::asio::io_service &ioService, aasdk::tcp::ITCPWrapper &tcpWrapper, openauto::configuration::IRecentAddressesList &recentAddressesList, QWidget *parent)
: QDialog(parent), ioService_(ioService), tcpWrapper_(tcpWrapper), recentAddressesList_(recentAddressesList), ui_(new Ui::ConnectDialog)
{
qRegisterMetaType<aasdk::tcp::ITCPEndpoint::SocketPointer>("aasdk::tcp::ITCPEndpoint::SocketPointer");
qRegisterMetaType<std::string>("std::string");
ui_->setupUi(this);
connect(ui_->pushButtonCancel, &QPushButton::clicked, this, &ConnectDialog::close);
connect(ui_->pushButtonConnect, &QPushButton::clicked, this, &ConnectDialog::onConnectButtonClicked);
connect(ui_->listViewRecent, &QListView::clicked, this, &ConnectDialog::onRecentAddressClicked);
connect(this, &ConnectDialog::connectionSucceed, this, &ConnectDialog::onConnectionSucceed);
connect(this, &ConnectDialog::connectionFailed, this, &ConnectDialog::onConnectionFailed);
ui_->listViewRecent->setModel(&recentAddressesModel_);
this->loadRecentList();
}
ConnectDialog::~ConnectDialog()
{
delete ui_;
}
void ConnectDialog::onConnectButtonClicked()
{
this->setControlsEnabledStatus(false);
const auto &ipAddress = ui_->lineEditIPAddress->text().toStdString();
auto socket = std::make_shared<boost::asio::ip::tcp::socket>(ioService_);
try
{
tcpWrapper_.asyncConnect(*socket, ipAddress, 5277, std::bind(&ConnectDialog::connectHandler, this, std::placeholders::_1, ipAddress, socket));
}
catch (const boost::system::system_error &se)
{
emit connectionFailed(QString(se.what()));
}
}
void ConnectDialog::connectHandler(const boost::system::error_code &ec, const std::string &ipAddress, aasdk::tcp::ITCPEndpoint::SocketPointer socket)
{
if (!ec)
{
emit connectionSucceed(std::move(socket), ipAddress);
this->close();
}
else
{
emit connectionFailed(QString::fromStdString(ec.message()));
}
}
void ConnectDialog::onConnectionSucceed(aasdk::tcp::ITCPEndpoint::SocketPointer, const std::string &ipAddress)
{
this->insertIpAddress(ipAddress);
this->setControlsEnabledStatus(true);
}
void ConnectDialog::onConnectionFailed(const QString &message)
{
this->setControlsEnabledStatus(true);
/*QMessageBox errorMessage(QMessageBox::Critical, "Connect error", message, QMessageBox::Ok);
errorMessage.setWindowFlags(Qt::WindowStaysOnTopHint);
errorMessage.exec();*/
}
void ConnectDialog::onRecentAddressClicked(const QModelIndex &index)
{
const auto &recentAddressesList = recentAddressesList_.getList();
if (static_cast<size_t>(index.row()) <= recentAddressesList.size())
{
ui_->lineEditIPAddress->setText(QString::fromStdString(recentAddressesList.at(index.row())));
}
}
void ConnectDialog::setControlsEnabledStatus(bool status)
{
ui_->pushButtonConnect->setVisible(status);
ui_->pushButtonCancel->setEnabled(status);
ui_->lineEditIPAddress->setEnabled(status);
ui_->listViewRecent->setEnabled(status);
}
void ConnectDialog::loadRecentList()
{
QStringList stringList;
const auto &configList = recentAddressesList_.getList();
for (const auto &element : configList)
{
stringList.append(QString::fromStdString(element));
}
recentAddressesModel_.setStringList(stringList);
}
void ConnectDialog::insertIpAddress(const std::string &ipAddress)
{
recentAddressesList_.insertAddress(ipAddress);
this->loadRecentList();
}
void ConnectDialog::connectToAddress(const QString &ip)
{
const auto &ipAddress = ip.toStdString();
auto socket = std::make_shared<boost::asio::ip::tcp::socket>(ioService_);
try
{
tcpWrapper_.asyncConnect(*socket, ipAddress, 5277, std::bind(&ConnectDialog::connectHandler, this, std::placeholders::_1, ipAddress, socket));
}
catch (const boost::system::system_error &se)
{
emit connectionFailed(QString(se.what()));
}
}
}
}

View File

@ -1,75 +0,0 @@
/*
* This file is part of openauto project.
* Copyright (C) 2018 f1x.studio (Michal Szwaj)
*
* openauto is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* openauto is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with openauto. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QApplication>
#include <QDebug>
#include <QJsonObject>
#include "autoapp/UI/MainWindow.hpp"
#include "ui_mainwindow.h"
namespace autoapp
{
namespace ui
{
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui_(new Ui::MainWindow)
{
ui_->setupUi(this);
//connect(ui_->pushButtonSettings, &QPushButton::clicked, this, &MainWindow::openSettings);
//connect(ui_->pushButtonExit, &QPushButton::clicked, this, &MainWindow::exit);
//connect(ui_->pushButtonToggleCursor, &QPushButton::clicked, this, &MainWindow::toggleCursor);
//connect(ui_->pushButtonWirelessConnection, &QPushButton::clicked, this, &MainWindow::openConnectDialog);
}
MainWindow::~MainWindow()
{
delete ui_;
}
}
}
void autoapp::ui::MainWindow::handleIncomingMessage(const QJsonObject &rootObj)
{
if (rootObj.contains("bluetooth")) {
ui_->stackedWidget->setCurrentIndex(0);
QJsonObject btObj = rootObj["bluetooth"].toObject();
ui_->btSongName->setText(btObj["song"].toString());
ui_->btArtistName->setText(btObj["artist"].toString());
ui_->btAlbumName->setText(btObj["album"].toString());
if (btObj.contains("screen")) {
ui_->btRadioScreen->setText(btObj["screen"].toString());
}
else {
ui_->btRadioScreen->setText("");
}
} else if (rootObj.contains("radio")) {
ui_->stackedWidget->setCurrentIndex(1);
QJsonObject radioObj = rootObj["radio"].toObject();
ui_->radioScreen->setText(radioObj["screen"].toString());
ui_->radioPreset->setText(radioObj["preset"].toString());
ui_->radioSecondLine->setText(radioObj["second"].toString());
} else if (rootObj.contains("connect_wireless_aa")) {
QJsonObject aaObj = rootObj["connect_wireless_aa"].toObject();
//connectWirelessAndroidAuto(aaObj["address"].toString());
}
else if (rootObj.contains("settings")) {
MainWindow::openSettings();
}
}

View File

@ -1,257 +0,0 @@
/*
* This file is part of openauto project.
* Copyright (C) 2018 f1x.studio (Michal Szwaj)
*
* openauto is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* openauto is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with openauto. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QMessageBox>
#include "autoapp/UI/SettingsWindow.hpp"
#include "ui_settingswindow.h"
namespace autoapp
{
namespace ui
{
SettingsWindow::SettingsWindow(openauto::configuration::IConfiguration::Pointer configuration, QWidget *parent)
: QWidget(parent)
, ui_(new Ui::SettingsWindow)
, configuration_(std::move(configuration))
{
ui_->setupUi(this);
connect(ui_->pushButtonCancel, &QPushButton::clicked, this, &SettingsWindow::close);
connect(ui_->pushButtonSave, &QPushButton::clicked, this, &SettingsWindow::onSave);
connect(ui_->horizontalSliderScreenDPI, &QSlider::valueChanged, this, &SettingsWindow::onUpdateScreenDPI);
connect(ui_->radioButtonUseExternalBluetoothAdapter, &QRadioButton::clicked, [&](bool checked) { ui_->lineEditExternalBluetoothAdapterAddress->setEnabled(checked); });
connect(ui_->radioButtonDisableBluetooth, &QRadioButton::clicked, [&]() { ui_->lineEditExternalBluetoothAdapterAddress->setEnabled(false); });
connect(ui_->radioButtonUseLocalBluetoothAdapter, &QRadioButton::clicked, [&]() { ui_->lineEditExternalBluetoothAdapterAddress->setEnabled(false); });
connect(ui_->pushButtonClearSelection, &QPushButton::clicked, std::bind(&SettingsWindow::setButtonCheckBoxes, this, false));
connect(ui_->pushButtonSelectAll, &QPushButton::clicked, std::bind(&SettingsWindow::setButtonCheckBoxes, this, true));
connect(ui_->pushButtonResetToDefaults, &QPushButton::clicked, this, &SettingsWindow::onResetToDefaults);
connect(ui_->pushButtonShowBindings, &QPushButton::clicked, this, &SettingsWindow::onShowBindings);
}
SettingsWindow::~SettingsWindow()
{
delete ui_;
}
void SettingsWindow::onSave()
{
configuration_->setHandednessOfTrafficType(ui_->radioButtonLeftHandDrive->isChecked() ? openauto::configuration::HandednessOfTrafficType::LEFT_HAND_DRIVE : openauto::configuration::HandednessOfTrafficType::RIGHT_HAND_DRIVE);
configuration_->showClock(ui_->checkBoxShowClock->isChecked());
configuration_->setVideoFPS(ui_->radioButton30FPS->isChecked() ? aasdk::proto::enums::VideoFPS::_30 : aasdk::proto::enums::VideoFPS::_60);
if(ui_->radioButton480p->isChecked())
{
configuration_->setVideoResolution(aasdk::proto::enums::VideoResolution::_480p);
}
else if(ui_->radioButton720p->isChecked())
{
configuration_->setVideoResolution(aasdk::proto::enums::VideoResolution::_720p);
}
else if(ui_->radioButton1080p->isChecked())
{
configuration_->setVideoResolution(aasdk::proto::enums::VideoResolution::_1080p);
}
configuration_->setScreenDPI(static_cast<size_t>(ui_->horizontalSliderScreenDPI->value()));
configuration_->setOMXLayerIndex(ui_->spinBoxOmxLayerIndex->value());
QRect videoMargins(0, 0, ui_->spinBoxVideoMarginWidth->value(), ui_->spinBoxVideoMarginHeight->value());
configuration_->setVideoMargins(std::move(videoMargins));
configuration_->setTouchscreenEnabled(ui_->checkBoxEnableTouchscreen->isChecked());
this->saveButtonCheckBoxes();
if(ui_->radioButtonDisableBluetooth->isChecked())
{
configuration_->setBluetoothAdapterType(openauto::configuration::BluetoothAdapterType::NONE);
}
else if(ui_->radioButtonUseLocalBluetoothAdapter->isChecked())
{
configuration_->setBluetoothAdapterType(openauto::configuration::BluetoothAdapterType::LOCAL);
}
else if(ui_->radioButtonUseExternalBluetoothAdapter->isChecked())
{
configuration_->setBluetoothAdapterType(openauto::configuration::BluetoothAdapterType::REMOTE);
}
configuration_->setBluetoothRemoteAdapterAddress(ui_->lineEditExternalBluetoothAdapterAddress->text().toStdString());
configuration_->setMusicAudioChannelEnabled(ui_->checkBoxMusicAudioChannel->isChecked());
configuration_->setSpeechAudioChannelEnabled(ui_->checkBoxSpeechAudioChannel->isChecked());
configuration_->setAudioOutputBackendType(ui_->radioButtonRtAudio->isChecked() ? openauto::configuration::AudioOutputBackendType::RTAUDIO : openauto::configuration::AudioOutputBackendType::QT);
configuration_->save();
this->close();
}
void SettingsWindow::onResetToDefaults()
{
QMessageBox confirmationMessage(QMessageBox::Question, "Confirmation", "Are you sure you want to reset settings?", QMessageBox::Yes | QMessageBox::Cancel);
confirmationMessage.setWindowFlags(Qt::WindowStaysOnTopHint);
if(confirmationMessage.exec() == QMessageBox::Yes)
{
configuration_->reset();
this->load();
}
}
void SettingsWindow::showEvent(QShowEvent* event)
{
QWidget::showEvent(event);
this->load();
}
void SettingsWindow::load()
{
ui_->radioButtonLeftHandDrive->setChecked(configuration_->getHandednessOfTrafficType() == openauto::configuration::HandednessOfTrafficType::LEFT_HAND_DRIVE);
ui_->radioButtonRightHandDrive->setChecked(configuration_->getHandednessOfTrafficType() == openauto::configuration::HandednessOfTrafficType::RIGHT_HAND_DRIVE);
ui_->checkBoxShowClock->setChecked(configuration_->showClock());
ui_->radioButton30FPS->setChecked(configuration_->getVideoFPS() == aasdk::proto::enums::VideoFPS::_30);
ui_->radioButton60FPS->setChecked(configuration_->getVideoFPS() == aasdk::proto::enums::VideoFPS::_60);
ui_->radioButton480p->setChecked(configuration_->getVideoResolution() == aasdk::proto::enums::VideoResolution::_480p);
ui_->radioButton720p->setChecked(configuration_->getVideoResolution() == aasdk::proto::enums::VideoResolution::_720p);
ui_->radioButton1080p->setChecked(configuration_->getVideoResolution() == aasdk::proto::enums::VideoResolution::_1080p);
ui_->horizontalSliderScreenDPI->setValue(static_cast<int>(configuration_->getScreenDPI()));
ui_->spinBoxOmxLayerIndex->setValue(configuration_->getOMXLayerIndex());
const auto& videoMargins = configuration_->getVideoMargins();
ui_->spinBoxVideoMarginWidth->setValue(videoMargins.width());
ui_->spinBoxVideoMarginHeight->setValue(videoMargins.height());
ui_->checkBoxEnableTouchscreen->setChecked(configuration_->getTouchscreenEnabled());
this->loadButtonCheckBoxes();
ui_->radioButtonDisableBluetooth->setChecked(configuration_->getBluetoothAdapterType() == openauto::configuration::BluetoothAdapterType::NONE);
ui_->radioButtonUseLocalBluetoothAdapter->setChecked(configuration_->getBluetoothAdapterType() == openauto::configuration::BluetoothAdapterType::LOCAL);
ui_->radioButtonUseExternalBluetoothAdapter->setChecked(configuration_->getBluetoothAdapterType() == openauto::configuration::BluetoothAdapterType::REMOTE);
ui_->lineEditExternalBluetoothAdapterAddress->setEnabled(configuration_->getBluetoothAdapterType() == openauto::configuration::BluetoothAdapterType::REMOTE);
ui_->lineEditExternalBluetoothAdapterAddress->setText(QString::fromStdString(configuration_->getBluetoothRemoteAdapterAddress()));
ui_->checkBoxMusicAudioChannel->setChecked(configuration_->musicAudioChannelEnabled());
ui_->checkBoxSpeechAudioChannel->setChecked(configuration_->speechAudioChannelEnabled());
const auto& audioOutputBackendType = configuration_->getAudioOutputBackendType();
ui_->radioButtonRtAudio->setChecked(audioOutputBackendType == openauto::configuration::AudioOutputBackendType::RTAUDIO);
ui_->radioButtonQtAudio->setChecked(audioOutputBackendType == openauto::configuration::AudioOutputBackendType::QT);
}
void SettingsWindow::loadButtonCheckBoxes()
{
const auto& buttonCodes = configuration_->getButtonCodes();
ui_->checkBoxPlayButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::PLAY) != buttonCodes.end());
ui_->checkBoxPauseButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::PAUSE) != buttonCodes.end());
ui_->checkBoxTogglePlayButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::TOGGLE_PLAY) != buttonCodes.end());
ui_->checkBoxNextTrackButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::NEXT) != buttonCodes.end());
ui_->checkBoxPreviousTrackButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::PREV) != buttonCodes.end());
ui_->checkBoxHomeButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::HOME) != buttonCodes.end());
ui_->checkBoxPhoneButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::PHONE) != buttonCodes.end());
ui_->checkBoxCallEndButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::CALL_END) != buttonCodes.end());
ui_->checkBoxVoiceCommandButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::MICROPHONE_1) != buttonCodes.end());
ui_->checkBoxLeftButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::LEFT) != buttonCodes.end());
ui_->checkBoxRightButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::RIGHT) != buttonCodes.end());
ui_->checkBoxUpButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::UP) != buttonCodes.end());
ui_->checkBoxDownButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::DOWN) != buttonCodes.end());
ui_->checkBoxScrollWheelButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::SCROLL_WHEEL) != buttonCodes.end());
ui_->checkBoxBackButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::BACK) != buttonCodes.end());
ui_->checkBoxEnterButton->setChecked(std::find(buttonCodes.begin(), buttonCodes.end(), aasdk::proto::enums::ButtonCode::ENTER) != buttonCodes.end());
}
void SettingsWindow::setButtonCheckBoxes(bool value)
{
ui_->checkBoxPlayButton->setChecked(value);
ui_->checkBoxPauseButton->setChecked(value);
ui_->checkBoxTogglePlayButton->setChecked(value);
ui_->checkBoxNextTrackButton->setChecked(value);
ui_->checkBoxPreviousTrackButton->setChecked(value);
ui_->checkBoxHomeButton->setChecked(value);
ui_->checkBoxPhoneButton->setChecked(value);
ui_->checkBoxCallEndButton->setChecked(value);
ui_->checkBoxVoiceCommandButton->setChecked(value);
ui_->checkBoxLeftButton->setChecked(value);
ui_->checkBoxRightButton->setChecked(value);
ui_->checkBoxUpButton->setChecked(value);
ui_->checkBoxDownButton->setChecked(value);
ui_->checkBoxScrollWheelButton->setChecked(value);
ui_->checkBoxBackButton->setChecked(value);
ui_->checkBoxEnterButton->setChecked(value);
}
void SettingsWindow::saveButtonCheckBoxes()
{
openauto::configuration::IConfiguration::ButtonCodes buttonCodes;
this->saveButtonCheckBox(ui_->checkBoxPlayButton, buttonCodes, aasdk::proto::enums::ButtonCode::PLAY);
this->saveButtonCheckBox(ui_->checkBoxPauseButton, buttonCodes, aasdk::proto::enums::ButtonCode::PAUSE);
this->saveButtonCheckBox(ui_->checkBoxTogglePlayButton, buttonCodes, aasdk::proto::enums::ButtonCode::TOGGLE_PLAY);
this->saveButtonCheckBox(ui_->checkBoxNextTrackButton, buttonCodes, aasdk::proto::enums::ButtonCode::NEXT);
this->saveButtonCheckBox(ui_->checkBoxPreviousTrackButton, buttonCodes, aasdk::proto::enums::ButtonCode::PREV);
this->saveButtonCheckBox(ui_->checkBoxHomeButton, buttonCodes, aasdk::proto::enums::ButtonCode::HOME);
this->saveButtonCheckBox(ui_->checkBoxPhoneButton, buttonCodes, aasdk::proto::enums::ButtonCode::PHONE);
this->saveButtonCheckBox(ui_->checkBoxCallEndButton, buttonCodes, aasdk::proto::enums::ButtonCode::CALL_END);
this->saveButtonCheckBox(ui_->checkBoxVoiceCommandButton, buttonCodes, aasdk::proto::enums::ButtonCode::MICROPHONE_1);
this->saveButtonCheckBox(ui_->checkBoxLeftButton, buttonCodes, aasdk::proto::enums::ButtonCode::LEFT);
this->saveButtonCheckBox(ui_->checkBoxRightButton, buttonCodes, aasdk::proto::enums::ButtonCode::RIGHT);
this->saveButtonCheckBox(ui_->checkBoxUpButton, buttonCodes, aasdk::proto::enums::ButtonCode::UP);
this->saveButtonCheckBox(ui_->checkBoxDownButton, buttonCodes, aasdk::proto::enums::ButtonCode::DOWN);
this->saveButtonCheckBox(ui_->checkBoxScrollWheelButton, buttonCodes, aasdk::proto::enums::ButtonCode::SCROLL_WHEEL);
this->saveButtonCheckBox(ui_->checkBoxBackButton, buttonCodes, aasdk::proto::enums::ButtonCode::BACK);
this->saveButtonCheckBox(ui_->checkBoxEnterButton, buttonCodes, aasdk::proto::enums::ButtonCode::ENTER);
configuration_->setButtonCodes(buttonCodes);
}
void SettingsWindow::saveButtonCheckBox(const QCheckBox* checkBox, openauto::configuration::IConfiguration::ButtonCodes& buttonCodes, aasdk::proto::enums::ButtonCode::Enum buttonCode)
{
if(checkBox->isChecked())
{
buttonCodes.push_back(buttonCode);
}
}
void SettingsWindow::onUpdateScreenDPI(int value)
{
ui_->labelScreenDPIValue->setText(QString::number(value));
}
void SettingsWindow::onShowBindings()
{
const QString message = QString("Enter -> [Enter] \n")
+ QString("Left -> [Left] \n")
+ QString("Right -> [Right] \n")
+ QString("Up -> [Up] \n")
+ QString("Down -> [Down] \n")
+ QString("Back -> [Esc] \n")
+ QString("Home -> [H] \n")
+ QString("Phone -> [P] \n")
+ QString("Call end -> [O] \n")
+ QString("Play -> [X] \n")
+ QString("Pause -> [C] \n")
+ QString("Previous track -> [V]/[Media Previous] \n")
+ QString("Next track -> [N]/[Media Next] \n")
+ QString("Toggle play -> [B]/[Media Play] \n")
+ QString("Voice command -> [M] \n")
+ QString("Wheel left -> [1] \n")
+ QString("Wheel right -> [2]");
QMessageBox confirmationMessage(QMessageBox::Information, "Information", message, QMessageBox::Ok);
confirmationMessage.setWindowFlags(Qt::WindowStaysOnTopHint);
confirmationMessage.exec();
}
}
}

View File

@ -1,160 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ConnectDialog</class>
<widget class="QDialog" name="ConnectDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>301</width>
<height>389</height>
</rect>
</property>
<property name="windowTitle">
<string>Connect to device</string>
</property>
<widget class="QGroupBox" name="groupBoxIPAddress">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>281</width>
<height>61</height>
</rect>
</property>
<property name="title">
<string>IP Address</string>
</property>
<widget class="QLineEdit" name="lineEditIPAddress">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>261</width>
<height>25</height>
</rect>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="groupBoxRecent">
<property name="geometry">
<rect>
<x>10</x>
<y>80</y>
<width>281</width>
<height>181</height>
</rect>
</property>
<property name="title">
<string>Recent</string>
</property>
<widget class="QListView" name="listViewRecent">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>261</width>
<height>141</height>
</rect>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</widget>
<widget class="QLabel" name="labelHeadUnitServerInfo">
<property name="geometry">
<rect>
<x>60</x>
<y>260</y>
<width>221</width>
<height>81</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;In order to use wireless mode you must enable head unit server in developer settings.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="labelCopyrightsInfoIcon">
<property name="geometry">
<rect>
<x>20</x>
<y>290</y>
<width>21</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/ico_info.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QPushButton" name="pushButtonCancel">
<property name="geometry">
<rect>
<x>40</x>
<y>340</y>
<width>121</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
<widget class="QPushButton" name="pushButtonConnect">
<property name="geometry">
<rect>
<x>170</x>
<y>340</y>
<width>121</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Connect</string>
</property>
</widget>
<widget class="QProgressBar" name="progressBarConnect">
<property name="geometry">
<rect>
<x>170</x>
<y>340</y>
<width>121</width>
<height>41</height>
</rect>
</property>
<property name="maximum">
<number>0</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
<widget class="QLabel" name="labelConnecting">
<property name="geometry">
<rect>
<x>188</x>
<y>350</y>
<width>91</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Connecting...</string>
</property>
</widget>
<zorder>groupBoxIPAddress</zorder>
<zorder>groupBoxRecent</zorder>
<zorder>labelHeadUnitServerInfo</zorder>
<zorder>labelCopyrightsInfoIcon</zorder>
<zorder>pushButtonCancel</zorder>
<zorder>progressBarConnect</zorder>
<zorder>labelConnecting</zorder>
<zorder>pushButtonConnect</zorder>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,464 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1046</width>
<height>571</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(46, 52, 54);
color: rgb(238, 238, 236);</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="minimumSize">
<size>
<width>1024</width>
<height>500</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1024</width>
<height>500</height>
</size>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="page">
<widget class="QFrame" name="verticalFrame">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1021</width>
<height>500</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>500</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1024</width>
<height>500</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item alignment="Qt::AlignVCenter">
<widget class="QFrame" name="verticalFrame">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item alignment="Qt::AlignHCenter">
<widget class="QWidget" name="btNowPlaying" native="true">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>300</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_6">
<property name="minimumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>:/bluetooth.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QWidget" name="widget" native="true">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>300</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>10</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="label_8">
<property name="maximumSize">
<size>
<width>60</width>
<height>60</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>:/song.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="btSongName">
<property name="font">
<font>
<pointsize>24</pointsize>
</font>
</property>
<property name="text">
<string>Lorem Ipsum Dorem</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_9">
<property name="minimumSize">
<size>
<width>60</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>60</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>:/artist.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="btArtistName">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>Example Artist</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="label_10">
<property name="maximumSize">
<size>
<width>60</width>
<height>60</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>:/album.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="btAlbumName">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>Example Album</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item alignment="Qt::AlignHCenter|Qt::AlignBottom">
<widget class="QLabel" name="btRadioScreen">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>50</height>
</size>
</property>
<property name="font">
<font>
<pointsize>24</pointsize>
</font>
</property>
<property name="text">
<string>ABCD,EFGH</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="page_2">
<widget class="QFrame" name="horizontalFrame">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1024</width>
<height>550</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>550</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1024</width>
<height>550</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QWidget" name="horizontalWidget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="radioIcon">
<property name="minimumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>:/radio.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="radioScreen">
<property name="minimumSize">
<size>
<width>276</width>
<height>140</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>276</width>
<height>140</height>
</size>
</property>
<property name="font">
<font>
<pointsize>40</pointsize>
</font>
</property>
<property name="text">
<string>ABCD,EFGH</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="radioPreset">
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>50</height>
</size>
</property>
<property name="font">
<font>
<pointsize>20</pointsize>
</font>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="radioSecondLine">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>50</height>
</size>
</property>
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>Tuner List</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
<item alignment="Qt::AlignHCenter|Qt::AlignBottom">
<widget class="QWidget" name="horizontalWidget" native="true">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>1024</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1024</width>
<height>50</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>5</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
<resources>
<include location="../assets/resources.qrc"/>
</resources>
<connections/>
</ui>

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
import QtQuick 2.0
import QtGStreamer 1.0
VideoItem {
id: aaVideo
width: 300
height: 300
surface: videoSurface
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 751 B

View File

@ -1,14 +0,0 @@
<RCC>
<qresource prefix="/">
<file>radio.png</file>
<file>album.png</file>
<file>artist.png</file>
<file>bluetooth.png</file>
<file>song.png</file>
<file>ico_androidauto.png</file>
<file>ico_warning.png</file>
<file>ico_setting.png</file>
<file>ico_info.png</file>
<file>aa_video.qml</file>
</qresource>
</RCC>

View File

@ -1,194 +0,0 @@
/*
* This file is part of openauto project.
* Copyright (C) 2018 f1x.studio (Michal Szwaj)
*
* openauto is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* openauto is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with openauto. If not, see <http://www.gnu.org/licenses/>.
*/
#include <thread>
#include <QApplication>
#include <QtWebSockets/QWebSocket>
#include <QTimer>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonParseError>
#include "aasdk/USB/USBHub.hpp"
#include "aasdk/USB/ConnectedAccessoriesEnumerator.hpp"
#include "aasdk/USB/AccessoryModeQueryChain.hpp"
#include "aasdk/USB/AccessoryModeQueryChainFactory.hpp"
#include "aasdk/USB/AccessoryModeQueryFactory.hpp"
#include "aasdk/TCP/TCPWrapper.hpp"
#include "openauto/App.hpp"
#include "openauto/Configuration/IConfiguration.hpp"
#include "openauto/Configuration/RecentAddressesList.hpp"
#include "openauto/Service/AndroidAutoEntityFactory.hpp"
#include "openauto/Service/ServiceFactory.hpp"
#include "openauto/Configuration/Configuration.hpp"
#include "autoapp/UI/MainWindow.hpp"
#include "autoapp/UI/SettingsWindow.hpp"
#include "autoapp/UI/ConnectDialog.hpp"
#include "OpenautoLog.hpp"
using namespace openauto;
using ThreadPool = std::vector<std::thread>;
void startUSBWorkers(boost::asio::io_service &ioService, libusb_context *usbContext, ThreadPool &threadPool)
{
auto usbWorker = [&ioService, usbContext]()
{
timeval libusbEventTimeout{180, 0};
while (!ioService.stopped())
{
libusb_handle_events_timeout_completed(usbContext, &libusbEventTimeout, nullptr);
}
};
threadPool.emplace_back(usbWorker);
threadPool.emplace_back(usbWorker);
threadPool.emplace_back(usbWorker);
threadPool.emplace_back(usbWorker);
}
void startIOServiceWorkers(boost::asio::io_service &ioService, ThreadPool &threadPool)
{
auto ioServiceWorker = [&ioService]()
{
ioService.run();
};
threadPool.emplace_back(ioServiceWorker);
threadPool.emplace_back(ioServiceWorker);
threadPool.emplace_back(ioServiceWorker);
threadPool.emplace_back(ioServiceWorker);
}
int main(int argc, char *argv[])
{
libusb_context *usbContext;
if (libusb_init(&usbContext) != 0)
{
OPENAUTO_LOG(error) << "[OpenAuto] libusb init failed.";
return 1;
}
boost::asio::io_service ioService;
boost::asio::io_service::work work(ioService);
std::vector<std::thread> threadPool;
startUSBWorkers(ioService, usbContext, threadPool);
startIOServiceWorkers(ioService, threadPool);
QApplication qApplication(argc, argv);
autoapp::ui::MainWindow mainWindow;
mainWindow.setWindowFlags(Qt::WindowStaysOnTopHint);
auto configuration = std::make_shared<openauto::configuration::Configuration>();
autoapp::ui::SettingsWindow settingsWindow(configuration);
settingsWindow.setWindowFlags(Qt::WindowStaysOnTopHint);
openauto::configuration::RecentAddressesList recentAddressesList(7);
recentAddressesList.read();
aasdk::tcp::TCPWrapper tcpWrapper;
autoapp::ui::ConnectDialog connectDialog(ioService, tcpWrapper, recentAddressesList);
connectDialog.setWindowFlags(Qt::WindowStaysOnTopHint);
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::exit, []()
{ std::exit(0); });
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openSettings, &settingsWindow, &autoapp::ui::SettingsWindow::showFullScreen);
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openConnectDialog, &connectDialog, &autoapp::ui::ConnectDialog::exec);
qApplication.setOverrideCursor(Qt::BlankCursor);
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::toggleCursor, [&qApplication]()
{
const auto cursor = qApplication.overrideCursor()->shape() == Qt::BlankCursor ? Qt::ArrowCursor : Qt::BlankCursor;
qApplication.setOverrideCursor(cursor); });
mainWindow.showFullScreen();
aasdk::usb::USBWrapper usbWrapper(usbContext);
aasdk::usb::AccessoryModeQueryFactory queryFactory(usbWrapper, ioService);
aasdk::usb::AccessoryModeQueryChainFactory queryChainFactory(usbWrapper, ioService, queryFactory);
openauto::service::ServiceFactory serviceFactory(ioService, configuration);
openauto::service::AndroidAutoEntityFactory androidAutoEntityFactory(ioService, configuration, serviceFactory);
auto usbHub(std::make_shared<aasdk::usb::USBHub>(usbWrapper, ioService, queryChainFactory));
auto connectedAccessoriesEnumerator(std::make_shared<aasdk::usb::ConnectedAccessoriesEnumerator>(usbWrapper, ioService, queryChainFactory));
auto app = std::make_shared<openauto::App>(ioService, usbWrapper, tcpWrapper, androidAutoEntityFactory, std::move(usbHub), std::move(connectedAccessoriesEnumerator));
QObject::connect(&connectDialog, &autoapp::ui::ConnectDialog::connectionSucceed, [&app](auto socket)
{ app->start(std::move(socket)); });
app->waitForDevice(true);
QWebSocket webSocket;
QTimer reconnectTimer;
const QUrl websocketUrl(QStringLiteral("ws://127.0.0.1:5959/ws"));
auto tryConnect = [&webSocket, &websocketUrl]()
{
if (webSocket.state() != QAbstractSocket::ConnectedState &&
webSocket.state() != QAbstractSocket::ConnectingState)
{
qDebug() << "[WebSocket] Attempting to connect to" << websocketUrl.toString();
webSocket.open(websocketUrl);
}
};
// Connect events
QObject::connect(&webSocket, &QWebSocket::connected, [&]()
{
qDebug() << "[WebSocket] Connected.";
webSocket.sendTextMessage("Hello from OpenAuto WebSocket client!");
reconnectTimer.stop(); });
QObject::connect(&webSocket, &QWebSocket::disconnected, [&]()
{
qDebug() << "[WebSocket] Disconnected. Will retry...";
reconnectTimer.start(3000); });
QObject::connect(&webSocket, &QWebSocket::textMessageReceived, [&mainWindow, &connectDialog, &serviceFactory](const QString &message)
{
QJsonParseError error;
QJsonDocument doc = QJsonDocument::fromJson(message.toUtf8(), &error);
if (error.error != QJsonParseError::NoError) {
qDebug() << "JSON parse error:" << error.errorString();
return;
}
QJsonObject rootObj = doc.object();
if (rootObj.contains("wireless_aa_ip")) {
QString ipAddr = rootObj["wireless_aa_ip"].toString();
connectDialog.connectToAddress(ipAddr);
}
else if (rootObj.contains("button")) {
QJsonObject btnObj = rootObj["button"].toObject();
QString btn = btnObj["btn"].toString();
int state = btnObj["state"].toInt();
serviceFactory.sendButtonPressFromString(btn.toStdString(), state);
}
else{
mainWindow.handleIncomingMessage(rootObj);
} });
reconnectTimer.setInterval(3000);
reconnectTimer.setSingleShot(true);
QObject::connect(&reconnectTimer, &QTimer::timeout, tryConnect);
tryConnect();
auto result = qApplication.exec();
std::for_each(threadPool.begin(), threadPool.end(), std::bind(&std::thread::join, std::placeholders::_1));
libusb_exit(usbContext);
return result;
}

View File

@ -1,222 +0,0 @@
#include <QNetworkInterface>
#include <QThread>
#include "OpenautoLog.hpp"
#include "btservice/AndroidBluetoothServer.hpp"
namespace openauto
{
namespace btservice
{
AndroidBluetoothServer::AndroidBluetoothServer(openauto::configuration::IConfiguration::Pointer config)
: rfcommServer_(std::make_unique<QBluetoothServer>(QBluetoothServiceInfo::RfcommProtocol, this))
, socket_(nullptr)
, config_(std::move(config))
{
connect(rfcommServer_.get(), &QBluetoothServer::newConnection, this, &AndroidBluetoothServer::onClientConnected);
}
bool AndroidBluetoothServer::start(const QBluetoothAddress& address, uint16_t portNumber)
{
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] listening.";
return rfcommServer_->listen(address, portNumber);
}
void AndroidBluetoothServer::onClientConnected()
{
socket_ = rfcommServer_->nextPendingConnection();
if(socket_ != nullptr)
{
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] Device Connected: " << socket_->peerName().toStdString();
connect(socket_, SIGNAL(readyRead()), this, SLOT(readSocket()));
writeSocketInfoRequest();
}
else
{
OPENAUTO_LOG(error) << "[AndroidBluetoothServer] received null socket during client connection.";
}
}
bool AndroidBluetoothServer::writeProtoMessage(uint16_t messageType, google::protobuf::Message& message)
{
QByteArray byteArray(message.SerializeAsString().c_str(), message.ByteSize());
uint16_t messageLength = message.ByteSize();
byteArray.prepend(messageType & 0x000000ff);
byteArray.prepend((messageType & 0x0000ff00) >> 8);
byteArray.prepend(messageLength & 0x000000ff);
byteArray.prepend((messageLength & 0x0000ff00) >> 8);
if(socket_->write(byteArray) != byteArray.length())
{
return false;
}
return true;
}
void AndroidBluetoothServer::writeSocketInfoRequest()
{
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] Sending SocketInfoRequest.";
QString ipAddr;
foreach(QHostAddress addr, QNetworkInterface::allAddresses())
{
if(!addr.isLoopback() && (addr.protocol() == QAbstractSocket::IPv4Protocol))
{
ipAddr = addr.toString();
}
}
btservice::proto::SocketInfoRequest socketInfoRequest;
socketInfoRequest.set_ip_address(ipAddr.toStdString());
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] ipAddress: "<< ipAddr.toStdString();
socketInfoRequest.set_port(5000);
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] port: "<< 5000;
if(this->writeProtoMessage(1, socketInfoRequest))
{
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] Sent SocketInfoRequest.";
}
else
{
OPENAUTO_LOG(error) << "[AndroidBluetoothServer] Error sending SocketInfoRequest.";
}
}
void AndroidBluetoothServer::writeSocketInfoResponse()
{
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] Sending SocketInfoResponse.";
QString ipAddr;
foreach(QHostAddress addr, QNetworkInterface::allAddresses())
{
if(!addr.isLoopback() && (addr.protocol() == QAbstractSocket::IPv4Protocol))
{
ipAddr = addr.toString();
}
}
btservice::proto::SocketInfoResponse socketInfoResponse;
socketInfoResponse.set_ip_address(ipAddr.toStdString());
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] ipAddress: "<< ipAddr.toStdString();
socketInfoResponse.set_port(5000);
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] port: "<< 5000;
socketInfoResponse.set_status(btservice::proto::Status::STATUS_SUCCESS);
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] status: "<< btservice::proto::Status::STATUS_SUCCESS;
if(this->writeProtoMessage(7, socketInfoResponse))
{
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] Sent SocketInfoResponse.";
}
else
{
OPENAUTO_LOG(error) << "[AndroidBluetoothServer] Error sending SocketInfoResponse.";
}
}
void AndroidBluetoothServer::handleSocketInfoRequestResponse(QByteArray data)
{
btservice::proto::SocketInfoResponse socketInfoResponse;
socketInfoResponse.ParseFromArray(data, data.size());
OPENAUTO_LOG(info) <<"[AndroidBluetoothServer] Received SocketInfoRequestResponse, status: "<<socketInfoResponse.status();
if(socketInfoResponse.status() == 0)
{
// A status of 0 should be successful handshake (unless phone later reports an error, aw well)
// save this phone so we can autoconnect to it next time
config_->setLastBluetoothPair(socket_->peerAddress().toString().toStdString());
config_->save();
}
}
void AndroidBluetoothServer::handleSocketInfoRequest(QByteArray data)
{
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] Reading SocketInfoRequest.";
btservice::proto::SocketInfoRequest socketInfoRequest;
writeSocketInfoResponse();
}
void AndroidBluetoothServer::writeNetworkInfoMessage()
{
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] Sending NetworkInfoMessage.";
btservice::proto::NetworkInfo networkMessage;
networkMessage.set_ssid(config_->getWifiSSID());
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] SSID: "<<config_->getWifiSSID();
networkMessage.set_psk(config_->getWifiPassword());
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] PSKEY: "<<config_->getWifiPassword();
if(config_->getWifiMAC().empty())
{
networkMessage.set_mac_addr(QNetworkInterface::interfaceFromName("wlan0").hardwareAddress().toStdString());
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] MAC: "<<QNetworkInterface::interfaceFromName("wlan0").hardwareAddress().toStdString();
}
else
{
networkMessage.set_mac_addr(config_->getWifiMAC());
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] MAC: "<< config_->getWifiMAC();
}
networkMessage.set_security_mode(btservice::proto::SecurityMode::WPA2_PERSONAL);
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] Security: "<< btservice::proto::SecurityMode::WPA2_PERSONAL;
networkMessage.set_ap_type(btservice::proto::AccessPointType::STATIC);
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] AP Type: "<< btservice::proto::AccessPointType::STATIC;
if(this->writeProtoMessage(3, networkMessage))
{
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] Sent NetworkInfoMessage";
}
else
{
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] Error sending NetworkInfoMessage.";
}
}
void AndroidBluetoothServer::handleUnknownMessage(int messageType, QByteArray data)
{
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] Received unknown MessageType of "<<messageType;
OPENAUTO_LOG(info) << "[AndroidBluetoothServer] Unknown Message Data: "<<data.toHex(' ').toStdString() ;
}
void AndroidBluetoothServer::readSocket()
{
if(!socket_)
{
return;
}
auto data = socket_->readAll();
if(data.length() == 0)
{
return;
}
uint16_t messageType = (data[2] << 8) | data[3];
switch(messageType)
{
case 1:
handleSocketInfoRequest(data);
break;
case 2:
writeNetworkInfoMessage();
break;
case 7:
data.remove(0, 4);
handleSocketInfoRequestResponse(data);
break;
default:
data.remove(0, 4);
handleUnknownMessage(messageType, data);
break;
}
}
}
}

View File

@ -1,84 +0,0 @@
#include "btservice/btservice.hpp"
namespace openauto
{
namespace btservice
{
btservice::btservice(openauto::configuration::IConfiguration::Pointer config)
: androidBluetoothService_(cServicePortNumber)
, androidBluetoothServer_(config)
{
QBluetoothAddress address;
auto adapters = QBluetoothLocalDevice::allDevices();
if(adapters.size() > 0)
{
address = adapters.at(0).address();
}
else
{
OPENAUTO_LOG(error) << "[btservice] No adapter found.";
}
if(!androidBluetoothServer_.start(address, cServicePortNumber))
{
OPENAUTO_LOG(error) << "[btservice] Server start failed.";
return;
}
OPENAUTO_LOG(info) << "[btservice] Listening for connections, address: " << address.toString().toStdString()
<< ", port: " << cServicePortNumber;
if(!androidBluetoothService_.registerService(address))
{
OPENAUTO_LOG(error) << "[btservice] Service registration failed.";
}
else
{
OPENAUTO_LOG(info) << "[btservice] Service registered, port: " << cServicePortNumber;
}
if(config->getAutoconnectBluetooth())
connectToBluetooth(QBluetoothAddress(QString::fromStdString(config->getLastBluetoothPair())), address);
}
void btservice::connectToBluetooth(QBluetoothAddress addr, QBluetoothAddress controller)
{
// Update 07-12-22, with bluez update and krnbt, raspberry pi is behaving as expected. For this reason
// the RPI specific code has been commented out. The commented out code (and comments below this one)
// exist as legacy now - in case there's a scenario where someone cannot update to krnbt or newer bluez.
// The raspberry pi has a really tough time using bluetoothctl (or really anything) to connect to an Android phone
// even though phone connecting to the pi is fine.
// I found a workaround where you can make the pi attempt an rfcomm connection to the phone, and it connects immediately
// This might require setting u+s on rfcomm though
// Other computers with more sane bluetooth shouldn't have an issue using bluetoothctl
// Update 01-10-21, latest firmware/package updates seem to have made bluetoothctl more stable
// and it won't drop a connection anymore. Only issue, is that the connection will fail
// if the desired target hasn't been "seen" yet
// we can use hcitool to force the pi to recognize that we're trying to connect to a valid device.
// this causes the target device to be "seen"
// bluetoothctl can then connect as normal.
// Why don't we just use rfcomm (as we had previously on pis)? Because an rfcomm initiated connection doesn't connect HFP, which breaks the use of
// pi mic/speakers for android auto phone calls. bluetoothctl will connect all profiles.
#ifdef RPI
// QString program = QString::fromStdString("sudo hcitool cc ")+addr.toString();
// btConnectProcess = new QProcess();
// OPENAUTO_LOG(info)<<"[btservice] Attempting to connect to last bluetooth device, "<<addr.toString().toStdString()<<" using hcitool/bluetoothctl hybrid";
// btConnectProcess->start(program, QProcess::Unbuffered | QProcess::ReadWrite);
// btConnectProcess->waitForFinished();
#endif
btConnectProcess = new QProcess();
btConnectProcess->setProcessChannelMode(QProcess::SeparateChannels);
OPENAUTO_LOG(info)<<"[btservice] Attempting to connect to last bluetooth device, "<<addr.toString().toStdString()<<" with bluetoothctl";
btConnectProcess->start("bluetoothctl");
btConnectProcess->waitForStarted();
btConnectProcess->write(QString("select %1\n").arg(controller.toString()).toUtf8());
btConnectProcess->write(QString("connect %1\n").arg(addr.toString()).toUtf8());
btConnectProcess->closeWriteChannel();
btConnectProcess->waitForFinished();
}
}
}

View File

@ -1,13 +0,0 @@
include(FindProtobuf)
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIR})
file(GLOB_RECURSE proto_files ${CMAKE_CURRENT_SOURCE_DIR}/*.proto)
protobuf_generate_cpp(proto_sources proto_headers ${proto_files})
add_library(btservice_proto SHARED ${proto_headers} ${proto_sources})
target_link_libraries(btservice_proto ${PROTOBUF_LIBRARIES})
install(TARGETS btservice_proto DESTINATION lib)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION include
FILES_MATCHING PATTERN *.h
PATTERN CMakeFiles EXCLUDE)

View File

@ -1,30 +0,0 @@
syntax = "proto2";
package openauto.btservice.proto;
enum SecurityMode {
UNKNOWN_SECURITY_MODE = 0;
OPEN = 1;
WEP_64 = 2;
WEP_128 = 3;
WPA_PERSONAL = 4;
WPA2_PERSONAL = 8;
WPA_WPA2_PERSONAL = 12;
WPA_ENTERPRISE = 20;
WPA2_ENTERPRISE = 24;
WPA_WPA2_ENTERPRISE = 28;
}
enum AccessPointType {
STATIC = 0;
DYNAMIC = 1;
}
message NetworkInfo
{
required string ssid = 1;
required string psk = 2;
required string mac_addr = 3;
required SecurityMode security_mode = 4;
required AccessPointType ap_type = 5;
}

View File

@ -1,9 +0,0 @@
syntax = "proto2";
package openauto.btservice.proto;
message SocketInfoRequest
{
required string ip_address = 1;
optional uint32 port = 2;
}

View File

@ -1,26 +0,0 @@
syntax = "proto2";
package openauto.btservice.proto;
enum Status {
STATUS_UNSOLICITED_MESSAGE = 1;
STATUS_SUCCESS = 0;
STATUS_NO_COMPATIBLE_VERSION = -1;
STATUS_WIFI_INACCESSIBLE_CHANNEL = -2;
STATUS_WIFI_INCORRECT_CREDENTIALS = -3;
STATUS_PROJECTION_ALREADY_STARTED = -4;
STATUS_WIFI_DISABLED = -5;
STATUS_WIFI_NOT_YET_STARTED = -6;
STATUS_INVALID_HOST = -7;
STATUS_NO_SUPPORTED_WIFI_CHANNELS = -8;
STATUS_INSTRUCT_USER_TO_CHECK_THE_PHONE = -9;
STATUS_PHONE_WIFI_DISABLED = -10;
STATUS_WIFI_NETWORK_UNAVAILABLE = -11;
}
message SocketInfoResponse
{
optional string ip_address = 1;
optional int32 port = 2;
required Status status = 3;
}

49
buildenv/Dockerfile Normal file
View File

@ -0,0 +1,49 @@
FROM debian:buster AS prebuilts
COPY ./buildenv/pi_binaries/buster.tar.gz buster.tar.gz
COPY ./buildenv/pi_binaries/aasdk_armhf.deb aasdk_armhf.deb
RUN apt-get update &&\
apt-get -y install cmake build-essential git zip &&\
git clone https://github.com/SonOfGib/prebuilts.git &&\
mkdir qt5 &&\
cat prebuilts/qt5/Qt_5151_armv7l_OpenGLES2.tar.xz* > Qt5_OpenGLES2.tar.xz
FROM debian:buster AS openauto
COPY --from=prebuilts Qt5_OpenGLES2.tar.xz Qt5_OpenGLES2.tar.xz
COPY --from=prebuilts buster.tar.gz buster.tar.gz
COPY --from=prebuilts aasdk_armhf.deb aasdk_armhf.deb
RUN dpkg --add-architecture armhf &&\
apt-get update &&\
apt-get -y install cmake build-essential git &&\
apt-get -y install gcc-arm-linux-gnueabihf cpp-arm-linux-gnueabihf g++-arm-linux-gnueabihf protobuf-compiler &&\
apt-get -y install gcc-8-base:armhf libc6:armhf libgcc1:armhf libicu63:armhf libidn2-0:armhf libstdc++6:armhf libunistring2:armhf pulseaudio:armhf librtaudio-dev:armhf libgps-dev:armhf libblkid-dev:armhf libtag1-dev:armhf libgles2-mesa-dev:armhf libdouble-conversion-dev:armhf &&\
tar -xf Qt5_OpenGLES2.tar.xz -C / &&\
tar -xf buster.tar.gz -C /
# These are all the libboost requirements. It would be shorter if libboost-log-dev wasn't a disaster that's being dealt with manually.
RUN apt-get install -y libprotobuf-dev libusb-1.0.0-dev libssl-dev libboost-dev libboost-system-dev libboost-atomic1.67.0 libboost-chrono1.67.0 libboost-date-time1.67.0 libboost-filesystem1.67.0 libboost-regex1.67.0 libboost-thread1.67.0 libboost-filesystem1.67-dev libboost-thread1.67-dev libboost-date-time1.67-dev &&\
apt-get install -y libprotobuf-dev:armhf libusb-1.0.0-dev:armhf libssl-dev:armhf libboost-dev:armhf libboost-system-dev:armhf libboost-atomic1.67.0:armhf libboost-chrono1.67.0:armhf libboost-date-time1.67.0:armhf libboost-filesystem1.67.0:armhf libboost-regex1.67.0:armhf libboost-system1.67.0:armhf libboost-thread1.67.0:armhf libboost-filesystem1.67-dev:armhf libboost-thread1.67-dev:armhf libboost-date-time1.67-dev:armhf
COPY / /src
WORKDIR /src
# Import resources
COPY ./buildenv/patch-libboost-log-deb.sh /src/resources/patch-libboost-log-deb.sh
COPY ./buildenv/entrypoint.sh /entrypoint.sh
# Patch libboost-log-dev and install
RUN chmod +x ./resources/patch-libboost-log-deb.sh
RUN ./resources/patch-libboost-log-deb.sh
# Make Executable
RUN chmod +x /entrypoint.sh
WORKDIR /
RUN dpkg-deb -xv aasdk_armhf.deb /
WORKDIR /src
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]

16
buildenv/cross-compile.md Normal file
View File

@ -0,0 +1,16 @@
### RPI Cross Compile
The docker image in this folder is intended to be used to cross compile `openauto` without having to configure your
host pc with multiarch or installing a toolchain.
#### Setup
The `openauto` build for RPI3 requires some files from the PI, as well as aasdk libraries compiled for amrhf.
- RPI files should be compressed to `buildenv/pi_binaries/buster.tar.gz`. The files required in the archive should
match the path/files in the `if(RPI3_BUILD)` section of `CMakeLists.txt`
- Copy the `.deb` file from `aasdk` docker cross compile build and place it in `buildenv/pi_binaries/aasdk_armhf.dev`
#### Build
```bash
cd buildenv
sudo docker compose up --build
```
Binary files will then be available in `buildenv/release`.

View File

@ -0,0 +1,7 @@
services:
openauto-build:
build:
context: ../
dockerfile: buildenv/Dockerfile
volumes:
- ./release/:/release/

14
buildenv/entrypoint.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash
# Clear out the /build directory
mkdir build;
cd build;
cmake -DCMAKE_BUILD_TYPE=Release -DRPI3_BUILD=true -DCROSS_COMPILE_ARMHF=true -DAASDK_INCLUDE_DIRS=/usr/include/aasdk -DAASDK_LIBRARIES=/usr/lib/libaasdk.so -DAASDK_PROTO_INCLUDE_DIRS=/usr/include/aasdk_proto -DAASDK_PROTO_LIBRARIES=/usr/lib/libaasdk_proto.so ../
make -j4
cd ../bin
# Move it to release
rm -f /release/autoapp
rm -f /release/btservice
mv autoapp /release
mv btservice /release

View File

@ -0,0 +1,46 @@
# All this because of a packaging bug in libboost-log-dev
# 'Multi-Arch: same' is not present in the control file of Debian packages, all the way up to Sid
# Rather than recompiling the parent libbost suite, download the 6 packages, extract, edit, and repackage.
# https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=libboost-log-dev
apt-get -y install --download-only libboost-log-dev:amd64 libboost-log1.67.0:amd64 libboost-log1.67-dev:amd64
apt-get -y install --download-only libboost-log-dev:armhf libboost-log1.67.0:armhf libboost-log1.67-dev:armhf
mkdir -p /tmp/armhf/libboost-log-dev/
dpkg-deb -x /var/cache/apt/archives/libboost-log-dev_1.67.0.1_armhf.deb /tmp/armhf/libboost-log-dev/
dpkg-deb -e /var/cache/apt/archives/libboost-log-dev_1.67.0.1_armhf.deb /tmp/armhf/libboost-log-dev/DEBIAN/
sed -i '/^Priority: optional/a Multi-Arch: same' /tmp/armhf/libboost-log-dev/DEBIAN/control
dpkg-deb -b /tmp/armhf/libboost-log-dev/ /tmp/libboost-log-dev_1.67.0.1_armhf.deb
mkdir -p /tmp/amd64/libboost-log-dev/
dpkg-deb -x /var/cache/apt/archives/libboost-log-dev_1.67.0.1_amd64.deb /tmp/amd64/libboost-log-dev/
dpkg-deb -e /var/cache/apt/archives/libboost-log-dev_1.67.0.1_amd64.deb /tmp/amd64/libboost-log-dev/DEBIAN/
sed -i '/^Priority: optional/a Multi-Arch: same' /tmp/amd64/libboost-log-dev/DEBIAN/control
dpkg-deb -b /tmp/amd64/libboost-log-dev/ /tmp/libboost-log-dev_1.67.0.1_amd64.deb
mkdir -p /tmp/armhf/libboost-log1.67-dev/
dpkg-deb -x /var/cache/apt/archives/libboost-log1.67-dev_1.67.0-13+deb10u1_armhf.deb /tmp/armhf/libboost-log1.67-dev/
dpkg-deb -e /var/cache/apt/archives/libboost-log1.67-dev_1.67.0-13+deb10u1_armhf.deb /tmp/armhf/libboost-log1.67-dev/DEBIAN/
sed -i '/^Priority: optional/a Multi-Arch: same' /tmp/armhf/libboost-log1.67-dev/DEBIAN/control
dpkg-deb -b /tmp/armhf/libboost-log1.67-dev/ /tmp/libboost-log1.67-dev_1.67.0-13+deb10u1_armhf.deb
mkdir -p /tmp/amd64/libboost-log1.67-dev/
dpkg-deb -x /var/cache/apt/archives/libboost-log1.67-dev_1.67.0-13+deb10u1_amd64.deb /tmp/amd64/libboost-log1.67-dev/
dpkg-deb -e /var/cache/apt/archives/libboost-log1.67-dev_1.67.0-13+deb10u1_amd64.deb /tmp/amd64/libboost-log1.67-dev/DEBIAN/
sed -i '/^Priority: optional/a Multi-Arch: same' /tmp/amd64/libboost-log1.67-dev/DEBIAN/control
dpkg-deb -b /tmp/amd64/libboost-log1.67-dev/ /tmp/libboost-log1.67-dev_1.67.0-13+deb10u1_amd64.deb
mkdir -p /tmp/armhf/libboost-log1.67.0/
dpkg-deb -x /var/cache/apt/archives/libboost-log1.67.0_1.67.0-13+deb10u1_armhf.deb /tmp/armhf/libboost-log1.67.0/
dpkg-deb -e /var/cache/apt/archives/libboost-log1.67.0_1.67.0-13+deb10u1_armhf.deb /tmp/armhf/libboost-log1.67.0/DEBIAN/
sed -i '/^Priority: optional/a Multi-Arch: same' /tmp/armhf/libboost-log1.67.0/DEBIAN/control
dpkg-deb -b /tmp/armhf/libboost-log1.67.0/ /tmp/libboost-log1.67.0_1.67.0-13+deb10u1_armhf.deb
mkdir -p /tmp/amd64/libboost-log1.67.0/
dpkg-deb -x /var/cache/apt/archives/libboost-log1.67.0_1.67.0-13+deb10u1_amd64.deb /tmp/amd64/libboost-log1.67.0/
dpkg-deb -e /var/cache/apt/archives/libboost-log1.67.0_1.67.0-13+deb10u1_amd64.deb /tmp/amd64/libboost-log1.67.0/DEBIAN/
sed -i '/^Priority: optional/a Multi-Arch: same' /tmp/amd64/libboost-log1.67.0/DEBIAN/control
dpkg-deb -b /tmp/amd64/libboost-log1.67.0/ /tmp/libboost-log1.67.0_1.67.0-13+deb10u1_amd64.deb
dpkg -i /tmp/libboost*.deb

2
buildenv/pi_binaries/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
buildenv/release/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -1,80 +0,0 @@
# - Try to find GObject
# Once done this will define
#
# GOBJECT_FOUND - system has GObject
# GOBJECT_INCLUDE_DIR - the GObject include directory
# GOBJECT_LIBRARIES - the libraries needed to use GObject
# GOBJECT_DEFINITIONS - Compiler switches required for using GObject
# Copyright (c) 2006, Tim Beaulen <tbscope@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
IF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES)
# in cache already
SET(GObject_FIND_QUIETLY TRUE)
ELSE (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES)
SET(GObject_FIND_QUIETLY FALSE)
ENDIF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES)
IF (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_GOBJECT gobject-2.0)
#MESSAGE(STATUS "DEBUG: GObject include directory = ${GOBJECT_INCLUDE_DIRS}")
#MESSAGE(STATUS "DEBUG: GObject link directory = ${GOBJECT_LIBRARY_DIRS}")
#MESSAGE(STATUS "DEBUG: GObject CFlags = ${GOBJECT_CFLAGS}")
SET(GOBJECT_DEFINITIONS ${PC_GOBJECT_CFLAGS_OTHER})
ENDIF (NOT WIN32)
FIND_PATH(GOBJECT_INCLUDE_DIR gobject.h
PATHS
${PC_GOBJECT_INCLUDEDIR}
${PC_GOBJECT_INCLUDE_DIRS}
PATH_SUFFIXES glib-2.0/gobject/
)
FIND_LIBRARY(_GObjectLibs NAMES gobject-2.0
PATHS
${PC_GOBJECT_LIBDIR}
${PC_GOBJECT_LIBRARY_DIRS}
)
FIND_LIBRARY(_GModuleLibs NAMES gmodule-2.0
PATHS
${PC_GOBJECT_LIBDIR}
${PC_GOBJECT_LIBRARY_DIRS}
)
FIND_LIBRARY(_GThreadLibs NAMES gthread-2.0
PATHS
${PC_GOBJECT_LIBDIR}
${PC_GOBJECT_LIBRARY_DIRS}
)
FIND_LIBRARY(_GLibs NAMES glib-2.0
PATHS
${PC_GOBJECT_LIBDIR}
${PC_GOBJECT_LIBRARY_DIRS}
)
SET( GOBJECT_LIBRARIES ${_GObjectLibs} ${_GModuleLibs} ${_GThreadLibs} ${_GLibs} )
IF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES)
SET(GOBJECT_FOUND TRUE)
ELSE (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES)
SET(GOBJECT_FOUND FALSE)
ENDIF (GOBJECT_INCLUDE_DIR AND GOBJECT_LIBRARIES)
IF (GOBJECT_FOUND)
IF (NOT GObject_FIND_QUIETLY)
MESSAGE(STATUS "Found GObject libraries: ${GOBJECT_LIBRARIES}")
MESSAGE(STATUS "Found GObject includes : ${GOBJECT_INCLUDE_DIR}")
ENDIF (NOT GObject_FIND_QUIETLY)
ELSE (GOBJECT_FOUND)
IF (GObject_FIND_REQUIRED)
MESSAGE(STATUS "Could NOT find GObject")
ENDIF(GObject_FIND_REQUIRED)
ENDIF (GOBJECT_FOUND)
MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR _GObjectLibs _GModuleLibs _GThreadLibs _GLibs)

View File

@ -1,135 +0,0 @@
# - Try to find GStreamer and its plugins
# Once done, this will define
#
# GSTREAMER_FOUND - system has GStreamer
# GSTREAMER_INCLUDE_DIRS - the GStreamer include directories
# GSTREAMER_LIBRARIES - link these to use GStreamer
#
# Additionally, gstreamer-base is always looked for and required, and
# the following related variables are defined:
#
# GSTREAMER_BASE_INCLUDE_DIRS - gstreamer-base's include directory
# GSTREAMER_BASE_LIBRARIES - link to these to use gstreamer-base
#
# Optionally, the COMPONENTS keyword can be passed to find_package()
# and GStreamer plugins can be looked for. Currently, the following
# plugins can be searched, and they define the following variables if
# found:
#
# gstreamer-app: GSTREAMER_APP_INCLUDE_DIRS and GSTREAMER_APP_LIBRARIES
# gstreamer-audio: GSTREAMER_AUDIO_INCLUDE_DIRS and GSTREAMER_AUDIO_LIBRARIES
# gstreamer-fft: GSTREAMER_FFT_INCLUDE_DIRS and GSTREAMER_FFT_LIBRARIES
# gstreamer-gl: GSTREAMER_GL_INCLUDE_DIRS and GSTREAMER_GL_LIBRARIES
# gstreamer-mpegts: GSTREAMER_MPEGTS_INCLUDE_DIRS and GSTREAMER_MPEGTS_LIBRARIES
# gstreamer-pbutils: GSTREAMER_PBUTILS_INCLUDE_DIRS and GSTREAMER_PBUTILS_LIBRARIES
# gstreamer-tag: GSTREAMER_TAG_INCLUDE_DIRS and GSTREAMER_TAG_LIBRARIES
# gstreamer-video: GSTREAMER_VIDEO_INCLUDE_DIRS and GSTREAMER_VIDEO_LIBRARIES
# gstreamer-codecparser:GSTREAMER_CODECPARSERS_INCLUDE_DIRS and GSTREAMER_CODECPARSERS_LIBRARIES
#
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
find_package(PkgConfig QUIET)
# Helper macro to find a GStreamer plugin (or GStreamer itself)
# _component_prefix is prepended to the _INCLUDE_DIRS and _LIBRARIES variables (eg. "GSTREAMER_AUDIO")
# _pkgconfig_name is the component's pkg-config name (eg. "gstreamer-1.0", or "gstreamer-video-1.0").
# _library is the component's library name (eg. "gstreamer-1.0" or "gstvideo-1.0")
macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _library)
string(REGEX MATCH "(.*)>=(.*)" _dummy "${_pkgconfig_name}")
if ("${CMAKE_MATCH_2}" STREQUAL "")
pkg_check_modules(PC_${_component_prefix} "${_pkgconfig_name} >= ${GStreamer_FIND_VERSION}")
else ()
pkg_check_modules(PC_${_component_prefix} ${_pkgconfig_name})
endif ()
set(${_component_prefix}_INCLUDE_DIRS ${PC_${_component_prefix}_INCLUDE_DIRS})
find_library(${_component_prefix}_LIBRARIES
NAMES ${_library}
HINTS ${PC_${_component_prefix}_LIBRARY_DIRS} ${PC_${_component_prefix}_LIBDIR}
)
endmacro()
# ------------------------
# 1. Find GStreamer itself
# ------------------------
# 1.1. Find headers and libraries
FIND_GSTREAMER_COMPONENT(GSTREAMER gstreamer-1.0 gstreamer-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_BASE gstreamer-base-1.0 gstbase-1.0)
# -------------------------
# 2. Find GStreamer plugins
# -------------------------
FIND_GSTREAMER_COMPONENT(GSTREAMER_APP gstreamer-app-1.0 gstapp-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_AUDIO gstreamer-audio-1.0 gstaudio-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_FFT gstreamer-fft-1.0 gstfft-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_GL gstreamer-gl-1.0 gstgl-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_MPEGTS gstreamer-mpegts-1.0>=1.4.0 gstmpegts-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_PBUTILS gstreamer-pbutils-1.0 gstpbutils-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_TAG gstreamer-tag-1.0 gsttag-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_VIDEO gstreamer-video-1.0 gstvideo-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_CODECPARSERS gstreamer-codecparsers-1.0 gstcodecparsers-1.0)
# ------------------------------------------------
# 3. Process the COMPONENTS passed to FIND_PACKAGE
# ------------------------------------------------
set(_GSTREAMER_REQUIRED_VARS GSTREAMER_INCLUDE_DIRS GSTREAMER_LIBRARIES GSTREAMER_VERSION GSTREAMER_BASE_INCLUDE_DIRS GSTREAMER_BASE_LIBRARIES)
foreach (_component ${GStreamer_FIND_COMPONENTS})
set(_gst_component "GSTREAMER_${_component}")
string(TOUPPER ${_gst_component} _UPPER_NAME)
list(APPEND _GSTREAMER_REQUIRED_VARS ${_UPPER_NAME}_INCLUDE_DIRS ${_UPPER_NAME}_LIBRARIES)
endforeach ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer REQUIRED_VARS _GSTREAMER_REQUIRED_VARS
VERSION_VAR GSTREAMER_VERSION)
mark_as_advanced(
GSTREAMER_APP_INCLUDE_DIRS
GSTREAMER_APP_LIBRARIES
GSTREAMER_AUDIO_INCLUDE_DIRS
GSTREAMER_AUDIO_LIBRARIES
GSTREAMER_BASE_INCLUDE_DIRS
GSTREAMER_BASE_LIBRARIES
GSTREAMER_FFT_INCLUDE_DIRS
GSTREAMER_FFT_LIBRARIES
GSTREAMER_GL_INCLUDE_DIRS
GSTREAMER_GL_LIBRARIES
GSTREAMER_INCLUDE_DIRS
GSTREAMER_LIBRARIES
GSTREAMER_MPEGTS_INCLUDE_DIRS
GSTREAMER_MPEGTS_LIBRARIES
GSTREAMER_PBUTILS_INCLUDE_DIRS
GSTREAMER_PBUTILS_LIBRARIES
GSTREAMER_TAG_INCLUDE_DIRS
GSTREAMER_TAG_LIBRARIES
GSTREAMER_VIDEO_INCLUDE_DIRS
GSTREAMER_VIDEO_LIBRARIES
GSTREAMER_CODECPARSERS_INCLUDE_DIRS
GSTREAMER_CODECPARSERS_LIBRARIES
)

View File

@ -0,0 +1,55 @@
if (AAP_PROTOBUF_LIB_DIRS AND AAP_PROTOBUF_INCLUDE_DIRS)
# in cache already
message(STATUS "aap_protobuf is cached")
set(AAP_PROTOBUF_FOUND TRUE)
else (AAP_PROTOBUF_LIB_DIRS AND AAP_PROTOBUF_INCLUDE_DIRS)
find_path(AAP_PROTOBUF_INCLUDE_DIR
NAMES
channel/control/GalConstants.pb.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
PATH_SUFFIXES
aap_protobuf
)
find_library(AAP_PROTOBUF_LIB_DIR
NAMES
aap_protobuf libaap_protobuf
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
set(AAP_PROTOBUF_INCLUDE_DIRS
${AAP_PROTOBUF_INCLUDE_DIR}
)
set(AAP_PROTOBUF_LIB_DIRS
${AAP_PROTOBUF_LIB_DIR}
)
if (AAP_PROTOBUF_INCLUDE_DIRS AND AAP_PROTOBUF_LIB_DIRS)
set(AAP_PROTOBUF_FOUND TRUE)
endif (AAP_PROTOBUF_INCLUDE_DIRS AND AAP_PROTOBUF_LIB_DIRS)
if (AAP_PROTOBUF_FOUND)
message(STATUS "SUCCESS. Found: aap_protobuf:")
message(STATUS " - Includes: ${AAP_PROTOBUF_INCLUDE_DIRS}")
message(STATUS " - Libraries: ${AAP_PROTOBUF_LIB_DIRS}")
add_library(aap_protobuf INTERFACE)
target_include_directories(aap_protobuf SYSTEM INTERFACE ${AAP_PROTOBUF_INCLUDE_DIR})
target_link_libraries(aap_protobuf INTERFACE ${AAP_PROTOBUF_LIB_DIR})
else (AAP_PROTOBUF_FOUND)
message(STATUS " - Includes: ${AAP_PROTOBUF_INCLUDE_DIRS}")
message(STATUS " - Libraries: ${AAP_PROTOBUF_LIB_DIRS}")
message(FATAL_ERROR "Could not locate aap_protobuf")
endif (AAP_PROTOBUF_FOUND)
# show the AAP_PROTOBUF_INCLUDE_DIRS and AAP_PROTOBUF_LIB_DIRS variables only in the advanced view
mark_as_advanced(AAP_PROTOBUF_INCLUDE_DIRS AAP_PROTOBUF_LIB_DIRS)
endif (AAP_PROTOBUF_LIB_DIRS AND AAP_PROTOBUF_INCLUDE_DIRS)

View File

@ -1,45 +1,55 @@
set (AASDK_DIR ~/aasdk)
find_path(AASDK_INCLUDE_DIR
aasdk/Version.hpp
PATHS ${AASDK_DIR}
PATH_SUFFIXES include
)
find_path(AASDK_PROTO_INCLUDE_DIR
aasdk_proto/AbsoluteInputEventData.pb.h
PATHS ${AASDK_DIR}
)
find_path(AASDK_LIB_DIR
libaasdk.so
PATHS ${AASDK_DIR}
PATH_SUFFIXES lib
)
if (AASDK_INCLUDE_DIR AND AASDK_PROTO_INCLUDE_DIR AND AASDK_LIB_DIR)
if (AASDK_LIB_DIRS AND AASDK_INCLUDE_DIRS)
# in cache already
message(STATUS "aasdk cached")
set(AASDK_FOUND TRUE)
endif()
if (AASDK_FOUND)
if (NOT aasdk_FIND_QUIETLY)
message(STATUS "Found aasdk:")
message(STATUS " - Includes: ${AASDK_INCLUDE_DIR}")
message(STATUS " - Includes: ${AASDK_PROTO_INCLUDE_DIR}")
message(STATUS " - Libraries: ${AASDK_LIB_DIR}")
endif()
add_library(aasdk INTERFACE)
target_include_directories(aasdk INTERFACE ${AASDK_INCLUDE_DIR} ${AASDK_PROTO_INCLUDE_DIR})
set_target_properties(aasdk PROPERTIES INTERFACE_LINK_DIRECTORIES ${AASDK_LIB_DIR})
target_link_libraries(aasdk INTERFACE libaasdk.so libaasdk_proto.so)
else()
if (aasdk_FIND_REQUIRED)
if(AASDK_INCLUDE_DIR AND NOT AASDK_PROTO_INCLUDE_DIR)
message(FATAL_ERROR "aasdk was found but not built. Perform an in-source build.")
else()
message(FATAL_ERROR "Could not find aasdk")
endif()
endif()
endif()
else (AASDK_LIB_DIRS AND AASDK_INCLUDE_DIRS)
find_path(AASDK_INCLUDE_DIR
NAMES
Version.hpp
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
PATH_SUFFIXES
aasdk
)
mark_as_advanced(AASDK_INCLUDE_DIRS AASDK_LIBRARIES)
find_library(AASDK_LIB_DIR
NAMES
aasdk libaasdk
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
set(AASDK_INCLUDE_DIRS
${AASDK_INCLUDE_DIR}
)
set(AASDK_LIB_DIRS
${AASDK_LIB_DIR}
)
if (AASDK_INCLUDE_DIRS AND AASDK_LIB_DIRS)
set(AASDK_FOUND TRUE)
endif (AASDK_INCLUDE_DIRS AND AASDK_LIB_DIRS)
if (AASDK_FOUND)
message(STATUS "Found aasdk:")
message(STATUS " - Includes: ${AASDK_INCLUDE_DIRS}")
message(STATUS " - Libraries: ${AASDK_LIB_DIRS}")
add_library(aasdk INTERFACE)
target_include_directories(aasdk SYSTEM INTERFACE ${AASDK_INCLUDE_DIR})
target_link_libraries(aasdk INTERFACE ${AASDK_LIB_DIR})
else (AASDK_FOUND)
message(STATUS " - Includes: ${AASDK_INCLUDE_DIRS}")
message(STATUS " - Libraries: ${AASDK_LIB_DIRS}")
message(FATAL_ERROR "Could not find aasdk")
endif (AASDK_FOUND)
# show the AASDK_INCLUDE_DIRS and AASDK_LIB_DIRS variables only in the advanced view
mark_as_advanced(AASDK_INCLUDE_DIRS AASDK_LIB_DIRS)
endif (AASDK_LIB_DIRS AND AASDK_INCLUDE_DIRS)

View File

@ -0,0 +1,70 @@
#
# This file is part of openauto project.
# Copyright (C) 2018 f1x.studio (Michal Szwaj)
#
# openauto is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# openauto is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with openauto. If not, see <http://www.gnu.org/licenses/>.
#
if (BLKID_LIBRARIES AND BLKID_INCLUDE_DIRS)
# in cache already
set(BLKID_FOUND TRUE)
else (BLKID_LIBRARIES AND BLKID_INCLUDE_DIRS)
find_path(BLKID_INCLUDE_DIR
NAMES
blkid.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
PATH_SUFFIXES
blkid
)
find_library(BLKID_LIBRARY
NAMES
blkid
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
set(BLKID_INCLUDE_DIRS
${BLKID_INCLUDE_DIR}
)
set(BLKID_LIBRARIES
${BLKID_LIBRARY}
)
if (BLKID_INCLUDE_DIRS AND BLKID_LIBRARIES)
set(BLKID_FOUND TRUE)
endif (BLKID_INCLUDE_DIRS AND BLKID_LIBRARIES)
if (BLKID_FOUND)
if (NOT blkid_FIND_QUIETLY)
message(STATUS "Found blkid:")
message(STATUS " - Includes: ${BLKID_INCLUDE_DIRS}")
message(STATUS " - Libraries: ${BLKID_LIBRARIES}")
endif (NOT blkid_FIND_QUIETLY)
else (BLKID_FOUND)
if (blkid_FIND_REQUIRED)
message(FATAL_ERROR "Could not find blkid")
endif (blkid_FIND_REQUIRED)
endif (BLKID_FOUND)
mark_as_advanced(BLKID_INCLUDE_DIRS BLKID_LIBRARIES)
endif (BLKID_LIBRARIES AND BLKID_INCLUDE_DIRS)

View File

@ -0,0 +1,70 @@
#
# This file is part of openauto project.
# Copyright (C) 2018 f1x.studio (Michal Szwaj)
#
# openauto is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# openauto is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with openauto. If not, see <http://www.gnu.org/licenses/>.
#
if (GPS_LIBRARIES AND GPS_INCLUDE_DIRS)
# in cache already
set(GPS_FOUND TRUE)
else (GPS_LIBRARIES AND GPS_INCLUDE_DIRS)
find_path(GPS_INCLUDE_DIR
NAMES
gps.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
PATH_SUFFIXES
gps
)
find_library(GPS_LIBRARY
NAMES
gps
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
set(GPS_INCLUDE_DIRS
${GPS_INCLUDE_DIR}
)
set(GPS_LIBRARIES
${GPS_LIBRARY}
)
if (GPS_INCLUDE_DIRS AND GPS_LIBRARIES)
set(GPS_FOUND TRUE)
endif (GPS_INCLUDE_DIRS AND GPS_LIBRARIES)
if (GPS_FOUND)
if (NOT gps_FIND_QUIETLY)
message(STATUS "Found gps:")
message(STATUS " - Includes: ${GPS_INCLUDE_DIRS}")
message(STATUS " - Libraries: ${GPS_LIBRARIES}")
endif (NOT gps_FIND_QUIETLY)
else (GPS_FOUND)
if (gps_FIND_REQUIRED)
message(FATAL_ERROR "Could not find gps")
endif (gps_FIND_REQUIRED)
endif (GPS_FOUND)
mark_as_advanced(GPS_INCLUDE_DIRS GPS_LIBRARIES)
endif (GPS_LIBRARIES AND GPS_INCLUDE_DIRS)

View File

@ -1,26 +0,0 @@
set (H264_INCLUDE_DIR /usr/local/include/h264bitstream)
set (H264_LIB_DIR /usr/local/lib)
set(H264_FOUND TRUE)
if (H264_FOUND)
if (NOT h264_FIND_QUIETLY)
message(STATUS "Found h264bitstream:")
message(STATUS " - Includes: ${H264_INCLUDE_DIR}")
message(STATUS " - Libraries: ${H264_LIB_DIR}")
endif()
add_library(h264 INTERFACE)
target_include_directories(h264 INTERFACE ${H264_INCLUDE_DIR})
set_target_properties(h264 PROPERTIES INTERFACE_LINK_DIRECTORIES ${H264_LIB_DIR})
target_link_libraries(h264 INTERFACE libh264bitstream.so)
else()
if (h264_FIND_REQUIRED)
if(H264_INCLUDE_DIR)
message(FATAL_ERROR "h264 was found but not built. Perform an in-source build.")
else()
message(FATAL_ERROR "Could not find h264")
endif()
endif()
endif()
mark_as_advanced(H264_INCLUDE_DIR H264_LIBRARIES)

View File

@ -1,67 +0,0 @@
set (OMX_DIR /opt/vc/)
find_path(BCM_HOST_INCLUDE_DIR
bcm_host.h
PATHS
${OMX_DIR}
PATH_SUFFIXES
include
)
find_path(BCM_HOST_LIB_DIR
libbcm_host.so
PATHS
${OMX_DIR}
PATH_SUFFIXES
lib
)
find_path(ILCLIENT_INCLUDE_DIR
ilclient.h
PATHS
${OMX_DIR}
PATH_SUFFIXES
src/hello_pi/libs/ilclient
)
find_path(ILCLIENT_LIB_DIR
libilclient.a
PATHS
${OMX_DIR}
PATH_SUFFIXES
src/hello_pi/libs/ilclient
)
if (BCM_HOST_INCLUDE_DIR AND ILCLIENT_INCLUDE_DIR AND BCM_HOST_LIB_DIR AND ILCLIENT_LIB_DIR)
set(libomx_FOUND TRUE)
endif()
if (libomx_FOUND)
if (NOT libomx_FIND_QUIETLY)
message(STATUS "Found omx:")
message(STATUS " - Bcm Host: ${BCM_HOST_INCLUDE_DIR}")
message(STATUS " - ilclient: ${ILCLIENT_INCLUDE_DIR}")
endif()
add_library(omx INTERFACE)
target_include_directories(omx SYSTEM INTERFACE
${BCM_HOST_INCLUDE_DIR}
${ILCLIENT_INCLUDE_DIR}
)
target_link_libraries(omx INTERFACE
${BCM_HOST_LIB_DIR}/libbcm_host.so
${ILCLIENT_LIB_DIR}/libilclient.a
${BCM_HOST_LIB_DIR}/libvcos.so
${BCM_HOST_LIB_DIR}/libvcilcs.a
${BCM_HOST_LIB_DIR}/libvchiq_arm.so
)
target_compile_definitions(omx INTERFACE
-DUSE_OMX
-DOMX_SKIP64BIT
-DRASPBERRYPI3
)
endif()

View File

@ -49,7 +49,7 @@ if (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
find_path(LIBUSB_1_INCLUDE_DIR
NAMES
libusb.h
libusb.h
PATHS
/usr/include
/usr/local/include
@ -90,9 +90,9 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
target_link_libraries(libusb INTERFACE ${LIBUSB_1_LIBRARY})
endif (NOT libusb_1_FIND_QUIETLY)
else (LIBUSB_1_FOUND)
if (libusb_1_FIND_REQUIRED)
if (libusb-1.0_FIND_REQUIRED)
message(FATAL_ERROR "Could not find libusb")
endif (libusb_1_FIND_REQUIRED)
endif (libusb-1.0_FIND_REQUIRED)
endif (LIBUSB_1_FOUND)
# show the LIBUSB_1_INCLUDE_DIRS and LIBUSB_1_LIBRARIES variables only in the advanced view

View File

@ -28,8 +28,8 @@ else (RTAUDIO_LIBRARIES AND RTAUDIO_INCLUDE_DIRS)
/usr/local/include
/opt/local/include
/sw/include
PATH_SUFFIXES
rtaudio
PATH_SUFFIXES
rtaudio
)
find_library(RTAUDIO_LIBRARY

View File

@ -0,0 +1,70 @@
#
# This file is part of openauto project.
# Copyright (C) 2018 f1x.studio (Michal Szwaj)
#
# openauto is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# openauto is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with openauto. If not, see <http://www.gnu.org/licenses/>.
#
if (TAGLIB_LIBRARIES AND TAGLIB_INCLUDE_DIRS)
# in cache already
set(TAGLIB_FOUND TRUE)
else (TAGLIB_LIBRARIES AND TAGLIB_INCLUDE_DIRS)
find_path(TAGLIB_INCLUDE_DIR
NAMES
taglib.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
PATH_SUFFIXES
taglib
)
find_library(TAGLIB_LIBRARY
NAMES
tag taglib libtag
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
set(TAGLIB_INCLUDE_DIRS
${TAGLIB_INCLUDE_DIR}
)
set(TAGLIB_LIBRARIES
${TAGLIB_LIBRARY} -ltag
)
if (TAGLIB_INCLUDE_DIRS AND TAGLIB_LIBRARIES)
set(TAGLIB_FOUND TRUE)
endif (TAGLIB_INCLUDE_DIRS AND TAGLIB_LIBRARIES)
if (TAGLIB_FOUND)
if (NOT taglib_FIND_QUIETLY)
message(STATUS "Found taglib:")
message(STATUS " - Includes: ${TAGLIB_INCLUDE_DIRS}")
message(STATUS " - Libraries: ${TAGLIB_LIBRARIES}")
endif (NOT taglib_FIND_QUIETLY)
else (TAGLIB_FOUND)
if (taglib_FIND_REQUIRED)
message(FATAL_ERROR "Could not find taglib")
endif (taglib_FIND_REQUIRED)
endif (TAGLIB_FOUND)
mark_as_advanced(TAGLIB_INCLUDE_DIRS TAGLIB_LIBRARIES)
endif (TAGLIB_LIBRARIES AND TAGLIB_INCLUDE_DIRS)

View File

@ -1,15 +0,0 @@
function( findRpiRevision OUTPUT )
# Find it with an automated script
execute_process( COMMAND grep -Po "^Revision\\s*:\\s*\\K[[:xdigit:]]+" /proc/cpuinfo OUTPUT_VARIABLE TMP OUTPUT_STRIP_TRAILING_WHITESPACE )
# If have not found the Revision number, use the last version
if ( TMP )
message( "-- Detecting Raspberry Pi Revision Number: ${TMP}" )
else()
set( TMP "0006" )
message( WARNING "-- Could NOT find Raspberry Pi revision!" )
endif()
set( ${OUTPUT} "${TMP}" PARENT_SCOPE )
endfunction()

View File

@ -1,51 +0,0 @@
# cmake/gitversion.cmake
cmake_minimum_required(VERSION 3.0.0)
message(STATUS "Resolving GIT Version")
set(_build_version "unknown")
set(_commit_timestamp "unknown")
find_package(Git)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY "${local_dir}"
OUTPUT_VARIABLE _build_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY "${local_dir}"
OUTPUT_VARIABLE _build_branch
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${GIT_EXECUTABLE} log -1 --format=%at
WORKING_DIRECTORY "${local_dir}"
OUTPUT_VARIABLE _commit_timestamp
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message( STATUS "GIT hash: ${_build_version}; branch: ${_build_branch}; Commit epoch: ${_commit_timestamp};")
execute_process(
COMMAND ${GIT_EXECUTABLE} diff --no-ext-diff --quiet
WORKING_DIRECTORY "${local_dir}"
RESULT_VARIABLE ret
)
if(ret EQUAL "1")
set(_build_changes "*")
else()
set(_build_changes "")
endif()
else()
message(STATUS "GIT not found")
endif()
# branch name
# git rev-parse --abbrev-ref HEAD
# changed
# git diff --no-ext-diff --quiet

133
code_of_conduct.md Normal file
View File

@ -0,0 +1,133 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at [let us know][CONTACT].
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
[CONTACT]: mailto:info@getcrankshaft.com

View File

@ -1,63 +0,0 @@
/*
* This file is part of openauto project.
* Copyright (C) 2018 f1x.studio (Michal Szwaj)
*
* openauto is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* openauto is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with openauto. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <memory>
#include <QWidget>
#include "openauto/Configuration/IConfiguration.hpp"
class QCheckBox;
namespace Ui
{
class SettingsWindow;
}
namespace autoapp
{
namespace ui
{
class SettingsWindow : public QWidget
{
Q_OBJECT
public:
explicit SettingsWindow(openauto::configuration::IConfiguration::Pointer configuration, QWidget *parent = nullptr);
~SettingsWindow() override;
private slots:
void onSave();
void onResetToDefaults();
void onUpdateScreenDPI(int value);
void onShowBindings();
private:
void showEvent(QShowEvent* event);
void load();
void loadButtonCheckBoxes();
void saveButtonCheckBoxes();
void saveButtonCheckBox(const QCheckBox* checkBox, openauto::configuration::IConfiguration::ButtonCodes& buttonCodes, aasdk::proto::enums::ButtonCode::Enum buttonCode);
void setButtonCheckBoxes(bool value);
Ui::SettingsWindow* ui_;
openauto::configuration::IConfiguration::Pointer configuration_;
};
}
}

View File

@ -1,49 +0,0 @@
#pragma once
#include <stdint.h>
#include <atomic>
#include <memory>
#include <sstream>
#include <QBluetoothServer>
#include <QBluetoothLocalDevice>
#include <QDataStream>
#include <btservice_proto/NetworkInfo.pb.h>
#include <btservice_proto/SocketInfoRequest.pb.h>
#include <btservice_proto/SocketInfoResponse.pb.h>
#include "openauto/Configuration/Configuration.hpp"
#include "IAndroidBluetoothServer.hpp"
namespace openauto
{
namespace btservice
{
class AndroidBluetoothServer: public QObject, public IAndroidBluetoothServer
{
Q_OBJECT
public:
AndroidBluetoothServer(openauto::configuration::IConfiguration::Pointer config);
bool start(const QBluetoothAddress& address, uint16_t portNumber) override;
private slots:
void onClientConnected();
void readSocket();
private:
std::unique_ptr<QBluetoothServer> rfcommServer_;
QBluetoothSocket* socket_;
openauto::configuration::IConfiguration::Pointer config_;
void handleUnknownMessage(int messageType, QByteArray data);
void handleSocketInfoRequest(QByteArray data);
void handleSocketInfoRequestResponse(QByteArray data);
void writeSocketInfoRequest();
void writeSocketInfoResponse();
void writeNetworkInfoMessage();
bool writeProtoMessage(uint16_t messageType, google::protobuf::Message& message);
};
}
}

View File

@ -1,29 +0,0 @@
#pragma once
#include <QProcess>
#include <QBluetoothAddress>
#include "OpenautoLog.hpp"
#include "btservice/AndroidBluetoothService.hpp"
#include "btservice/AndroidBluetoothServer.hpp"
#include "openauto/Configuration/Configuration.hpp"
namespace openauto
{
namespace btservice
{
class btservice
{
public:
btservice(openauto::configuration::IConfiguration::Pointer config);
private:
const uint16_t cServicePortNumber = 22;
void connectToBluetooth(QBluetoothAddress addr, QBluetoothAddress controller);
openauto::btservice::AndroidBluetoothService androidBluetoothService_;
openauto::btservice::AndroidBluetoothServer androidBluetoothServer_;
QProcess *btConnectProcess;
};
}
}

View File

@ -20,4 +20,5 @@
#include <boost/log/trivial.hpp>
#define OPENAUTO_LOG(severity) BOOST_LOG_TRIVIAL(severity) << "[OpenAuto] "
#define OPENAUTO_LOG_CONTEXT "" //"(" << typeid(*this).name() << "::" << __func__ << ")"
#define OPENAUTO_LOG(severity) BOOST_LOG_TRIVIAL(severity) << "[OpenAuto] " << OPENAUTO_LOG_CONTEXT

View File

@ -18,48 +18,60 @@
#pragma once
#include "aasdk/USB/IUSBHub.hpp"
#include "aasdk/USB/IConnectedAccessoriesEnumerator.hpp"
#include "aasdk/USB/USBWrapper.hpp"
#include "aasdk/TCP/ITCPWrapper.hpp"
#include "aasdk/TCP/ITCPEndpoint.hpp"
#include "openauto/Service/IAndroidAutoEntityEventHandler.hpp"
#include "openauto/Service/IAndroidAutoEntityFactory.hpp"
#include <aasdk/USB/IUSBHub.hpp>
#include <aasdk/USB/IConnectedAccessoriesEnumerator.hpp>
#include <aasdk/USB/USBWrapper.hpp>
#include <aasdk/TCP/ITCPWrapper.hpp>
#include <aasdk/TCP/ITCPEndpoint.hpp>
#include <f1x/openauto/autoapp/Service/IAndroidAutoEntityEventHandler.hpp>
#include <f1x/openauto/autoapp/Service/IAndroidAutoEntityFactory.hpp>
namespace f1x
{
namespace openauto
{
namespace autoapp
{
class App: public openauto::service::IAndroidAutoEntityEventHandler, public std::enable_shared_from_this<App>
class App: public service::IAndroidAutoEntityEventHandler, public std::enable_shared_from_this<App>
{
public:
typedef std::shared_ptr<App> Pointer;
App(boost::asio::io_service& ioService, aasdk::usb::USBWrapper& usbWrapper, aasdk::tcp::ITCPWrapper& tcpWrapper, openauto::service::IAndroidAutoEntityFactory& androidAutoEntityFactory,
App(boost::asio::io_service& ioService, aasdk::usb::USBWrapper& usbWrapper, aasdk::tcp::ITCPWrapper& tcpWrapper, service::IAndroidAutoEntityFactory& androidAutoEntityFactory,
aasdk::usb::IUSBHub::Pointer usbHub, aasdk::usb::IConnectedAccessoriesEnumerator::Pointer connectedAccessoriesEnumerator);
void waitForDevice(bool enumerate = false);
void waitForUSBDevice();
void start(aasdk::tcp::ITCPEndpoint::SocketPointer socket);
void stop();
void pause();
void resume();
void onAndroidAutoQuit() override;
bool disableAutostartEntity = false;
private:
using std::enable_shared_from_this<App>::shared_from_this;
void enumerateDevices();
void waitForUSBDevice();
void waitForWirelessDevice();
void waitForDevice();
void aoapDeviceHandler(aasdk::usb::DeviceHandle deviceHandle);
void onUSBHubError(const aasdk::error::Error& error);
boost::asio::io_service& ioService_;
aasdk::usb::USBWrapper& usbWrapper_;
aasdk::tcp::ITCPWrapper& tcpWrapper_;
boost::asio::io_service::strand strand_;
openauto::service::IAndroidAutoEntityFactory& androidAutoEntityFactory_;
aasdk::usb::IUSBHub::Pointer usbHub_;
boost::asio::ip::tcp::acceptor acceptor_;
boost::asio::io_service::strand strand_;
service::IAndroidAutoEntityFactory& androidAutoEntityFactory_;
aasdk::usb::IUSBHub::Pointer usbHub_;
aasdk::usb::IConnectedAccessoriesEnumerator::Pointer connectedAccessoriesEnumerator_;
openauto::service::IAndroidAutoEntity::Pointer androidAutoEntity_;
service::IAndroidAutoEntity::Pointer androidAutoEntity_;
bool isStopped_;
void startServerSocket();
void handleNewClient(std::shared_ptr<boost::asio::ip::tcp::socket> socket, const boost::system::error_code &err);
};
}
}
}

View File

@ -18,8 +18,12 @@
#pragma once
namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace configuration
{
@ -31,3 +35,5 @@ enum class AudioOutputBackendType
}
}
}
}

View File

@ -18,17 +18,15 @@
#pragma once
namespace openauto
{
namespace configuration
{
enum class BluetoothAdapterType
{
namespace f1x::openauto::autoapp::configuration {
enum class BluetoothAdapterType {
NONE,
LOCAL,
REMOTE
};
EXTERNAL
};
}
}
}

Some files were not shown because too many files have changed in this diff Show More