juliansteenbakker / flutter_ble_peripheral

A Flutter package for advertising BLE data in peripheral mode
BSD 3-Clause "New" or "Revised" License
72 stars 50 forks source link

Advertise data too large but contains only one element? #162

Closed SyedKaz00 closed 8 months ago

SyedKaz00 commented 8 months ago

I am using the following advertising setting: final AdvertiseData advertiseData = AdvertiseData( serviceUuid: 'bf27730d-860a-4e09-889c-2d8b6a9e0fe7', manufacturerId: 1234, manufacturerData: Uint8List.fromList([1, 2, 3, 4, 5, 6]), serviceDataUuid: 'aaa7730d-860a-4e09-889c-2d8b6a9e0fe7', serviceData: Uint8List.fromList([1]) );

However this causes this error when I try toggle it on.

E/flutter (12587): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(1, ADVERTISE_FAILED_DATA_TOO_LARGE, startAdvertising, null) E/flutter (12587): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652:7) E/flutter (12587): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310:18) E/flutter (12587): <asynchronous suspension> E/flutter (12587): #2 FlutterBlePeripheral.start (package:flutter_ble_peripheral/src/flutter_ble_peripheral.dart:89:9) E/flutter (12587): <asynchronous suspension> E/flutter (12587): #3 FlutterBlePeripheralExampleState.build.<anonymous closure> (package:whispr_mvp/pages/bleDebug.dart:172:19) E/flutter (12587): <asynchronous suspension> E/flutter (12587):

Can i get any help as to how to increase the advertising data size?