Devel 3 years ago
parent
commit
19277620be

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

@@ -392,7 +392,7 @@ public class RNSerialportModule extends ReactContextBaseJavaModule {
   }
 
   @ReactMethod
-  public void writeBytes(byte[] bytes) {
+  public void writeBytes(byte[] buffer) {
     if(!usbServiceStarted){
       eventEmit(onErrorEvent, createError(Definitions.ERROR_USB_SERVICE_NOT_STARTED, Definitions.ERROR_USB_SERVICE_NOT_STARTED_MESSAGE));
       return;
@@ -401,7 +401,7 @@ public class RNSerialportModule extends ReactContextBaseJavaModule {
       eventEmit(onErrorEvent, createError(Definitions.ERROR_THERE_IS_NO_CONNECTION, Definitions.ERROR_THERE_IS_NO_CONNECTION_MESSAGE));
       return;
     }
-    serialPort.write(bytes);
+    serialPort.write(buffer);
   }
 
   @ReactMethod

+ 1 - 1
types/index.d.ts

@@ -248,7 +248,7 @@ interface RNSerialportStatic {
    * @param {ArrayBuffer} data
    * @memberof RNSerialportStatic
    */
-   writeBytes( data ): void;
+   writeBytes( buffer: any ): void;
 
 
   /**