title: Send data using react-native-ble-plx package
body: <p>In order to realize a project of connected objects. I need to implement a Bluetooth connection between the various devices. </p>
  
  <p>Here, the goal is to create an application in React Native and then send data from this application to my Raspberry. This Raspberry has a connected HC-08 module that takes care of Bluetooth communication. </p>
  
  <p>Now, I would like to use react-native-ble-plx library to send data through Bluetooth. I'm able to connect my Android to the module. But I don't understand how to send data ...</p>
  
  <p>Here's my code :</p>
  
  <pre><code>constructor() {
          super()
          this.manager = new BleManager()
      }
      componentWillMount() {
          console.log("mounted")
          const subscription = this.manager.onStateChange((state) =&gt; {
              if (state === 'PoweredOn') {
                  this.scanAndConnect();
                  subscription.remove();
              }
          }, true);
      }
  
      scanAndConnect() {
          this.manager.startDeviceScan(null, null, (error, device) =&gt; {
              if (error) {
                  // Handle error (scanning will be stopped automatically)
                  return
              }
  
              console.log(device.name)
  
              // Check if it is a device you are looking for based on advertisement data
              // or other criteria.
              if (device.name === 'SH-HC-08') {
                  // Stop scanning as it's not necessary if you are scanning for one device.
                  this.manager.stopDeviceScan();
                  console.log(`Found ${device.name}`)
                  this.setState({
                      device: device
                  })
                  // Proceed with connection.
                  device.connect()
                      .then((device) =&gt; {
                          console.log(device)
                          return device.discoverAllServicesAndCharacteristics()
                      })
                      .then((device) =&gt; {
                          console.log(device)
                      })
                      .then((result) =&gt; {
                          // Do work on device with services and characteristics
                          //console.log(this.manager.characteristicsForService("00001800-0000-1000-8000-00805f9b34fb"))
                          console.log(result)
                          console.log("connected")
                      })
                      .catch((error) =&gt; {
                          // Handle errors
                          console.log(error)
                      });
              }
          });
      }
  
      send() {
          this.manager.writeCharacteristicWithResponseForDevice("58:7A:62:4F:EF:6D",
              this.device.serviceUUIDs[0],
              this.manager.characteristicsForDevice(this.device.id),
              "ok")
              .catch((error) =&gt; {
                  console.log('error in writing data');
                  console.log(error);
              })
      }
  </code></pre>
  
  <p>I would like to have a send method that will send data whenever I want to. But I don't really understand how it works :/ </p>
  
  <p>Could someone help me or even give me an example ? I would be really appreciated. </p>
  
  <p>Best regards.</p>