React native IOS – issue with bluetooth transmission on newer iphones


I’m developing ios react-native application which support bluetooth. I use it to send some commands via react-native-ble-manager to external reader. Then reader draw something on screen based on sent data. So far I tested it with Iphone 6, IOS 14 and everything worked flawless. Unfortunately it is not a case for Iphone XR IOS 17.1.1. When it is simple short data it works alright but when it is more complex command then data sent from Iphone XR then reader image is distorted. Why?

My code for handling write:

doTransmitSequence(peripheral, commandSequence) {
    this.setState({ transferring: true });

    BleManager.retrieveServices(peripheral.id).then(() => {
      const service="xxxx-xxxx-xxxx-xxxx-xxxx";
      const characteristic="xxxx-xxxx-xxxx-xxxx-xxxx";

      for (let i = 0; i < commandSequence.length; i++) {
        BleManager.write(peripheral.id, service, characteristic, commandSequence[i], 247)
          .then(() => {
            this.setState({ transferring: false });
          })
          .catch(function (error) {
            this.setState({ transferring: false });
            console.log('There has been a problem with your write operation: ' + error);
          });
      }
    });
  } 

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img