Not able to read data from ZenMeasure temperature sensor to android device

ChiragModiChiragModi USMember
edited March 2016 in Xamarin.Android

Hi team,

We have downloaded "com.mmc.mmc.1.02" apk file for android device and it is working fine with “ZenMeasure BLE temperature sensor”. However, we want to develop same application in Xamarin Android with C# but we are not able to read the data. Even we are not able to connect to sensor with the code. Is there any service that we need to expose to connect with the sensor and read the data?

We have tried connecting the sensor with Xamarin android application in following way

Device : Moto G (1st Gen ) running android 5.1.
Android library : “Android.Bluetooth”
Method Used : BluetoothSocket.Connect()

UUIDs used :

  • With this Library classes we succeeded in exploring the paired Bluetooth device including the “ZenMeasure” sensor. But we were not able to connect and read data from this sensor.
  • Problem faced : Getting “Socket Connection time out error” while connecting to sensor using UUID.

Is there any android library exposed for android application.?

Posts

  • JimBennettJimBennett GBXamarin Team, Insider, University, Developer Group Leader ✭✭✭✭

    Try using BLE code - (lifted from a comment on another thread)

    ```
    public class MyScanCallback : ScanCallback
    {
    public override void OnScanResult(ScanCallbackType callbackType, ScanResult result)
    {
    if (result.Device.Name == "MyDevice")
    // bond then scan for Gatt services
    }
    }

    ...
    var bluetoothManager = (BluetoothManager)GetSystemService(BluetoothService);
    var scanCallback = new MyScanCallback();
    bluetoothManager.Adapter.BluetoothLeScanner.StartScan(_scanCallback);
    ``

Sign In or Register to comment.