From 759d063c18d44c9344f3c54438fd9eb6a07e7dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henning=20Bj=C3=B8rgo?= Date: Tue, 30 Jan 2024 20:52:14 +0100 Subject: [PATCH] Feature/telit me910c1 (#37) * Add support for Telit ME910C1 * Bump version --- src/HeboTech.ATLib/HeboTech.ATLib.csproj | 8 ++-- src/HeboTech.ATLib/Modems/Telit/IME910C1.cs | 6 +++ src/HeboTech.ATLib/Modems/Telit/ME910C1.cs | 44 +++++++++++++++++++++ 3 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 src/HeboTech.ATLib/Modems/Telit/IME910C1.cs create mode 100644 src/HeboTech.ATLib/Modems/Telit/ME910C1.cs diff --git a/src/HeboTech.ATLib/HeboTech.ATLib.csproj b/src/HeboTech.ATLib/HeboTech.ATLib.csproj index f1e66ea..e0bdf07 100644 --- a/src/HeboTech.ATLib/HeboTech.ATLib.csproj +++ b/src/HeboTech.ATLib/HeboTech.ATLib.csproj @@ -4,10 +4,10 @@ netstandard2.1 HeboTech HeboTech ATLib - 7.0.0 - 7.0.0 - 7.0.0.0 - 7.0.0.0 + 7.1.0-beta1 + 7.1.0-beta1 + 7.1.0.0 + 7.1.0.0 HeboTech.ATLib AT command library that makes it easy to communicate with modems. AT command library that makes it easy to communicate with modems. diff --git a/src/HeboTech.ATLib/Modems/Telit/IME910C1.cs b/src/HeboTech.ATLib/Modems/Telit/IME910C1.cs new file mode 100644 index 0000000..a0e5bda --- /dev/null +++ b/src/HeboTech.ATLib/Modems/Telit/IME910C1.cs @@ -0,0 +1,6 @@ +namespace HeboTech.ATLib.Modems.Telit +{ + public interface IME910C1 : IModem + { + } +} diff --git a/src/HeboTech.ATLib/Modems/Telit/ME910C1.cs b/src/HeboTech.ATLib/Modems/Telit/ME910C1.cs new file mode 100644 index 0000000..5cc18ae --- /dev/null +++ b/src/HeboTech.ATLib/Modems/Telit/ME910C1.cs @@ -0,0 +1,44 @@ +using HeboTech.ATLib.CodingSchemes; +using HeboTech.ATLib.DTOs; +using HeboTech.ATLib.Modems.Generic; +using HeboTech.ATLib.Parsers; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace HeboTech.ATLib.Modems.Telit +{ + internal class ME910C1 : ModemBase, IModem, IME910C1 + { + /// + /// Telit ME910C1 chipset + /// h + public ME910C1(IAtChannel channel) + : base(channel) + { + } + + public override async Task SetRequiredSettingsBeforePinAsync() + { + ModemResponse echo = await DisableEchoAsync(); + ModemResponse errorFormat = await SetErrorFormatAsync(1); + return echo.Success && errorFormat.Success; + } + + public override async Task SetRequiredSettingsAfterPinAsync() + { + ModemResponse currentCharacterSet = await SetCharacterSetAsync(CharacterSet.UCS2); + ModemResponse smsMessageFormat = await SetSmsMessageFormatAsync(SmsTextFormat.PDU); + return currentCharacterSet.Success && smsMessageFormat.Success; + } + + public Task>> SendSmsAsync(PhoneNumber phoneNumber, string message) + { + return base.SendSmsAsync(phoneNumber, message, false); + } + + public Task>> SendSmsAsync(PhoneNumber phoneNumber, string message, CharacterSet codingScheme) + { + return base.SendSmsAsync(phoneNumber, message, codingScheme, false); + } + } +}