Skip to content

Instantly share code, notes, and snippets.

@LuxoftAKutsan
Last active June 2, 2020 10:54
Show Gist options
  • Save LuxoftAKutsan/dba7700cf1d2bbcfd53dbddc9483f66d to your computer and use it in GitHub Desktop.
Save LuxoftAKutsan/dba7700cf1d2bbcfd53dbddc9483f66d to your computer and use it in GitHub Desktop.
Wifi Raceq
@startuml
!pragma teoz true
title Multiple apps on different devices, MOBILE is an access point
participant HMI
participant SDL
box "Device1"
participant APP1
end box
box "Device2"
participant APP2
end box
note over HMI, APP2: in ini file : NetworkHost = MOBILE \n\
Apps allowed to use feature by policies
autonumber "<font color=blue><b>[00]"
SDL -> HMI : <b>UI.GetCapabilities() request
HMI -> SDL : <b>UI.GetCapabilities(NetworkingCapabilities) response : \n\
\t autoJoinWiFiSupported : \t true \n\
\t canHostWiFiNetwork : \t true \n\
\t preferredNetworkHost : \t **MOBILE** \n\
\t wifiFrequencyBandsSupported : \t "FREQUENCY_BAND_2_4_GHZ"
APP1 -> SDL : <b>RAI_1(NetworkingCapabilities): \n\
\t autoJoinWiFiSupported : \t true \n\
\t canHostWiFiNetwork : \t true \n\
\t preferredNetworkHost : \t **VEHICLE** \n\
\t wifiFrequencyBandsSupported : \t "FREQUENCY_BAND_2_4_GHZ"
SDL -> HMI : <b>OnAppRegistered(App1)
SDL -> APP1 : <b>RAI(App1) response
SDL -> SDL : Based on ini file, **RAI_1** and HMI NetworkCapabilities\n\
SDL decides that **MOBILE should be AP**
SDL -> APP1: <b>OnSystemRequestCapabilitiesUpdate(NetworkCapabilities): \n\
\t preferredNetworkHost : \t **MOBILE**\n\
\t wifiFrequencyBandsSupported : \t "FREQUENCY_BAND_2_4_GHZ"
APP1 -> APP1 : Mobile creates \n\
WiFi Access Point
APP1 -> SDL: <b>JoinNetwork requst \n\
\t ssid : \t DeviceWiFiAP \n\
\t password : \t 12345678 \n\
\t securityType : \t WIFI_SECURITY_WPA2 \n\
\t allowAccessPointToBeShared : \t **true** \n\
\t accessPointSupportsInternetAccess : \t true
SDL -> HMI: <b>JoinNetwork request \n\
\t ssid : \t DeviceWiFiAP \n\
\t password : \t 12345678 \n\
\t securityType : \t WIFI_SECURITY_WPA2 \n\
\t allowAccessPointToBeShared : \t **true** \n\
\t accessPointSupportsInternetAccess : \t true
HMI -[#red]> HMI : Establish \n\
WiFiConnection
note right of HMI #FF9999
<size:18>This may take a long time</size>
end note
activate HMI
APP2 -[#red]> SDL : <b>RAI_2(NetworkingCapabilities): \n\
\t autoJoinWiFiSupported : \t true \n\
\t canHostWiFiNetwork : \t true \n\
\t preferredNetworkHost : \t **MOBILE** \n\
SDL -[#red]> HMI : <b>OnAppRegistered(App2)
SDL -[#red]> APP2 : <b>RAI(App2) response
SDL -> SDL : SDL postpone calculating networkcapabilities for device2
activate SDL
deactivate HMI
HMI -> SDL : <b>JoinNetwork response
SDL -> APP1 : <b>JoinNetwork response
SDL -> APP1 : OnTransportEventUpdate
SDL -[#red]> APP2 : OnTransportEventUpdate
APP1 <-> SDL : <b>Start session via WIFI secondary transport
APP2 <-> APP2 : <b> Unable to start session because WiFi not connected
HMI -[#red]> SDL: <b>OnSystemCapabilityUpdate(NetworkCapabilities): \n\
\t autoJoinWiFiSupported : \t **false** \n\
\t canHostWiFiNetwork : \t **true** \n\
\t preferredNetworkHost : \t **VEHICLE** \n\
\t wifiFrequencyBandsSupported : \t "FREQUENCY_BAND_2_4_GHZ"
note right of SDL #FF9999
<size:18>Now SDL is able to notify postpone devices (multiple devices may be in the queue)</size>
end note
deactivate SDL
SDL -> HMI: <b>OnSystemRequestCapabilitiesUpdate(NetworkCapabilities): \n\
\t preferredNetworkHost : \t **VEHICLE**\n\
\t wifiFrequencyBandsSupported : \t "FREQUENCY_BAND_2_4_GHZ"
HMI -> SDL: <b>JoinNetwork requst \n\
\t ssid : \t DeviceWiFiAP \n\
\t password : \t 12345678 \n\
\t securityType : \t WIFI_SECURITY_WPA2 \n\
\t allowAccessPointToBeShared : \t **true** \n\
\t accessPointSupportsInternetAccess : \t true
SDL -> APP2: <b>JoinNetwork request \n\
\t ssid : \t DeviceWiFiAP \n\
\t password : \t 12345678 \n\
\t securityType : \t WIFI_SECURITY_WPA2 \n\
\t allowAccessPointToBeShared : \t **true** \n\
\t accessPointSupportsInternetAccess : \t true
APP2 -[#red]> APP2 : Establish \n\
WiFiConnection
APP2 -> SDL : <b>JoinNetwork response
SDL -> HMI : <b>JoinNetwork response
note over of APP2 #FF9999
<size:22> SDL will not send OnTransportEventUpdate
<size:22> APP2 should should start service
<size:22> based on info from step **[19]**
end note
@enduml
@startuml
!pragma teoz true
title Multiple apps on different devices, MOBILE is an access point
participant HMI
participant SDL
box "Device1"
participant APP1
end box
box "Device2"
participant APP2
end box
note over HMI, APP2: in ini file : NetworkHost = MOBILE \n\
Apps allowed to use feature by policies
autonumber "<font color=blue><b>[00]"
SDL -> HMI : <b>UI.GetCapabilities() request
HMI -> SDL : <b>UI.GetCapabilities(NetworkingCapabilities) response : \n\
\t autoJoinWiFiSupported : \t true \n\
\t canHostWiFiNetwork : \t true \n\
\t preferredNetworkHost : \t **MOBILE** \n\
\t wifiFrequencyBandsSupported : \t "FREQUENCY_BAND_2_4_GHZ"
APP1 -> SDL : <b>RAI_1(NetworkingCapabilities): \n\
\t autoJoinWiFiSupported : \t true \n\
\t canHostWiFiNetwork : \t true \n\
\t preferredNetworkHost : \t **VEHICLE** \n\
\t wifiFrequencyBandsSupported : \t "FREQUENCY_BAND_2_4_GHZ"
SDL -> HMI : <b>OnAppRegistered(App1)
SDL -> APP1 : <b>RAI(App1) response
SDL -> SDL : Based on ini file, **RAI_1** and HMI NetworkCapabilities\n\
SDL decides that **MOBILE should be AP**
SDL -> APP1: <b>OnSystemRequestCapabilitiesUpdate(NetworkCapabilities): \n\
\t preferredNetworkHost : \t **MOBILE**\n\
\t wifiFrequencyBandsSupported : \t "FREQUENCY_BAND_2_4_GHZ"
APP1 -> APP1 : Mobile creates \n\
WiFi Access Point
APP1 -> SDL: <b>JoinNetwork requst \n\
\t ssid : \t DeviceWiFiAP \n\
\t password : \t 12345678 \n\
\t securityType : \t WIFI_SECURITY_WPA2 \n\
\t allowAccessPointToBeShared : \t **true** \n\
\t accessPointSupportsInternetAccess : \t true
SDL -> HMI: <b>JoinNetwork request \n\
\t ssid : \t DeviceWiFiAP \n\
\t password : \t 12345678 \n\
\t securityType : \t WIFI_SECURITY_WPA2 \n\
\t allowAccessPointToBeShared : \t **true** \n\
\t accessPointSupportsInternetAccess : \t true
HMI -[#red]> HMI : Establish \n\
WiFiConnection
note right of HMI #FF9999
<size:18>This may take a long time</size>
end note
activate HMI
APP2 -[#red]> SDL : <b>RAI_2(NetworkingCapabilities): \n\
\t autoJoinWiFiSupported : \t true \n\
\t canHostWiFiNetwork : \t true \n\
\t preferredNetworkHost : \t **MOBILE** \n\
SDL -[#red]> HMI : <b>OnAppRegistered(App2)
SDL -[#red]> APP2 : <b>RAI(App2) response
SDL -> SDL : Based on ini file, **RAI_1** and \n\
**latest** HMI NetworkCapabilities from step **[02]** \n\
SDL decides that **MOBILE** should be AP
SDL -> APP2: <b>OnSystemRequestCapabilitiesUpdate(NetworkCapabilities): \n\
\t preferredNetworkHost : \t **MOBILE**\n\
\t wifiFrequencyBandsSupported : \t "FREQUENCY_BAND_2_4_GHZ"
note right of SDL #FFFFFF
<font color=red size=20>Mobile receives wrong AP placement
end note
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment