Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,371 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
var mobileBroadbandAccounts = MobileBroadbandAccount.AvailableNetworkAccountIds;
LogInfo($"mobileBroadbandAccounts.Count {mobileBroadbandAccounts.Count}");
if (mobileBroadbandAccounts.Count > 0)
{
var mobileBroadbandAccount = MobileBroadbandAccount.CreateFromNetworkAccountId(mobileBroadbandAccounts[0]);
LogInfo($" NetworkAccountId : {mobileBroadbandAccount.NetworkAccountId}");
var mobileBroadbandNetwork = mobileBroadbandAccount.CurrentNetwork;
LogInfo($"AccessPointName {mobileBroadbandNetwork.AccessPointName}");
LogInfo($"RegisteredProviderId {mobileBroadbandNetwork.RegisteredProviderId}");
MobileBroadbandCellsInfo mobileBroadbandCellsInfo = null;
bool voiceSupport =true;
Task.Run(async () =>
{
mobileBroadbandCellsInfo = await mobileBroadbandNetwork.GetCellsInfoAsync();
voiceSupport = await mobileBroadbandNetwork.GetVoiceCallSupportAsync();
})
.ContinueWith(t =>
{
if (null == mobileBroadbandCellsInfo)
{
LogInfo($"mobileBroadbandCellsInfo is null " );
return;
}
var servingCellsLte = mobileBroadbandCellsInfo.NeighboringCellsLte;
foreach (var cell in servingCellsLte)
{
LogInfo("power dbm " + cell.ReferenceSignalReceivedPowerInDBm);
LogInfo("quality dbm " + cell.ReferenceSignalReceivedQualityInDBm);
LogInfo(cell.ToString());
}
}, TaskScheduler.FromCurrentSynchronizationContext());
}
mobileBroadbandNetwork.GetCellsInfoAsync() always return null