Skip to content
forked from srdgame/librs232

multiplatform library for serial communications over RS-232 (serial port)

License

Notifications You must be signed in to change notification settings

moteus/librs232

 
 

Repository files navigation

librs232

Multiplatform library for serial communications over RS-232 (serial port)

Build Status Build status

Changes from the original version

  • Windows. Use overlapped IO model.
  • Windows. Support detect break/parity error.
  • Windows. Implement rs232_in_queue_clear.
  • Windows. Fix using static variables to support multithreading.
  • Windows. rs232_read wait at least one byte (like in POSIX version).
  • Basic tests on Travis/Appveyor.
  • Lua. Export rs232_in_queue_clear / rs232_in_queue functions.
  • Lua. Add more Lua way module.

Lua binding

local rs232 = require "rs232"

local p, e = rs232.port('COM1',{
  baud         = '_9600';
  data_bits    = '_8';
  parity       = 'NONE';
  stop_bits    = '_1';
  flow_control = 'OFF';
  rts          = 'ON';
})

p:open()
print(p:write('AT\r\n'))
print(p:read(64, 5000))
p:close()

About

multiplatform library for serial communications over RS-232 (serial port)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 54.1%
  • Lua 37.7%
  • Shell 2.8%
  • C++ 2.5%
  • Batchfile 1.9%
  • Makefile 1.0%