Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigureAwait #57

Merged
merged 4 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/HeboTech.ATLib.Modems/Adafruit/Fona3G.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ public Fona3G(IAtChannel channel)

public override async Task<bool> SetRequiredSettingsBeforePinAsync()
{
ModemResponse echo = await DisableEchoAsync();
ModemResponse errorFormat = await SetErrorFormatAsync(1);
ModemResponse echo = await DisableEchoAsync().ConfigureAwait(false);
ModemResponse errorFormat = await SetErrorFormatAsync(1).ConfigureAwait(false);
return echo.Success && errorFormat.Success;
}

public override async Task<bool> SetRequiredSettingsAfterPinAsync()
{
ModemResponse currentCharacterSet = await SetCharacterSetAsync(CharacterSet.UCS2);
ModemResponse smsMessageFormat = await SetSmsMessageFormatAsync(SmsTextFormat.PDU);
ModemResponse currentCharacterSet = await SetCharacterSetAsync(CharacterSet.UCS2).ConfigureAwait(false);
ModemResponse smsMessageFormat = await SetSmsMessageFormatAsync(SmsTextFormat.PDU).ConfigureAwait(false);
return currentCharacterSet.Success && smsMessageFormat.Success;
}

Expand All @@ -37,7 +37,7 @@ public override async Task<bool> SetRequiredSettingsAfterPinAsync()
// switch (smsTextFormat)
// {
// case SmsTextFormat.PDU:
// AtResponse pduResponse = await channel.SendMultilineCommand($"AT+CMGR={index}", null);
// AtResponse pduResponse = await channel.SendMultilineCommand($"AT+CMGR={index}", null).ConfigureAwait(false);

// if (pduResponse.Success)
// {
Expand All @@ -60,7 +60,7 @@ public override async Task<bool> SetRequiredSettingsAfterPinAsync()
// }
// break;
// case SmsTextFormat.Text:
// AtResponse textResponse = await channel.SendMultilineCommand($"AT+CMGR={index}", null);
// AtResponse textResponse = await channel.SendMultilineCommand($"AT+CMGR={index}", null).ConfigureAwait(false);

// if (textResponse.Success && textResponse.Intermediates.Count > 0)
// {
Expand Down Expand Up @@ -114,7 +114,7 @@ public override async Task<bool> SetRequiredSettingsAfterPinAsync()
// _ => throw new Exception("Unknown SMS Text Format")
// };

// AtResponse response = await channel.SendMultilineCommand(command, null);
// AtResponse response = await channel.SendMultilineCommand(command, null).ConfigureAwait(false);

// List<SmsWithIndex> smss = new List<SmsWithIndex>();
// if (response.Success)
Expand Down
8 changes: 4 additions & 4 deletions src/HeboTech.ATLib.Modems/Cinterion/MC55i.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public override async Task<IEnumerable<ModemResponse<SmsReference>>> SendSmsAsyn
{
string cmd1 = $"AT+CMGS={(pdu.Length - 2) / 2}"; // Subtract 2 (one octet) for SMSC.
string cmd2 = pdu;
AtResponse response = await channel.SendSmsAsync(cmd1, cmd2, "+CMGS:", TimeSpan.FromSeconds(30));
AtResponse response = await channel.SendSmsAsync(cmd1, cmd2, "+CMGS:", TimeSpan.FromSeconds(30)).ConfigureAwait(false);

if (response.Success)
{
Expand All @@ -59,7 +59,7 @@ public override async Task<IEnumerable<ModemResponse<SmsReference>>> SendSmsAsyn

public override async Task<ModemResponse<BatteryStatus>> GetBatteryStatusAsync()
{
AtResponse response = await channel.SendSingleLineCommandAsync("AT^SBC?", "^SBC:");
AtResponse response = await channel.SendSingleLineCommandAsync("AT^SBC?", "^SBC:").ConfigureAwait(false);

if (response.Success)
{
Expand All @@ -79,7 +79,7 @@ public override async Task<ModemResponse<BatteryStatus>> GetBatteryStatusAsync()

public async Task<ModemResponse<MC55iBatteryStatus>> MC55i_GetBatteryStatusAsync()
{
AtResponse response = await channel.SendSingleLineCommandAsync("AT^SBC?", "^SBC:");
AtResponse response = await channel.SendSingleLineCommandAsync("AT^SBC?", "^SBC:").ConfigureAwait(false);

if (response.Success)
{
Expand Down Expand Up @@ -109,7 +109,7 @@ public async Task<ModemResponse<MC55iBatteryStatus>> MC55i_GetBatteryStatusAsync
/// <returns>Command status</returns>
public override async Task<ModemResponse> SetNewSmsIndicationAsync(int mode, int mt, int bm, int ds, int bfr)
{
AtResponse response = await channel.SendCommand($"AT+CNMI={mode},{mt},{bm},{ds}");
AtResponse response = await channel.SendCommand($"AT+CNMI={mode},{mt},{bm},{ds}").ConfigureAwait(false);

if (response.Success)
return ModemResponse.IsSuccess();
Expand Down
Loading
Loading