Forum Xamarin.Forms

Get information from Bluetooth with BLE plugin

Afomin31Afomin31 Member ✭✭
edited December 2018 in Xamarin.Forms

I am using BLE plugin and try to make app to conect with Arduino using bluetooth. If I use some BLE terminal from store I get information from module. My app can find and connect to module, but I dont know how to read information from bluetooth.

Tagged:

Answers

  • JuniorJiangJuniorJiang Member, Xamarin Team Xamurai

    Hi @Afomin31 , like the link shared, if have connected to module, the next need to get Serviceand Service's Characteristics ,

    var services = await connectedDevice.GetServicesAsync();
    var characteristics = await service.GetCharacteristicsAsync();
    

    the info can be get form Characteristics like this:

    var bytes = await characteristic.ReadAsync();

    The last step , you need to deal with the bytes data. And the format of the data depends on the format in which the connected device is sent.
    There is a demo can be refered to.

  • Afomin31Afomin31 Member ✭✭
    edited December 2018

    This demo don't work for me...I think thats because I need this strange "guid". How can I get it?

  • AlbertKAlbertK MYMember ✭✭✭✭

    Can we see some code as to what you are trying to do ?

  • sisaackssisaacks Member ✭✭✭

    I am using the Plugin BLE....does anyone know how to get the phone to keep scanning when the android phone goes to sleep? All scanning seems to stop until the phone is woke back up

Sign In or Register to comment.