-
Notifications
You must be signed in to change notification settings - Fork 7
Feature/iap over bt #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 7 commits
8751ba4
3065c7d
0cab0ae
b4be896
7bd3b3b
bac77d3
b6775fa
5871c4a
66557ac
9b508a6
316cdbb
35fd3ee
4a62343
78aa6c0
81c52b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| ## Functional Requirements | ||
|
|
||
| 1. | ||
| In case application re-registers during `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` | ||
| and sends valid `hashID` param via RegisterAppInterface_request to SDL | ||
|
|
||
| SDL must: | ||
| - respond RegisterAppInterface (SUCCESS, success:true) to mobile app (in case of no other failures) | ||
| - keep all data created/stored by this app BEFORE re-registration (transport switching) | ||
|
|
||
| 2. | ||
| In case application re-registers during `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` | ||
| and sends invalid `hashID` param via RegisterAppInterface_request to SDL | ||
| OR omits `hashID` at all | ||
|
|
||
| SDL must: | ||
| - respond RegisterAppInterface (RESUME_FAILED, success:true) to mobile app (in case of no other failures) | ||
| - clear all data related to this app internally except "AppIconsFolder" | ||
| - send requests to remove data in HMI | ||
|
|
||
| 3. | ||
| In case application re-register AFTER `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` expiration | ||
| and sends valid `hashID` param via RegisterAppInterface_request to SDL | ||
|
|
||
| SDL must: | ||
| - notify HMI about app being unregistered | ||
| - start data resumption process according to existing rules when app re-registers | ||
|
|
||
| 4. | ||
| In case application re-registers AFTER `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` expiration | ||
| and sends invalid `hashID` param via RegisterAppInterface_request to SDL | ||
| or omits `hashID` at all | ||
|
|
||
| SDL must: | ||
| behave according to existing Data Resumption rules | ||
|
|
||
| ## Non-Functional Requirements | ||
| New parameters "AppTransportChangeTimer" , "AppTransportChangeTimerAddition" must be added to smartdevicelink.ini file -> [MAIN] section | ||
|
|
||
| ``` | ||
| [MAIN] | ||
| "AppTransportChangeTimer" = 500 ms | ||
| defines the timeout for waiting the mobile app to reconnect between Bluetooth and USB transports change | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| [MAIN] | ||
| "AppTransportChangeTimerAddition" = 0ms | ||
| Defines the timeout for waiting of every mobile app to reconnect between Bluetooth and USB transports change in case the number of connected apps is more than one | ||
| ``` | ||
|
|
||
| ## Diagram | ||
| Data resumption | ||
|  | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the diagram, it would be very useful to indicate the event which causes SDL core to start the timer (AppTransportChangeTimer + AppTransportChangeTimerAddition*N)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The diagram is updated |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| ## Functional Requirements | ||
|
|
||
| 1. | ||
| In case iAP session was closed due to transport type change | ||
|
|
||
| SDL must: | ||
| - keep all applications registered for reconnecting device | ||
| - during `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` reconnection timer | ||
|
|
||
| 2. | ||
| In case due to transport change SDL started `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` reconnection timer | ||
| and HMI sends any notifications and requests to `appID` that needs to be reconnected | ||
|
|
||
| SDL must: | ||
| - store all the notifications and requests from HMI internally | ||
| - transfer all notifications and requests from HMI right after the `appID` will be reconnected | ||
|
|
||
| 3. | ||
| In case due to transport change SDL started `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` reconnection timer | ||
| and HMI sends any responses to `appID` on requests that were sent before reconnection | ||
|
|
||
| SDL must: | ||
| discard all responses to such `appID` from HMI | ||
|
|
||
| ## Non-Functional Requirements | ||
| New parameters "AppTransportChangeTimer" , "AppTransportChangeTimerAddition" must be added to smartdevicelink.ini file -> [MAIN] section | ||
|
|
||
| ``` | ||
| [MAIN] | ||
| "AppTransportChangeTimer" = 500 ms | ||
| defines the timeout for waiting the mobile app to reconnect between Bluetooth and USB transports change | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| [MAIN] | ||
| "AppTransportChangeTimerAddition" = 0ms | ||
| Defines the timeout for waiting of every mobile app to reconnect between Bluetooth and USB transports change in case the number of connected apps is more than one | ||
| ``` | ||
|
|
||
| ## Diagram | ||
| Reconnection timer and notifications from HMI | ||
|
|
||
|  |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| ## Functional Requirements | ||
|
|
||
| 1. | ||
| In case device was connected over Bluetooth and SDL received signal about USB connection of the same device | ||
|
|
||
| SDL must: | ||
|
|
||
| - start `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` after sending switch signal to external system | ||
| _Note:_ **N** is the number of applications that need to be re-registered | ||
|
|
||
| 2. | ||
| In case mobile application sends RegisterAppInterface during `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` timer | ||
| and `<UUID>` and `<appID>` parameters match with closed session | ||
|
|
||
| SDL must: | ||
| - consider such application as re-registered | ||
| - update data in PolicyTable (`<device_identifier>` section) | ||
| - send UpdateDeviceList to HMI | ||
|
|
||
| _Note:_ For HMI during re-connection all applications remain registered and active, HMILevel resumption is not applicable | ||
|
|
||
| 3. | ||
| In case mobile application was not re-registered during `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` | ||
| due to transport type change | ||
|
|
||
| SDL must: | ||
|
|
||
| send BC.OnAppUnregistered (appID, unexpectedDisconnect:true) to HMI for such application | ||
|
|
||
| 4. | ||
| In case mobile application sends RegisterAppInterface during `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` timer | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KhrystynaDubovyk , maybe better to use an 'app' instead of 'applications' as made in all rest of files?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rejected. |
||
| and `<UUID>` of reconnected device matches | ||
| and `<appID>` parameter does not match with closed session | ||
|
|
||
| SDL must: | ||
| - register such application as a new one | ||
| - send BC.OnAppRegistered to HMI | ||
| - send BC.UpdateAppList to HMI | ||
|
|
||
| 5. | ||
| In case mobile application sends RegisterAppInterface during `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` timer | ||
| and `<appID>` parameter matches with appID of closed session | ||
| and `<UUID>` does not match | ||
|
|
||
| SDL must: | ||
| respond RegisterAppInterface (DUPLICATE_NAME, success:false) | ||
|
|
||
| 6. | ||
| In case iOS device is connected over one of the available transports | ||
|
|
||
| SDL must: | ||
| write hashed `<UUID>` to `<device identifier>` in Device Data section of Policy Table | ||
|
|
||
| 7. | ||
| In case iOS device was connected over USB | ||
| and USB connection was lost | ||
|
|
||
| SDL must: | ||
| NOT start `<AppTransportChangeTimer> + <AppTransportChangeTimerAddition>*N` timer for reconnection | ||
| _Note:_ In case of USB connection loss SDL must proceed with unexpected disconnect flow | ||
|
|
||
| ## Non-Functional Requirements | ||
| New parameters "AppTransportChangeTimer" , "AppTransportChangeTimerAddition" must be added to smartdevicelink.ini file -> [MAIN] section | ||
|
|
||
| ``` | ||
| [MAIN] | ||
| "AppTransportChangeTimer" = 500 ms | ||
| defines the timeout for waiting the mobile app to reconnect between Bluetooth and USB transports change | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| [MAIN] | ||
| "AppTransportChangeTimerAddition" = 0ms | ||
| Defines the timeout for waiting of every mobile app to reconnect between Bluetooth and USB transports change in case the number of connected apps is more than one | ||
| ``` | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
|
|
||
| ## Use Case 1: Handling notifications from HMI during re-connection | ||
|
|
||
| **Main Flow:** | ||
|
|
||
| _Pre-conditions:_ | ||
| a. iOS device is connected over Bluetooth | ||
| b. N applications from this device are registered in SDL | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KhrystynaDubovyk , maybe better to use an 'app' instead of 'applications' as made in all rest of files?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rejected. |
||
|
|
||
| _Steps:_ | ||
| 1. User connects the same device over USB | ||
|
|
||
|
|
||
| _Expected:_ | ||
| 2. SDL starts reconnection timer | ||
| 3. HMI sends no RPCs to SDL assigned to these N applications | ||
| 4. SDL unregisters the applications right after reconnection timer expires | ||
|
|
||
| **Alternative flow 1** | ||
| 3.1 HMI sends an RPC to any of these N applications that need to be reconnected | ||
| 3.1.a. SDL stores all the RPCs from HMI internally | ||
| 3.1.b. SDL transfers all RPCs from HMI right after corresponding application reconnects | ||
|
|
||
| **Alternative flow 2** | ||
| 3.2 HMI sends a response to any of these N applications requests that were sent before reconnection | ||
| 3.2.a. SDL discards all these responses from HMI | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| ## Use Case 1: iAP over BT re-connection | ||
|
|
||
| **Main Flow:** | ||
|
|
||
| _Pre-conditions:_ | ||
| a. iOS device is connected over Bluetooth | ||
| b. Application from iOS device is registered and running on SDL | ||
|
|
||
| _Steps:_ | ||
| 1. User connects the same iOS device over USB | ||
|
|
||
| _Expected:_ | ||
|
|
||
| 2. SDL receives signal with `<UUID>` about USB connection of the same device | ||
| 3. SDL compares `<UUID>` of BT device connection with `<UUID>` of USB connection | ||
|
||
| 4. `<UUID>` of BT device connection matches with `<UUID>` of USB connection | ||
| 5. SDL sends signal about transport switch to the System | ||
| 6. SDL starts reconnection timer | ||
| 7. SDL receives `<RegisterAppInterface>` request **before** reconnection timer expires | ||
| 8. Application sends **valid** "hashID" with `RegisterAppInterface` request | ||
| 9. SDL sends succesful response to the application | ||
| 10. SDL updates data in PolicyTable | ||
| 11. SDL notifies HMI via `UpdatadeviceList` about changed `transportType` | ||
| 12. SDL does not notify HMI about new registration | ||
|
|
||
|
|
||
| _Exception 1:_ | ||
| 7.1. **After** timer expires application sends **valid** "hashID" with `<RegisterAppInterface>` request | ||
| 7.1.a. SDL notifies HMI about app being unregistered | ||
| 7.1.b. Application registers with **valid** "hashID" | ||
| 7.1.c. SDL performs data resumption for this application | ||
| 7.1.d. SDL **notifies** HMI about fresh application registration | ||
|
|
||
| _Exception 2:_ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the difference in case between Exception 2 and Exception 3?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exception 2 describes the flow when invalid or omitted hashID is received after timer expires; |
||
| 7.1.b.1. Application registers with **invalid** or **missing** "hashID" | ||
| 7.1.b.1.a. SDL clears all resumption data related to this application | ||
| 7.1.b.1.b. SDL **notifies** HMI about fresh application registration (sends BC.OnAppRegistered to HMI send BC.UpdateAppList to HMI) | ||
|
|
||
| _Exception 3:_ | ||
| 8.1. Application sends **invalid** or omitted "hashID" with `RegisterAppInterface` request | ||
| 8.1.a. SDL responds with RESUME_FAILED to application's registration request | ||
| 8.1.b. SDL clears all resumption data related to this application **except** "AppIconsFolder" | ||
| 8.1.c. SDL does **not** notify HMI about new registration (HMI continues to display app screen) | ||
|
|
||
| ## Use Case 2: USB connection loss | ||
|
|
||
| _Pre-conditions:_ | ||
| a. iOS device is connected over USB | ||
| b. Application from iOS device is registered and running on SDL | ||
|
|
||
| _Steps:_ | ||
| 1. USB transport was disconnected | ||
|
|
||
| _Expected:_ | ||
|
|
||
| 2. SDL does not start reconnection timer | ||
| 3. SDL notifies HMI about application being unregistered | ||
|
|
||
| ## Use Case 3: Multiple connection | ||
| _Pre-conditions:_ | ||
| a. iOS device is connected over Bluetooth | ||
| b. Application `<app_1>` from iOS device is registered and running on SDL | ||
|
|
||
| _Steps:_ | ||
| 1. User connects the same device over USB | ||
| 2. SDL receives signal with `<UUID>` via IOSDeviceConnectInfo | ||
| 3. SDL connects USB device | ||
| 4. SDL disconnects Bluetooth | ||
|
||
| 5. SDL starts reconnection timer | ||
| 6. Application `<app_2>` sends RegisterAppInterface (params) | ||
|
|
||
| _Expected result:_ | ||
| 7. SDL compares `<UUID>` and `<appID>` parameters with previously closed session | ||
| 8. SDL registers `<app_2>` as a new application | ||
| 9. SDL sends BC.OnAppRegistered to HMI | ||
|
|
||
| _Exception 1:_ | ||
| 1.1. User connects another device over Bluetooth | ||
| 1.1.a SDL receives signal with `<UUID_1>` about USB connection of the same device | ||
| 1.1.b SDL receives signal with `<UUID_2>` about Bluetooth connection of another device | ||
| 1.1.c SDL opens hub EAP protocol for `<UUID_1>` USB session | ||
|
||
| 1.1.d SDL closes active EAP session opened for `<UUID_1>` Bluetooth | ||
| 1.1.e SDL opens hub EAP protocol for `<UUID_2>` Bluetooth session | ||
| 1.1.f SDL starts reconnection timer for `<UUID_1>` | ||
| 1.1.g `<app_1>` from device `<UUID_2>` sends RegisterAppInterface (params) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1.1.g - I am not sure I understand the case being described here. It seems like an app is requesting registration from the device which is connected over BT. But it is not clear why its registration request is being rejected. Please re-write this case with more clarity. |
||
| Expected result: | ||
| 1.1.h SDL compares `<UUID>` and `<appID>` parameters with previously closed session | ||
| 1.1.i SDL responds to the app with RegisterAppInterface (DUPLICATE_NAME, success:false) | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the comment for "AppTransportChangeTimer" can be rewritten as
Defines the timeout period SDL Core will wait for an application to re-register via alternate transport during 'transport switch'. If the application fails to re-register within this time, SDL Core shall inform HMI that the application has unregistered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
"AppTransportChangeTimer" description was rewritten.