GithubHelp home page GithubHelp logo

killerjulian / serialport-gsm-typescript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zabsalahid/serialport-gsm

2.0 2.0 4.0 421 KB

Library for the communication with GSM modems like sending and receiving SMS messages

Home Page: https://killerjulian.github.io/serialport-gsm-typescript

License: MIT License

JavaScript 1.61% TypeScript 96.38% CSS 2.01%
gsm serial typescript serialport-gsm

serialport-gsm-typescript's Introduction

Node SerialPort-GSM

SerialPort-GSM - A library for the communication with GSM modems like sending and receiving SMS messages.

NPM

Install

npm i serialport-gsm

Usage

Usage in JavaScript/TypeScript (with ES Modules):

import { Modem, SerialPortCommunicator } from 'serialport-gsm';

// Initialize a SerialPortCommunicator. For more options take a look at the full documentaion
const serialPortCommunicator = new SerialPortCommunicator('COM4');

// Initalization of the modem. For more options take a look at the full documentaion
const myModem = new Modem(serialPortCommunicator);

// You can listen to different events
myModem.on('onWriteToModem', (data) => console.log('>:', data.replace(/\n|\r/g, '')));
myModem.on('onDataReceived', (data) => console.log('<:', data.replace(/\n|\r/g, '')));

// Do whatever you want
async function start() {
  await myModem.open();

  console.log('.checkModem()', await myModem.checkModem());
  console.log('.getSignalInfo()', await myModem.getSignalInfo());
  console.log('.getRegisteredNetwork()', await myModem.getRegisteredNetwork());
  console.log('.getAvailableNetworks()', await myModem.getAvailableNetworks());
  console.log('.checkSimMemory()', await myModem.checkSimMemory());
  console.log('.getProductSerialNumber()', await myModem.getProductSerialNumber());
  console.log('.getOwnNumber()', await myModem.getOwnNumber());
  console.log('.getSimInbox()', await myModem.getSimInbox());
  console.log('.sendSms()', await myModem.sendSms('+XXXXXXXXX', 'Hello, Zap here!'));

  await myModem.close();
}

start();

You can find more information in the full documentation.


❤️ Contributors

Our thanks go to these wonderful people who have contributed to this project:

Contributors

Made with contrib.rocks.

🤝 Contributing

Contributions, issues and feature requests are welcome! Feel you free to check issues page or create a pull request. We are happy about collaboration on this project.

serialport-gsm-typescript's People

Stargazers

 avatar  avatar

Watchers

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