h2zero / NimBLE-Arduino

A fork of the NimBLE library structured for compilation with Arduino, for use with ESP32, nRF5x.
https://h2zero.github.io/NimBLE-Arduino/
Apache License 2.0
700 stars 145 forks source link

Hello, when I send fixed-length data (lenght: 273), Bluetooth will disconnect #605

Closed hzhh110 closed 10 months ago

hzhh110 commented 10 months ago

Hello, when I send a fixed length of data (lenght: 273), the Bluetooth will disconnect, and the data longer and shorter than it will not disconnect.

hzhh110 commented 10 months ago

str= @"123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123"; allData = [str dataUsingEncoding:NSUTF8StringEncoding];

[self.currentPeripheral writeValue:allData forCharacteristic:self.writeCharacteristic type:CBCharacteristicWriteWithResponse];

hzhh110 commented 10 months ago

272-275 Length will be, and in the official BLE normal communication, but the official BLE is too much memory

hzhh110 commented 10 months ago

D NimBLEServer: >> handleGapEvent: I NimBLEServer: subscribe event; attr_handle=8, subscribed: false D NimBLEServer: >> handleGapEvent: I NimBLEServer: subscribe event; attr_handle=12, subscribed: false I NimBLECharacteristic: New subscribe value for conn: 0 val: 0 D NimBLEServer: >> handleGapEvent: CRIT NimBLEServer: Disconnect - host reset, rc=12 CRIT NimBLEDevice: Resetting state; reason=12, onDisconnect D NimBLEAdvertising: >> Advertising start: customAdvData: 0, customScanResponseData: 0 E NimBLEAdvertising: Host reset, wait for sync.

hzhh110 commented 10 months ago

mtu related, the original library has done compatibility, ha ha, did not find