ti员工,sensortagAPP源程序中接受和显示信号强度(RSSI)的程序段,能不能给我发下?
gaoyang9992006:
https://github.com/mikaelkindborg/evo-demos/blob/master/Demos2014/TISensorTag/ti-sensortag.js
应该在这个文件里。
-____________________________________________________________________________-
/*** Public. Connect to the closest physical SensorTag device.*/instance.connectToClosestDevice = function(){instance.statusFun('Scanning...')instance.disconnectDevice()easyble.stopScan()easyble.reportDeviceOnce(false)var stopScanTime = Date.now() + 2000var closestDevice = nullvar strongestRSSI = -1000easyble.startScan(function(device){// Connect if we have found a sensor tag.if (sensortag.deviceIsSensorTag(device)&& device.rssi != 127 // Invalid RSSI value){if (device.rssi > strongestRSSI){closestDevice = devicestrongestRSSI = device.rssi}if (Date.now() >= stopScanTime){instance.statusFun('SensorTag found')easyble.stopScan()instance.device = closestDeviceinstance.connectToDevice()}}},function(errorCode){instance.errorFun('Scan failed')})return instance}
Susan Yang:
源码可以在 http://www.ti.com/ww/en/wireless_connectivity/sensortag2015/tearDown.html 下载