Selaa lähdekoodia

added dtr and rts control

Devel 3 vuotta sitten
vanhempi
commit
66be4ef9bc

+ 10 - 0
android/src/main/java/com/melihyarikkaya/rnserialport/RNSerialportModule.java

@@ -86,6 +86,8 @@ public class RNSerialportModule extends ReactContextBaseJavaModule {
   private int STOP_BIT     = UsbSerialInterface.STOP_BITS_1;
   private int PARITY       =  UsbSerialInterface.PARITY_NONE;
   private int FLOW_CONTROL = UsbSerialInterface.FLOW_CONTROL_OFF;
+  private int FLOW_CONTROL_RTS_CTS = UsbSerialInterface.FLOW_CONTROL_RTS_CTS;
+  private int FLOW_CONTROL_DSR_DTR = UsbSerialInterface.FLOW_CONTROL_DSR_DTR;
   private int BAUD_RATE = 9600;
 
 
@@ -201,6 +203,14 @@ public class RNSerialportModule extends ReactContextBaseJavaModule {
   public void setFlowControl(int FLOW_CONTROL) {
     this.FLOW_CONTROL = FLOW_CONTROL;
   }
+  @ReactMethod
+  public void setRTS(int FLOW_CONTROL_RTS_CTS) {
+    this.FLOW_CONTROL_RTS_CTS = FLOW_CONTROL_RTS_CTS;
+  }
+  @ReactMethod
+  public void setDTR(int FLOW_CONTROL_RTS_CTS) {
+    this.FLOW_CONTROL_DSR_DTR = FLOW_CONTROL_DSR_DTR;
+  }
 
   @ReactMethod
   public void loadDefaultConnectionSetting() {