Ejemplo n.º 1
0
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

from serial_grabber.reader import TransactionExtractor
from serial_grabber.reader.SerialReader import SerialReader
from serial_grabber.connections import TcpServer
from serial_grabber.processor import LoggingProcessor

# Serial Settings
hostname = "127.0.0.1"
port = 8099

# Settings
cache_collision_avoidance_delay = 1
processor_sleep = 1
watchdog_sleep = 1

reader_error_sleep = 1

drop_carriage_return = True

transaction = TransactionExtractor("default", "BEGIN DATA", "END DATA")

tcp = TcpServer(hostname, port)

reader = SerialReader(transaction, 1000, tcp)

processor = LoggingProcessor()
Ejemplo n.º 2
0
from serial_grabber.reader.FileReader import FileReader
from serial_grabber.reader.SerialReader import SerialReader
from serial_grabber.processor.UploadProcessor import UploadProcessor

#Serial Settings
timeout = 1
port = "/dev/ttyUSB0"
baud = 57600
parity = serial.PARITY_NONE
stop_bits = 1

#Settings
cache_collision_avoidance_delay = 1
processor_sleep = 1
watchdog_sleep = 1

reader_error_sleep = 1

drop_carriage_return = True

transaction = TransactionExtractor("default", "BEGIN DATA", "END DATA")

reader = SerialReader(transaction,
                      1000,
                      port,
                      baud,
                      timeout=timeout,
                      parity=parity,
                      stop_bits=stop_bits)

processor = UploadProcessor("https://example.org/cgi-bin/upload.py")