-
Notifications
You must be signed in to change notification settings - Fork 86
serial tryfile
Chris Petersen edited this page Oct 16, 2014
·
1 revision
serial-tryfile attempts to open the serial port with a file. It is used to read binary data saved from a serial data dump using the rawoutput plugin. Otherwise it the returned device handle behaves just like one made with (serial-try devname baudrate databits parity stopbits testproc).
Parameter | Description |
---|---|
filepath | Full path to the file to be opened |
Example 1: Connect to a binary file if fromfile flag is set, otherwise make a normal serial connection. This example derives from a plugin, in which a handshake is done over a serial connection.
((fx= runlevel 1)
(if fromfile
;; From a file, so connect to file
(let* ((filepath (instance-refvar group instance "Port" #f))
(dev (serial-tryfile filepath)))
(if dev (begin (instance-setvar! group instance "Device" dev) 2) 0))
;; Not from a file, so connect normally
(let* ((devname (instance-refvar group instance "Port" #f))
(baudrate 9600) (databits 8) (parity 0) (stopbits 1)
(dev (serial-try devname baudrate databits parity stopbits #f)))
(if dev (begin (instance-setvar! group instance "Device" dev) 2) 0))
))
-
- accelerometer
- alist
- audio
- audioaux
- base64
- btle-scan
- camera
- cdb
- cgi
- config
- csv
- curl
- digest
- dmtx
- download
- eventloop
- fcgi
- fft
- generalized-arrays
- gps
- graph
- gyro
- hidapi
- hpdf
- html
- httpsclient
- hybridapp
- json
- lmdb
- ln_core
- ln_glcore
- ln_glgui
- ln_store
- localization
- localization_gui
- localnotification
- magnetometer
- mdns
- mqtt
- mqtt-store
- multitouch
- oauth
- orientation
- p256ecdsa
- png
- portaudio
- pregexp
- pressure
- prime
- pushnotification
- redcap
- rsa
- rtaudio
- rupi
- rotation
- sanestring
- scheduler
- serial
- sets
- settings
- simplexnoise
- sqlite
- ssax
- syntax-case
- timestamp
- ttf
- uiform
- url
- uuid
- vibrate
- videoplayer
- watchdog
- website
- xml
- zip