EasyManuals Logo

Embedded Systems LM5p-GSMC User Manual

Default Icon
291 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #254 background imageLoading...
Page #254 background image
254
Functions
Include library before calling serial functions:
require('serial')
Opens given port, returns: port handle, or, in case of error, nil plus error message
port, err = serial.open(device, params)
Parameters:
device port device name, required
params parameters table, optional, (defaults are in bold):
o baudrate 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200,
230400
o parity "none", "even", "odd"
o databits 5, 6, 7, 8
o stopbits 1, 2
o duplex "full", "half" (Note: "half" is required for RS-485)
Reads the specified number of bytes, execution is blocked until read is complete
res, err = port:read(bytes)
Parameters:
bytes number of bytes to read
Reads until timeout occurs or the specified number of bytes is received, whichever happens
first.
Returns data plus number of bytes read, or, in case of error, nil plus error message.
res, err = port:read(bytes, timeout)
Parameters:
bytes number of bytes to read
timeout maximum time to wait for read to complete, minimum value and timer
resolution is 0.1 seconds
Flushes any read/unsent bytes
port:flush()
Closes serial port, no other port functions may be called afterwards
port:close()

Table of Contents

Other manuals for Embedded Systems LM5p-GSMC

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Embedded Systems LM5p-GSMC and is the answer not in the manual?

Embedded Systems LM5p-GSMC Specifications

General IconGeneral
BrandEmbedded Systems
ModelLM5p-GSMC
CategoryDimmer
LanguageEnglish

Related product manuals