Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions detailed_docs/TRS/iAP over BT/iAP_over_BT_data_resumption.md
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]
Copy link

@robinmk robinmk Dec 28, 2017

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.

Copy link
Contributor Author

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.

"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
![Data resumption](https://github.com/smartdevicelink/sdl_requirements/blob/feature/iap_over_bt/detailed_docs/accessories/iAP_over_BT_data_resumption.png)
Copy link

Choose a reason for hiding this comment

The 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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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

![Reconnection timer and notifications from HMI](https://github.com/smartdevicelink/sdl_requirements/blob/feature/iap_over_bt/detailed_docs/accessories/iAP%20transport%20change%20reconnection.png)
77 changes: 77 additions & 0 deletions detailed_docs/TRS/iAP over BT/iAP_over_BT_re-connection.md
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
Copy link
Contributor

Choose a reason for hiding this comment

The 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?
It's for whole iAP_over_BT_re-connection.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rejected.
changed 'app' into 'application' throughout the document in favour of existing TRS documents written with 'application' (embedded_navi, RC, iAP_over_BT_data_resumptionTRS, ).

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
```

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Copy link
Contributor

Choose a reason for hiding this comment

The 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?
This applicable for whole iAP_over_BT_handling_HMI_notif_during_reconnection_use_case.md

Copy link
Contributor Author

@KhrystynaDubovyk KhrystynaDubovyk Nov 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rejected.
Changed 'app' into 'application' throughout iAP_over_BT_re-connection_use_case document in favour of existing use cases:
RC UCs are written mostly with 'app'
embedded_navi UCs are written mostly with 'application'
To mitigate difference in word usage in TRSs and UCs I offer to use 'application'.


_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
88 changes: 88 additions & 0 deletions detailed_docs/iAP_over_BT/iAP_over_BT_re-connection_use_case.md
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the HMI responsible for doing the UUID check and informing SDL to perform transport switch? Please make sure to correct this entire flow accordingly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flow was corrected accordingly

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:_
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference in case between Exception 2 and Exception 3?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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;
Exception 3 describes the flow when invalid or omitted hashID is received before 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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Step4- What is meant by "SDL disconnects BT" - From my understanding it is the HMI layer which disconnects the iAP channel over BT transport (Please note that the BT transport itself is not closed, only the iAP channel over the BT transport is closed)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accepted, updated.

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.1.c and 1.1.e- I think it is better to say that SDL opens appropriate EAP protocols and not be specific to HUB protocol because SDL should also be opening the dedicated EAP protocols as well (like com.smartdevicelink.multisession)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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)
Copy link

Choose a reason for hiding this comment

The 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)