com.unitech.lib.reader

## Class DetectReader

- java.lang.Object
- - com.unitech.lib.reader.DetectReader

-     public class DetectReader
      extends Object

  DetectReader is responsible for detecting USB RFID readers connected to the device. It listens for USB device attachment and detachment events and handles permissions.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `IUsbEventListener` | `usbDeviceListener`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DetectReader(Context context, IUsbEventListener usbDeviceListener)` Constructor for DetectReader.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getUsbPermission()`
    `void` | `start()` Starts the USB detection process by registering the USB broadcast receiver.
    `void` | `stop()` Stops the USB detection process by unregistering the USB broadcast receiver.
    `void` | `triggerDeviceAttached(UsbDevice device)`
    `void` | `triggerDeviceDetached(UsbDevice device)`

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

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

- - ### Field Detail

    - #### usbDeviceListener

          public IUsbEventListener usbDeviceListener

  - ### Constructor Detail

    - #### DetectReader

          public DetectReader(Context context,
                              IUsbEventListener usbDeviceListener)

      Constructor for DetectReader.
      Parameters:
        `context` - The application context.
        `usbDeviceListener` - Callback to handle USB device events.

  - ### Method Detail

    - #### start

          public void start()

      Starts the USB detection process by registering the USB broadcast receiver.

    - #### stop

          public void stop()

      Stops the USB detection process by unregistering the USB broadcast receiver.

    - #### getUsbPermission

          public String getUsbPermission()

    - #### triggerDeviceAttached

          public void triggerDeviceAttached(UsbDevice device)

    - #### triggerDeviceDetached

          public void triggerDeviceDetached(UsbDevice device)