File tree Expand file tree Collapse file tree 4 files changed +18
-0
lines changed Expand file tree Collapse file tree 4 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,11 @@ int BLEDevice::rssi()
261261 return _rssi;
262262}
263263
264+ uint16_t BLEDevice::getMTU () const
265+ {
266+ return ATT.mtu (ATT.connectionHandle (_addressType, _address));
267+ }
268+
264269bool BLEDevice::connect ()
265270{
266271 return ATT.connect (_addressType, _address);
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ class BLEDevice {
6868 int manufacturerData (uint8_t value[], int length) const ;
6969
7070 virtual int rssi ();
71+ virtual uint16_t getMTU () const ;
7172
7273 bool connect ();
7374 bool discoverAttributes ();
Original file line number Diff line number Diff line change @@ -283,6 +283,17 @@ int BLELocalDevice::rssi()
283283 return 127 ;
284284}
285285
286+ uint16_t BLELocalDevice::getMTU ()
287+ {
288+ BLEDevice central = ATT.central ();
289+
290+ if (central) {
291+ return central.getMTU ();
292+ }
293+
294+ return -1 ;
295+ }
296+
286297bool BLELocalDevice::setAdvertisedServiceUuid (const char * advertisedServiceUuid)
287298{
288299 return _advertisingData.setAdvertisedServiceUuid (advertisedServiceUuid);
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class BLELocalDevice {
4747 virtual String address () const ;
4848
4949 virtual int rssi ();
50+ virtual uint16_t getMTU ();
5051
5152 virtual bool setAdvertisedServiceUuid (const char * advertisedServiceUuid);
5253 virtual bool setAdvertisedService (const BLEService& service);
You can’t perform that action at this time.
0 commit comments