You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- the API files were removed from the repo, they are now distributed as an Android package from the GitHub Gradle registry, this repo now only contains the example app
- the GitHub Gradle registry requires authentication, the setup is documented in the README file
- the API documentation and sources are distributed in the package
- the API documentation is also available on GitHub Pages: https://clariusdev.github.io/mobileapi/reference/9.4.0/
- added "sdk" in the package name: me.clarius.sdk.mobileapi
* Menu `⋮` > `Ask *`: obtain imaging information, like the current depth or gain.
36
62
37
-
* Menu `⋮` > `settings`: configure the image sent over the Mobile API (this is the image rendered by the Clarius App and transmitted over the Mobile API).
63
+
* Menu `⋮` > `settings`: configure the image rendered by the Clarius App and sent over the API.
38
64
39
65
40
66
# Architecture
@@ -63,32 +89,36 @@ The Clarius App takes care of connecting to the probe and pre-processing the ima
63
89
| |
64
90
+-----------------------+
65
91
92
+
66
93
# API Description
67
94
68
95
On Android, the Mobile API is implemented as an Android _Bound Service_ running in the Clarius App itself.
69
-
Refer to the Android developer guide for details about bound services.
1. The client binds to the service by calling `Context.bindService()` and receives the server's `IBinder`. This `IBinder` is used to create a Messenger that can send messages _to the server_.
80
-
2. The client sends its own Messenger to the server in the `replyTo` field of a `Message` object with code `MSG_REGISTER_CLIENT`. This Messenger is used by the server to send messages _to the client_.
107
+
1. The client binds to the service by calling `Context.bindService()` and receives the server's `IBinder`.
108
+
This `IBinder` is used to create a Messenger that can send messages _to the server_.
109
+
2. The client sends its own Messenger to the server in the `replyTo` field of a `Message` object with code `MSG_REGISTER_CLIENT`.
110
+
This Messenger is used by the server to send messages _to the client_.
81
111
3. The client sends the image configuration to the server (`MSG_CONFIGURE_IMAGE`).
82
112
4. During operation, the server will send the image data to the client (`MSG_NEW_PROCESSED_IMAGE`) and other notable events such as button presses, freeze state, etc.
83
113
5. The client can request the execution of predefined functions such as "increase depth" or "capture image" (`MSG_USER_FN`).
84
114
85
-
All messages and their associated payload are described in the [MobileApi.java](mobileapi/src/main/java/me/clarius/mobileapi/MobileApi.java) file.
115
+
All messages and their associated payload are described in the https://clariusdev.github.io/mobileapi repository.
86
116
87
117
88
118
# Licensing
89
119
90
120
The service operates only when the Clarius App is connected to a scanner with the appropriate license.
91
-
Contact Clarius for details: https://clarius.com/contact/
121
+
Contact Clarius for licensing options: https://clarius.com/contact/.
92
122
93
123
However, the service accepts binding requests from clients even when no proper license is active to accommodate workflows where the license is removed for legitimate reasons, for example when a probe is disconnected to save battery.
94
124
In this case, the service enters a restricted mode where it stops handling requests and sending updates, but will resume normal operation as soon as a licensed scanner is connected again.
@@ -98,12 +128,13 @@ The license check workflow is as follows:
98
128
1. The client binds to the service
99
129
2. The service starts and accepts the bind request, regardless of the license status
100
130
3. Depending on the current license status:
101
-
- if active, the service operates normally: all client requests are handled and all updates are sent to the clients;
131
+
- if active, the service operates normally: all client requests are handled and all updates are sent to the clients
102
132
- if inactive, the service enters restricted mode: no update is sent (except `MSG_LICENSE_UPDATE`) and no client request is handled (except `MSG_REGISTER_CLIENT` and `MSG_UNREGISTER_CLIENT`). The service will reply `MSG_NO_LICENSE` to any other request
103
133
4. If the license status changes during operation, the service sends `MSG_LICENSE_UPDATE` and changes its mode of operation:
104
134
- if the license becomes inactive: the service clears the image configuration and enter restricted mode
105
135
- if the license becomes active: the service resumes normal operations, but the client must re-send the image configuration
106
136
137
+
107
138
# Raw Data
108
139
109
140
Workflow to obtain raw data:
@@ -115,7 +146,9 @@ Workflow to obtain raw data:
115
146
- notify the client with `MSG_RAW_DATA_AVAILABLE`
116
147
3. In the client, send `MSG_COPY_RAW_DATA` to request a copy, include the following data:
117
148
- the capture's identifier and
118
-
- and a writable URI where the archive will be written, see https://developer.android.com/training/secure-file-sharing for details
149
+
- and a writable URI where the archive will be written, refer to the [Android developer guide](android-file-sharing) for details about file sharing
119
150
4. In the client, wait for the reply in message `MSG_RAW_DATA_COPIED`
120
151
121
152
Note: it is possible to trigger a capture via the Mobile API with `MSG_USER_FN`.
0 commit comments