How use the ionic-native/serial plugin

#1

Hello,

I need to communicate with a device connected to OTG on a phone.

In the documentation( ionic 3) of the plugins there is an example for the part on the permission and the opening port bu nothing on the other function usable as read or registerReadCallback.

I tried to use read function like this :

readOnce(){
   this.serial.read()
     .then((response) => {
        console.log('response',response);
     }).catch((err) => {
       console.log('err',err);
     });
}

After use function write call function readOnce and response is each time an empty arrayBuffer whereas this should be ‘Cnx OK’.

Thank you in advance for you help.

Chris.