Package com.studica.frc.jni

## Class LidarMiniJNI

- java.lang.Object
- - com.studica.frc.jni.StudicaJNIWrapper
  - - com.studica.frc.jni.LidarMiniJNI

    public class LidarMiniJNI
    extends StudicaJNIWrapper

JNI wrapper for T-mini Plus native C++ driver.

This class declares the native methods that bridge to `LidarMiniJNI.cpp`.

### Constructor Summary

Constructors
`LidarMiniJNI()`

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `c_LidarMini_create​(int port)` Initialises the serial port and configures it for the T-mini Plus (230 400 baud, 8N1).
`static void` `c_LidarMini_decreaseFrequency​(boolean hz)` Decreases the scan frequency by one step.
`static void` `c_LidarMini_destroy()` Stops scanning (if active) and closes the serial port.
`static LidarMini.ScanData` `c_LidarMini_getData()` Returns a snapshot of the last completed 360Â° scan.
`static LidarMini.LidarHealth` `c_LidarMini_getHealth()` Queries the device health status.
`static LidarMini.LidarInfo` `c_LidarMini_getInfo()` Queries device information (model, firmware/hardware version, serial number).
`static void` `c_LidarMini_increaseFrequency​(boolean hz)` Increases the scan frequency by one step.
`static void` `c_LidarMini_start()` Sends the scan-start command to the T-mini Plus and launches the background packet-parsing thread.
`static void` `c_LidarMini_stop()` Sends the stop command to the T-mini Plus and shuts down the background thread.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### LidarMiniJNI

    public LidarMiniJNI()

### Method Detail

#### c_LidarMini_create

    public static void c_LidarMini_create​(int port)

Initialises the serial port and configures it for the T-mini Plus (230 400 baud, 8N1). Does not start scanning.

Parameters:
  `port` - HAL serial port number (USB1 = 2, USB2 = 3)

#### c_LidarMini_destroy

    public static void c_LidarMini_destroy()

Stops scanning (if active) and closes the serial port.

#### c_LidarMini_start

    public static void c_LidarMini_start()

Sends the scan-start command to the T-mini Plus and launches the background packet-parsing thread.

#### c_LidarMini_stop

    public static void c_LidarMini_stop()

Sends the stop command to the T-mini Plus and shuts down the background thread. The serial port remains open.

#### c_LidarMini_increaseFrequency

    public static void c_LidarMini_increaseFrequency​(boolean hz)

Increases the scan frequency by one step.

Must not be called while the device is in scan mode.

Parameters:
  `hz` - `true` â†’ +1 Hz, `false` â†’ +0.1 Hz

#### c_LidarMini_decreaseFrequency

    public static void c_LidarMini_decreaseFrequency​(boolean hz)

Decreases the scan frequency by one step.

Must not be called while the device is in scan mode.

Parameters:
  `hz` - `true` â†’ âˆ’1 Hz, `false` â†’ âˆ’0.1 Hz

#### c_LidarMini_getInfo

    public static LidarMini.LidarInfo c_LidarMini_getInfo()

Queries device information (model, firmware/hardware version, serial number).

Must be called while the device is not scanning.

Returns:
  populated `LidarMini.LidarInfo`, or an empty struct on failure

#### c_LidarMini_getHealth

    public static LidarMini.LidarHealth c_LidarMini_getHealth()

Queries the device health status.

Must be called while the device is not scanning. Real-time health is also embedded in the scan packet CT field and is parsed automatically during scanning.

Returns:
  populated `LidarMini.LidarHealth`, or an empty struct on failure

#### c_LidarMini_getData

    public static LidarMini.ScanData c_LidarMini_getData()

Returns a snapshot of the last completed 360Â° scan.

Thread-safe; may return an empty `LidarMini.ScanData` if the first full lap has not yet finished.

Returns:
  `LidarMini.ScanData` containing parallel arrays of angle, distance, and intensity for every sample point in the last lap