On September 25, 2015 12:16:15 PM CDT, Ivan Solis <ivansolispadilla@xxxxxxxxx>
wrote:
Hi,
I am using luars232 library which works fine on standard lua. When
using
luajit I get this error calling about any function:
bad argument #1 to 'set_baud_rate' (luars232 expected, got userdata)
I have checked the mail list, faq, etc and haven't found an answer.
This is the lua code:
err, static_port = rs232.open("COM1")
assert(err == rs232.RS232_ERR_NOERROR, "Couldn't open serial port:
COM1\n")
static_port.set_baud_rate(static_port, baud)
Looking at the library, they call luaL_checkudata to validate the first
function parameter:
struct rs232_port_t *p = (struct rs232_port_t*) luaL_checkudata(L, 1,
"luars232");
So, what changed in luajit for the luaL_checkudata function? Is there
an
easy way around it?
I'm happy to try and fix it, if a fix is needed and I get some
**pointers**.
Regards!
Ivan