3

I'm new with Flutter and am just trying to make this work.

Am using Flutter Blue https://pub.dartlang.org/packages/flutter_blue

It connects though, just this issue when writing.

But when writing i'm receiving this message. Not sure what I am doing wrong though.

here's my code..

onPressed: () {
                  print("HEY write pressed");
                  var fff1 = new Guid("0000fff1-0000-1000-8000-00805f9b34fb");
                  var fffa = new Guid("0000fffa-0000-1000-8000-00805f9b34fb");
                  BluetoothCharacteristic characteristic = new BluetoothCharacteristic(uuid: fffa, serviceUuid: fff1, descriptors: null, properties: null);
                  _writeCharacteristic(characteristic);
               },

PlatformException(locateCharacteristic, service could not be located on the device, null)

I've tried following this post. Flutter Blue Read characteristic UUID

In production I would probably save the UUID as variables, but the effect should be similar..

If anyone has any guidance or tips that would be super welcome.

1 Answer 1

1

Your code is right but the device you want to connect to doesnt contain this service :var fff1 = new Guid("0000fff1-0000-1000-8000-00805f9b34fb");

Check which services exist in the device you want to connect to.

Sign up to request clarification or add additional context in comments.

1 Comment

No it is not a reason. flutter_blue has not the best exception handling. I have same problem with service taken from device, its weird because when i got chars with id f.e. 0x0 one second later my app tells that there is no this char on device.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.