Giter Club home page Giter Club logo

atlib's Introduction

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 commonly 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.

Usage

Install as NuGet package

dotnet add package HeboTech.ATLib

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

// Create and connect to serial port
SerialPort serialPort = new SerialPort(); //Use an overload to pass in your settings
serialPort.Open();

// Pipe the serial port stream through a duplex pipe
IDuplexPipe duplexPipe = StreamConnection.GetDuplex(serialPort.BaseStream); // See note below

// Pass in the pipe to the communicator and start communicating!
ICommunicator<string> comm = new Communicator(duplexPipe);

// Send a ping to the modem
var initializeResult = await comm.InitializeAsync();
// Get battery status
var batteryStatus = await comm.GetBatteryStatusAsync();
Note:
IDuplexPipe is an interface in System.IO.Pipelines.
Microsoft and ATLib doesn't come with an implementations for this, but Pipelines.Sockets.Unofficial has one that works great!
Install it with
dotnet add package Pipelines.Sockets.Unofficial

Supported commands:

โœ”๏ธ = Done ๐Ÿ”ง = In progress

V.25TER

Command Numeric Text Description Notes
ATE[n] โœ”๏ธ โœ”๏ธ
ATV[format] โœ”๏ธ โœ”๏ธ

3GPP TS 27.005

Command Numeric Text Description Notes
AT+CMGF? โœ”๏ธ โœ”๏ธ
AT+CMGF=[mode] โœ”๏ธ โœ”๏ธ
AT+CMGS=[da] ๐Ÿ”ง ๐Ÿ”ง

3GPP TS 27.007

Command Numeric Text Description Notes
AT+CBC โœ”๏ธ โœ”๏ธ
AT+CSQ โœ”๏ธ โœ”๏ธ
AT+CPIN? โœ”๏ธ โœ”๏ธ

atlib's People

Contributors

hbjorgo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.