Class Solum

java.lang.Object
me.clarius.sdk.Solum

public class Solum extends Object
Java interface for Solum.
  • Constructor Details

    • Solum

      public Solum(String nativeLibraryDir, Solum.Listener listener)
      Load the Solum library.
      Parameters:
      nativeLibraryDir - full path to the directory where native JNI libraries are stored. The Solum library will look for Qt plugins inside this directory. The path can be obtained from requireContext().getApplicationInfo().nativeLibraryDir.
      listener - API callbacks.
    • Solum

      public Solum(android.content.Context context, Solum.Listener listener)
      Deprecated.
      This constructor is no longer acceptable, use Solum(String, Listener) instead.

      The Context object was used to obtain the path to the native JNI libraries, the new constructor lets user specify their own path if needed. The default path is: requireContext().getApplicationInfo().nativeLibraryDir.

      Deprecated in version 10.3.0.

      Load the Solum library.
      Parameters:
      context - the application context.
      listener - API callbacks.
  • Method Details

    • release

      public void release()
      Unload the Solum library, any subsequent call will be no-op.
    • initialize

      public void initialize(String sslDir, Solum.InitializationResult resultFn)
      Initialize the Solum library to enable connection.
      Parameters:
      sslDir - the directory to store security keys.
      resultFn - the result callback.
    • isInitialized

      public boolean isInitialized()
      Check if Solum has been initialized.
      Returns:
      true if Solum has been initialized.
    • connect

      public void connect(String ipAddress, int port, Optional<Long> networkID)
      Connect to a probe that is on the same network as the caller.

      NOTE: the network ID is used when attempting to connect to the probe's Wi-Fi that was auto-joined with Android Wi-Fi Network Request API. It can be obtained from the Network object obtained in the NetworkCallback.onAvailable() callback.

      Result will be reported asynchronously in Listener.connectionResult().

      Parameters:
      ipAddress - the IP address of the probe.
      port - the probe's TCP port to connect to.
      networkID - the Wi-Fi network ID obtained when auto-joining Wi-Fi.
    • disconnect

      public void disconnect()
      Disconnect from an existing connection.
    • isConnected

      public boolean isConnected()
      Check if Solum is currently connected to a probe.
      Returns:
      true if Solum is connected to a probe.
    • getFirmwareVersion

      public void getFirmwareVersion(Platform platform, Solum.FirmwareVersionResult resultFn)
      Retrieve the firmware version for a given platform.
      Parameters:
      platform - the platform for which to retrieve the firmware version.
      resultFn - the result callback.
    • updateSoftware

      public void updateSoftware(Solum.SoftwareUpdateResult resultFn, Solum.Progress progressFn)
      Perform a software update once connected.

      Solum attempts to detect the connected probe's platform to select the appropriate firmware. It is possible the auto-detection fails with error "undetermined hardware version", preventing the update. In that case try to force the update by specifying the platform.

      Parameters:
      resultFn - the result callback.
      progressFn - the progress callback.
    • updateSoftware

      public void updateSoftware(Solum.SoftwareUpdateResult resultFn, Solum.Progress progressFn, Optional<Platform> platform)
      Perform a software update once connected.

      Solum attempts to detect the connected probe's platform to select the appropriate firmware. It is possible the auto-detection fails, preventing the update, in that case Solum will use the supplied platform parameter.

      • If auto-detection succeeds, Solum uses the firmware for the detected platform and ignores the supplied platform parameter
      • If auto-detection fails and a platform parameter was specified, Solum uses the firmware for the specified platform
      • If auto-detection fails and no platform parameter was specified, Solum aborts the update

      WARNING: updating a probe with the incorrect firmware could brick it.

      Recommended usage:

      1. Attempt an update without specifying a platform first (let Solum select the appropriate firmware)
      2. Only if the update fails, try specifying a platform
      Parameters:
      resultFn - the result callback.
      progressFn - the progress callback.
      platform - upload the firmware for this platform.
    • getProbes

      public void getProbes(Solum.StringListResult resultFn)
      Retrieve the available probe models supported by the API.
      Parameters:
      resultFn - the result callback with the list of probe models (result list can be empty).
    • getApplications

      public void getApplications(String probe, Solum.StringListResult resultFn)
      Retrieve the available applications for a specific probe model.
      Parameters:
      probe - the probe model for which to retrieve applications.
      resultFn - the result callback with the list of applications (result list can be empty).
    • loadApplication

      public void loadApplication(String probe, String application)
      Load an application with the given probe model.
      Parameters:
      probe - the probe model to load.
      application - the application to load.
    • setCertificate

      public void setCertificate(String cert)
      Set the certificate for the probe with which to connect.
      Parameters:
      cert - the certificate provided by Clarius.
    • setOutputSize

      public void setOutputSize(int width, int height)
      Set the dimensions of the output display for scan conversion.

      The output will always result in a 1:1 pixel ratio, depending on geometry of scanning array, and parameters the frame will have various sizes of black borders around the image.

      Parameters:
      width - the number of horizontal pixels in the output.
      height - the number of vertical pixels in the output.
    • separateOverlays

      public void separateOverlays(boolean enable)
      Set a flag to separate overlays into separate images.

      For example if color/power Doppler or strain imaging is enabled, two callbacks will be generated: one with the grayscale frame and the other with the overlay.

      Parameters:
      enable - the enable flag for separating overlays.
    • setProbeSettings

      public void setProbeSettings(ProbeSettings settings)
      Set the internal probe settings to be applied upon a connection or when an existing connection exists.
      Parameters:
      settings - the structure containing the probe settings.
    • setParam

      public void setParam(Param param, double value)
      Set an imaging parameter.
      Parameters:
      param - the parameter to set.
      value - the new parameter value.
    • getParam

      public void getParam(Param param, Solum.ParamResult resultFn)
      Retrieve an imaging parameter value.
      Parameters:
      param - the parameter for which to retrieve the value.
      resultFn - the result callback.
    • getRange

      public void getRange(Param param, Solum.RangeResult resultFn)
      Retrieve the range for a specific parameter.
      Parameters:
      param - the parameter for which to retrieve the range.
      resultFn - the result callback.
    • setTgc

      public void setTgc(Tgc tgc)
      Set the TGC.
      Parameters:
      tgc - the values to use for the TGC.
    • getTgc

      public void getTgc(Solum.TgcResult resultFn)
      Retrieve the TGC values.
      Parameters:
      resultFn - the result callback.
    • getRoi

      public void getRoi(int count, Solum.RoiResult resultFn)
      Retrieve the ROI for the current mode if valid.
      Parameters:
      count - the number of points to generate.
      resultFn - the result callback.
    • adjustRoi

      public void adjustRoi(RoiFunction roiFn, double x, double y)
      Move the ROI.
      Parameters:
      roiFn - ROI function.
      x - the pixel X position.
      y - the pixel Y position.
    • maximizeRoi

      public void maximizeRoi()
      Maximize the ROI.
    • setMode

      public void setMode(Mode mode)
      Set an imaging mode.
      Parameters:
      mode - the imaging mode to set.
    • getMode

      public void getMode(Solum.ModeResult resultFn)
      Retrieve the current imaging mode.
      Parameters:
      resultFn - the result callback.
    • enable5v

      public void enable5v(boolean enabled)
      Enable the 5V output on or off.
      Parameters:
      enabled - the enable state: true to turn 5V on, 0 to turn off.
    • setFormat

      public void setFormat(ImageFormat format)
      Set the format for processed images, by default the format will be uncompressed ARGB32.
      Parameters:
      format - the format of the image.
    • run

      public void run(boolean run)
      Run or stop imaging.
      Parameters:
      run - the run state to set, true to start imaging, false to stop imaging.
    • powerDown

      public void powerDown()
      Try to power down the probe if actively connected.
    • getStatus

      public void getStatus(Solum.StatusResult resultFn)
      Retrieve the probe status.
      Parameters:
      resultFn - the result callback.
    • getProbeInfo

      public void getProbeInfo(Solum.ProbeInfoResult resultFn)
      Retrieve the probe info.
      Parameters:
      resultFn - the result callback.
    • requestRawData

      public void requestRawData(long start, long end, Solum.RequestRawDataCallback resultFn)
      Request raw data from the probe.

      NOTE: probe must be frozen and in a raw data buffering mode in order for the call to succeed.

      Usage:

      1. Request raw data with this function first
      2. On success, read raw data with readRawData(ReadRawDataCallback, Progress)
      Parameters:
      start - the first frame to request, as determined by timestamp in nanoseconds, set start and end to 0 to requests all data in buffer.
      end - the last frame to request, as determined by timestamp in nanoseconds, set start and end to 0 to requests all data in buffer.
      resultFn - the result callback.
    • readRawData

      public void readRawData(Solum.ReadRawDataCallback resultFn, Solum.Progress progressFn)
      Retrieve raw data from a previous request.

      NOTE: call requestRawData(long, long, RequestRawDataCallback) first.

      Parameters:
      resultFn - the result callback.
      progressFn - the progress callback.
    • optimizeWifi

      public void optimizeWifi(WifiOpt wifiOpt, Solum.BooleanResult resultFn)
      Will try and optimize the wireless channel when the probe is running its own network.

      The function will return a failure if the probe is on an external WLAN as nothing can be optimized, except for switching over to the probe's own network. To switch to the probe's network, see the bluetooth documentation for the wireless management service.

      Parameters:
      wifiOpt - the optimization type to run.
      resultFn - the result callback.
    • resetProbe

      public void resetProbe(ProbeReset probeReset, Solum.BooleanResult resultFn)
      Perform a probe reset.
      Parameters:
      probeReset - the type of probe reset.
      resultFn - the result callback.