Class Cast


  • public class Cast
    extends java.lang.Object
    Java interface for Clarius Cast.
    • Constructor Detail

      • Cast

        public Cast​(android.content.Context context,
                    Cast.Listener listener)
        Load the Clarius Cast library.
        Parameters:
        context - the application context.
        listener - API callbacks.
    • Method Detail

      • release

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

        public void initialize​(java.lang.String sslDir,
                               Cast.BooleanResult resultFn)
        Initialize the Clarius Cast library to enable connection.
        Parameters:
        sslDir - the directory to store security keys.
        resultFn - the result callback.
      • isInitialized

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

        public void connect​(java.lang.String ipAddress,
                            int port,
                            java.util.Optional<java.lang.Long> networkID,
                            java.lang.String certificate,
                            Cast.BooleanResult resultFn)
        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.
        Parameters:
        ipAddress - the IP address of the probe.
        port - the probe's TCP port to connect to.
        networkID - the probe's network ID obtained from the Clarius App
        certificate - the certificate for authenticating the probe.
        resultFn - the result callback.
      • disconnect

        public void disconnect​(Cast.BooleanResult resultFn)
        Disconnect from an existing connection.
        Parameters:
        resultFn - the result callback.
      • isConnected

        public boolean isConnected()
        Check if Clarius Cast is currently connected to a probe.
        Returns:
        true if Clarius Cast is connected to a probe.
      • 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.
      • 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.
      • userFunction

        public void userFunction​(UserFunction userFunction,
                                 double value,
                                 Cast.BooleanResult resultFn)
        Perform a user function on a connected probe.
        Parameters:
        userFunction - the command to run.
        value - the value to set if the function supports setting of values, see UserFunction enumerations for details.
        resultFn - the result callback.
      • getProbeInfo

        public void getProbeInfo​(Cast.ProbeInfoResult resultFn)
        Retrieve the probe info.
        Parameters:
        resultFn - the result callback.
      • getFirmwareVersion

        public void getFirmwareVersion​(Platform platform,
                                       Cast.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.
      • requestRawData

        public void requestRawData​(long start,
                                   long end,
                                   Cast.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 requestRawData() 2. On success, read raw data with readRawData()

        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​(Cast.ReadRawDataCallback resultFn)
        Retrieve raw data from a previous request.

        NOTE: call requestRawData() first.

        Parameters:
        resultFn - the result callback.