HeboTech.ATLib 0.0.7

An extensible async AT command library.

Install-Package HeboTech.ATLib -Version 0.0.7
dotnet add package HeboTech.ATLib --version 0.0.7
<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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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 :)

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 :)

Release Notes

See https://github.com/hbjorgo/ATLib/releases/tag/0.0.7

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.0.7 97 9/2/2020