[Paid Software Announcement and Discussion] GerritMaarten:
The challenge is to anticipate all a person can do :D.

But then we talk about focus and this is a (open to additions) list of what one can expect:

Manually change focus (cannot be detected for the time being)

Change lens (this can be read out at least for Canon lenses) this should reset A and B

Interrupt connection camera-app (hmm)

Let the app change focus (the app should not do that unseen by itself) depending on the nature of the change A or B or A and B should be reset or changed. This is completely in your control.

As the uncertainty increases with time, I understand your approach to reset A and B.

What about this: Do not reset anything, but change the green colour to orange to indicate that A and B might no longer work as one would think, but the one who understands the app can shoot a serie pics with other number of steps and number of pictures or even with the same number of steps. So the knowledgeable one uses the orange set points, and those who is not sure about the way the app behaves, taps the button at his focus position of choice to make it green again.

In this Canon EFLensChart.pdf is stated that most modern lenses give distance information to be used for E TTL II. May that be a route to get access to the camera distance information?

Picture a 3-dimensional object to be photographed. Pictures at several focal points must be taken and then stacked.

Camera is in position, your app running.

I want to focus using AF to the nearest point. (Because that goes faster than tapping arrows in the manual focus screen)

Then I want to go to the manual focus bracketing screen. For some reason that is blocked now, I first need to swipe the screen and then the green AF-focus square turns white and the block is reset).

I would like the current AF focus position of the lens be used as the A setpoint. (in orange if you like).

With the appropriate >> arrow (matching the camera-lens combination in use) I move the focus point to the farthest point of my object, tap B.

Then I like to see the number of shots related to the camera-lens combination and aperture chosen.

Then shoot the pictures.

Then back to the manual focus bracketing screen for maybe changing some parameters and then shoot using the same A and B, which in the mean time changed to orange.

The less I have to do the better.

On the exit strategy (WiFi tested only)

When in the manual focus screen and I put another app in focus, DSLR switches off WiFi.

Have u considered maintaining the WiFi connection and let the app completes his tasks in the background, and after completion setting the camera in a low energy consumption mode, supposedly switching off the live view. When I put the app in focus (there is maybe too much focusing in this story) revive live view and restore all settings as required.

An exit button to set the camera to the state it was before connection to the app, then halt the WiFi and disconnect from camera and then bring the app proper start up state, then exiting the app would be helpful.

In case I switch off my camera (or it switches off due to low battery) while the app runs and then switching the camera on again the app fails to pick up the renewed presence of the camera. Even a new start of the app doesn't work (cannot find camera etc or black screen, app doesn't react).

It seems the app or WiFi module doesn't (quickly) return to its start up state after loosing contact with the camera.