-
Hello Shiny.NET Team, i find your library for .NET MAUI really great and it is working fine so far. But i have aproblem with the MTU size. I have looked at the code and it seems so that the MTU size can not be changed at the moment. Is it planned to implement this feature? Thank you in advance for your answers. Best regards, Markus |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
It really isn't a team... it's just me :) MTU is now baked in with the connection request since it only applies to android, ios negotiates this upon connection for you. To request MTU on android After discovering your peripheral IPeripheral p;
#if ANDROID
peripheral.Connect(new AndroidConnectionConfig(
RequestedMtu = 250
));
#endif as seen here: |
Beta Was this translation helpful? Give feedback.
-
Hello Alan, thank you for the information. I have another question. Best regards, Markus |
Beta Was this translation helpful? Give feedback.
-
@mwswt, the |
Beta Was this translation helpful? Give feedback.
-
I am having an issue related to this and hope it is ok if I jump into this discussion to ask about it. I have an app that I am upgrading from Xamarin to MAUI. I started a new MAUI project and am porting over the code. I have done this a few times now with success. I have 2 different BLE devices that I am working with between 2 different apps. I know that TryRequestMtu is only provided on Android because iOS auto negotiates it. What is weird is the following observations:
The device that shows the MTU I am asking for (129) on both is based on the Nordic chip. The device that used to show 129 on iOS and now shows 20 on iOS is based on the esp32. EDIT: I forgot to mention that I am currently using the latest 3.3.3 version of all Shiny nuget packages and net8.0. Thoughts? |
Beta Was this translation helpful? Give feedback.
There is a better extension you can use called TryMtuRequest(this IPerihperal peripheral, int mtu) that you can use. If MTU requests are available, it will do it otherwise it will move on. It will also return the actual negotiated value which often isn't the value you request.