簡體   English   中英

來自 cordova-plugin-ble-central Accu Chek Mobile 的葡萄糖測量

[英]Glucose measurement from cordova-plugin-ble-central Accu Chek Mobile

我嘗試從 cordova-plugin-ble-central 讀取葡萄糖測量值。

我發現如何獲取不同的值,如制造商或序列號。

但我無法獲得血糖測量讀數。

我這樣做

var databuffer = new Uint8Array(2);
    databuffer[0] = 0x01;
    databuffer[1] = 0x01;

console.log("startwrite");
    
    ble.write(localStorage.getItem('ACMid'), "1808", "2A52", databuffer.buffer, 
        function(data){
                
            int8data = new Uint8Array(data);            
            console.log("Hooray we have data write : " + JSON.stringify( data ));
            console.log("Hooray we have data write : " + JSON.stringify( int8data));                
        }, 
        function(failure){
            addMyContenu("Failed write from device. " + JSON.stringify(failure), 1);
            console.log("Failed write characteristic from device. " + JSON.stringify(failure));
        });

我們所有人都在奔跑:

var databuffer = new Uint8Array(2);
    databuffer[0] = 0x01;
    databuffer[1] = 0x01;
        
    console.log("startnotif");
    
    ble.startNotification(localStorage.getItem('ACMid'), "1808", "2A18", 
        function(datanotif){
            
            int8data = new Uint8Array(datanotif);
                    
        id = int8data[1] & 255;
        id |= (int8data[2] & 255) << 8;
        
        val = int8data[12];
                
        annee = int8data[3] & 255;
        annee |= (int8data[4] & 255) << 8;          
        
        mois = addZero(int8data[5]);
        jour = addZero(int8data[6]);
        
        h = addZero(int8data[7]);
        m = addZero(int8data[8]);
        s = addZero(int8data[9]);
        
        datehms = annee + "-" + mois + "-" + jour + "T" + h +":"+m+":"+s;
            console.log("Hooray we have data notif : " + JSON.stringify( int8data ));           
                
        },
        function(failure){
            addMyContenu("Failed notif from device. " + JSON.stringify(failure), 1);
            console.log("Failed notif characteristic from device. " + JSON.stringify(failure));
        });     
    
    console.log("startwrite");
    
    ble.write(localStorage.getItem('ACMid'), "1808", "2A52", databuffer.buffer, 
        function(data){
            console.log("Hooray we have data write : " + JSON.stringify( data ));               
        }, 
        function(failure){
            addMyContenu("Failed write from device. " + JSON.stringify(failure), 1);
            console.log("Failed write characteristic from device. " + JSON.stringify(failure));
        });

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM