Skip to content

Commit

Permalink
Feature/telit me910c1 (#37)
Browse files Browse the repository at this point in the history
* Add support for Telit ME910C1

* Bump version
  • Loading branch information
hbjorgo authored Jan 30, 2024
1 parent 2c3c372 commit 759d063
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/HeboTech.ATLib/HeboTech.ATLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<TargetFramework>netstandard2.1</TargetFramework>
<Authors>HeboTech</Authors>
<Product>HeboTech ATLib</Product>
<Version>7.0.0</Version>
<PackageVersion>7.0.0</PackageVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<FileVersion>7.0.0.0</FileVersion>
<Version>7.1.0-beta1</Version>
<PackageVersion>7.1.0-beta1</PackageVersion>
<AssemblyVersion>7.1.0.0</AssemblyVersion>
<FileVersion>7.1.0.0</FileVersion>
<PackageId>HeboTech.ATLib</PackageId>
<Title>AT command library that makes it easy to communicate with modems.</Title>
<Description>AT command library that makes it easy to communicate with modems.</Description>
Expand Down
6 changes: 6 additions & 0 deletions src/HeboTech.ATLib/Modems/Telit/IME910C1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace HeboTech.ATLib.Modems.Telit
{
public interface IME910C1 : IModem
{
}
}
44 changes: 44 additions & 0 deletions src/HeboTech.ATLib/Modems/Telit/ME910C1.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// Telit ME910C1 chipset
/// </summary>h
public ME910C1(IAtChannel channel)
: base(channel)
{
}

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

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

public Task<IEnumerable<ModemResponse<SmsReference>>> SendSmsAsync(PhoneNumber phoneNumber, string message)
{
return base.SendSmsAsync(phoneNumber, message, false);
}

public Task<IEnumerable<ModemResponse<SmsReference>>> SendSmsAsync(PhoneNumber phoneNumber, string message, CharacterSet codingScheme)
{
return base.SendSmsAsync(phoneNumber, message, codingScheme, false);
}
}
}

0 comments on commit 759d063

Please sign in to comment.