Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48980

Having issue with storing data into php mysql database with BLE bluetooth notification

$
0
0

having issue with storing data into php mysql database with BLE bluetooth notification

I have device where its sending characteristic data , but when I am trying to store that data into database , then
this.http.get is not working as I am getting every milli second data from the device, is there any solution where I can write the code to store the data in mysql using php
this is my code

onConnected(peripheral) {
this.ngZone.run(() => {
this.setStatus(’’);
this.peripheral = peripheral;

this.ble.startNotification(this.peripheral.id, "49535343-fe7d-4ae5-8fa9-9fafd205e455","49535343-1e4d-4bd9-ba61-23c647249616", ).subscribe(
      function(data){
   //console.log(data);
      // var dataa = new Uint8Array(data);
      //console.log(dataa);
      
         var convertDataa = String.fromCharCode.apply(null, new Int8Array(data[0]));
       // console.log(convertDataa);
        this.coda = convertDataa;
        //this.datastore();

     this.films = this.http.get('https://rightkode.com/heamac/data.php?s_data='+this.coda);
       this.films.subscribe(data => {
       console.log('my data: ', data);
     }),

       (error : any) =>
       { 
          console.dir(error); 
       };
      
        //console.log(this.coda + "\n");
        }, 

    function(failure){
      alert("Failed to read characteristic from device.");
    });

});

}

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>