open-merou

Open Mérou, a free iOS app for the Oceanic+ underwater iPhone housing
git clone https://git.schurger.org/open-merou.git
Log | Files | Refs | README | LICENSE

SHARING.md (3649B)


      1 # Dives from Open Mérou to Sub Rascasse
      2 
      3 Sub Rascasse is the logbook. When its optional dive computer is on, Open Mérou records each dive and drops
      4 it in a folder shared with Sub Rascasse, exactly as Open Rémora (the watch app) does: same app group, same
      5 pair of files, another folder.
      6 
      7 ## What is shared, and when
      8 
      9 - Only with the dive computer **on** (terms accepted) and only **real** dives. With the computer off nothing
     10   is recorded at all. Dives played on the simulated housing are never saved nor shared.
     11 - A dive is recorded once the housing went below 1 m, and ends after one minute at the surface (or when the
     12   housing session is restarted). Its files are written at that moment.
     13 
     14 ## Where
     15 
     16 App group `group.org.schurger.dive` (team CM5RQKJH56), folder `OpenMerou/Dives/`, two files per dive:
     17 
     18 - `<uuid>.json`: the complete dive, a `DiveLog` from `RemoraDeco` (RemoraKit), ISO 8601 dates, sorted keys;
     19 - `<uuid>.uddf`: the same dive in UDDF 3.2 (profile, stops, alarms), readable without RemoraKit; its
     20   generator name is "Open Mérou".
     21 
     22 The folder name is part of the contract: do not rename it. (Open Rémora uses `OpenRemora/Plongees/` in the
     23 same group.)
     24 
     25 The group is declared in `project.yml` (`com.apple.security.application-groups`) and must be attached to
     26 `org.schurger.openmerou` on the developer portal. When the container is not available (simulator, unsigned
     27 build, profile without the group), the same two files are written to the app's own
     28 `Documents/DiveComputer/Dives/` instead, visible in the Files app; they are moved to the shared folder at
     29 the first launch that finds it.
     30 
     31 ## What Sub Rascasse has to do (other repository)
     32 
     33 - At launch, when returning to the foreground, and when opened with `subrascasse://open-merou` (the
     34   "Open Sub Rascasse" button of the home screen): read `OpenMerou/Dives/*.json` (or `*.uddf`), add the dives to
     35   the logbook, then **delete both files**. Open Mérou counts the remaining `.json` files as "pending".
     36 - A diver may wear the watch and carry the housing on the same dive: both apps then hand over a dive with
     37   about the same start time. Merging them is Sub Rascasse's decision (Open Rémora has priority).
     38 
     39 ## Useful JSON fields
     40 
     41 `id` (UUID), `number`, `start`, `surfacePressure` (bar), `surfaceIntervalBefore` (min), `gas.o2`,
     42 `gradientFactors.low|high`, `water`, `samples[]` (`time` s, `depth` m, `ceiling` m, `noDecompressionLimit`
     43 min, `stopDepth`, `stopMinutes`), `events[]` (`time`, `warning`), `tissuesAfter` (16 nitrogen pressures, bar),
     44 `computerModel` = "Open Mérou", `source` = "remora" (recorded by the RemoraKit engine).
     45 
     46 Differences from an Open Rémora dive:
     47 
     48 - `samples[].temperature` is absent: the housing only measures the temperature **inside** itself, which is
     49   not the water temperature.
     50 - `surfacePressure` is the lowest pressure the housing's external sensor reported before the dive. That
     51   sensor (characteristic 1625, see `docs/PROTOCOL.md`) is read through a reverse-engineered protocol and has
     52   not been validated underwater yet.
     53 
     54 ## Photos and videos
     55 
     56 Independently of the logbook, and whether the dive computer is on or off, each photo or video taken during a
     57 dive carries the basic dive information as text, in English:
     58 
     59     Open Mérou: depth 12.3 m, dive time 12:34, temperature inside the housing 21.0 °C
     60 
     61 ("depth 12.3 m (estimated)" when the dive computer is off). Photos (HEIC and ProRAW DNG): Exif `UserComment`.
     62 Videos: QuickTime metadata `com.apple.quicktime.comment`, with the values at the start of the recording.
     63 ImageIO offers no key for the Exif 2.31 `WaterDepth`, `Temperature` and `Pressure` tags, so they are not
     64 written.