File tree 4 files changed +18
-0
lines changed
4 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,11 @@ int BLEDevice::rssi()
261
261
return _rssi;
262
262
}
263
263
264
+ uint16_t BLEDevice::getMTU () const
265
+ {
266
+ return ATT.mtu (ATT.connectionHandle (_addressType, _address));
267
+ }
268
+
264
269
bool BLEDevice::connect ()
265
270
{
266
271
return ATT.connect (_addressType, _address);
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ class BLEDevice {
68
68
int manufacturerData (uint8_t value[], int length) const ;
69
69
70
70
virtual int rssi ();
71
+ virtual uint16_t getMTU () const ;
71
72
72
73
bool connect ();
73
74
bool discoverAttributes ();
Original file line number Diff line number Diff line change @@ -283,6 +283,17 @@ int BLELocalDevice::rssi()
283
283
return 127 ;
284
284
}
285
285
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
+
286
297
bool BLELocalDevice::setAdvertisedServiceUuid (const char * advertisedServiceUuid)
287
298
{
288
299
return _advertisingData.setAdvertisedServiceUuid (advertisedServiceUuid);
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class BLELocalDevice {
47
47
virtual String address () const ;
48
48
49
49
virtual int rssi ();
50
+ virtual uint16_t getMTU ();
50
51
51
52
virtual bool setAdvertisedServiceUuid (const char * advertisedServiceUuid);
52
53
virtual bool setAdvertisedService (const BLEService& service);
You can’t perform that action at this time.
0 commit comments