- bishandle = bis.newmaster(app, devicename_or_handle [, speed])
- bishandle = bis.newslave(app, devicename_or_handle [, speed])
- bishandle = bis.newpeer(app, devicename_or_handle [, speed])
- bishandle:close()
SYNOPSIS
DESCRIPTION
Create a new BiS event handler. The handler is attached to the event processor passed in app.
There are three possibilities to create a BiS link. See the introductory document for a discussion.
If a string is passed as second parameter devicename_or_handle, this must be the device name of a serial port, the optional speed parameter selects the port speed, which defaults to 115200bps.
Passing a file handle as second parameter allows using an already open handle, for example a network connection. When the file handle is a serial port, it is automatically configured for BiS (8N1), including the optional speed parameter. When no speed is given, the port speed is not changed.
The bis:close() will close the handle when no longer needed. The BiS handle becomes invalid. This automatically happens during garbage collection, but that takes an unknown amount of time. A serial port is closed only if it was opened by the BiS code.