Serial com ports rs-232 / USB HID lua modules

Plugins y todo lo relacionado para Autoplay Media Studio.
Releasing two lua modules to use serial (rs232/bluetooth/usb2serial...) and usb-hid (raw) suitable for most IoT devices like arduino, esp8266, raspberry pi... and interfacing any usb HID device such as arduino 32u, gamepads, controllers, inputs, and wide variety of HID usb devices, even with obscure protocols that can be reversed with wireshark/usbpcap.

Serial
file: serial.dll (100kb)
Source: https://gist.github.com/pabloko/e9c19f6 ... 3549cc1bb5
require('serial')
count = Serial.Enumerate()
Serial.Terminate()
name = Serial.GetPortName(id) --nil if invalid id
internal_name = Serial.GetInternalName(id) --nil if invalid id
id=Serial.FindPort(name)
Serial.Open(id, baud_rate, flow_control) -- Flow control PARITY_NONE, PARITY_EVEN, PARITY_ODD...
Serial.Close(id)
Serial.CloseAll()
written = Serial.Write(id, data) --data is a literal string
data = Serial.Read(id) --data is a literal string
data = Serial.ReadBlocking(id,timeout_ms) --data is a literal string
state = Serial.SetDtr(id, bool_state)
state = Serial.SetRts(id, bool_state)
...
HID
file: usbhid.dll (90kb)
Source: https://gist.github.com/pabloko/e9c19f6 ... 3549cc1bb5
require('usbhid')
table = HID.Enumerate(vid, pid) --use 0 for wildcard
--#table= table count, table[1]=first device... table[1].path = path of first device...
device = HID.Open(vid,pid,serial) --serial can be 0, check device not nil
device = HID.OpenPath(path) --check device not nil
written=HID.Write(device, data) --data is a literal string
data = HID.ReadTimeout(device, timeout_ms) --data is a literal string
data = HID.Read(device) --data is a literal string
err = SetNonBlocking(device, bool_state)
HID.Close(device)
...
DOWNLOAD
HIDE: ON
Hidebb Message Hidden Description
Great Job :pc:
interesante trabajo, gracias por compartirlo.
great job Pabloko as always... Thank you