HeboTech.ATLib 0.0.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package HeboTech.ATLib --version 0.0.7                
NuGet\Install-Package HeboTech.ATLib -Version 0.0.7                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HeboTech.ATLib" Version="0.0.7" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HeboTech.ATLib --version 0.0.7                
#r "nuget: HeboTech.ATLib, 0.0.7"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install HeboTech.ATLib as a Cake Addin
#addin nuget:?package=HeboTech.ATLib&version=0.0.7

// Install HeboTech.ATLib as a Cake Tool
#tool nuget:?package=HeboTech.ATLib&version=0.0.7                

ATLib

Continuous Integration NuGet Version

ATLib is a C# AT command library that abstracts away the commands and makes it easy to communicate with modems.

Hayes command set (commonly known as AT commands) is a command set frequently used in modems. Read more about it at Wikipedia.

ATLib is just in the beginning. Currently only a few commands are implemented, but more will come.

Supported commands:

  • Send SMS
  • Answer incoming call
  • Hang up call
  • Get SIM status
  • Enter SIM PIN
  • Get remaining PIN & PUK attempts
  • Get product information
  • Get battery status
  • Get signal strength
  • Disable echo

Supported modems:

  • SIMCOM SIM5320
  • Adafruit FONA 3G
  • Other modems may work using one of the implementations above

Usage

Install as NuGet package

dotnet add package HeboTech.ATLib

Using a serial port to communicate with a modem is easy:

// Set up serial port
using (SerialPort serialPort = new SerialPort(args[0], 9600, Parity.None, 8, StopBits.One))
{
  // Open serial port
  serialPort.Open();
  
  // Create a new communicator based on the serial port
  ICommunicator comm = new SerialPortCommunicator(serialPort);

  // Create a new AT channel based on the communicator
  AtChannel atChannel = new AtChannel(comm);

  // Create the modem
  AdafruitFona3G modem = new AdafruitFona3G(atChannel);

  // The library doesn't support echo, so turn it off
  modem.DisableEcho();

  // Get SIM status
  var simStatus = modem.GetSimStatus();
  Console.WriteLine($"SIM Status: {simStatus}");
  
  // Send SMS to the specified number
  var smsReference = modem.SendSMS(new PhoneNumber("0123456789"), "Hello ATLib!");
  Console.WriteLine($"SMS Reference: {smsReference}");
}

For more examples, check out the TestConsole project in the code.

Feedback is welcome 😃

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.0-alpha1 105 5/23/2024
7.1.0-beta2 131 1/30/2024
7.1.0-beta1 89 1/30/2024
7.0.0 528 1/3/2024
7.0.0-RC3 176 11/19/2023
7.0.0-RC2 120 11/6/2023
7.0.0-RC1 98 11/2/2023
6.0.2 342 7/15/2023
6.0.1 184 6/4/2023
6.0.0 192 5/7/2023
5.0.0 225 4/14/2023
4.2.0 1,155 9/18/2022
4.1.0 597 4/17/2022
4.0.0 453 4/17/2022
3.1.0 529 7/13/2021
3.0.0 415 6/30/2021
2.0.1 488 4/24/2021
2.0.0 363 4/10/2021
1.0.0 380 4/1/2021
0.0.8 506 1/17/2021
0.0.7 516 9/2/2020