File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22# -*- coding: utf-8 -*-
33
4- from R305 import DeleteAll
4+ from r305 import DeleteAll
55import sys
66import serial
77import time
88
99device = sys .argv [1 ] #this is the serial device (ie R305)
10- baudrate = sys , argv [2 ] #this is the baudrate for the serial communication
10+ baudrate = sys . argv [2 ] #this is the baudrate for the serial communication
1111
1212#generally serial device can be found at /dev/ttyUSBx
1313#generally the baudrate for r305 is 57600
1616ser = serial .Serial (device , baudrate ) #init serial
1717
1818command = DeleteAll .getHeader () #get the dataframe for the command
19- ser .write (bytearray (data )); #the data must be buyte a array
19+ ser .write (bytearray (command )); #the data must be buyte a array
2020time .sleep (1 ) #wait for the device to process command
2121response = ser .read (ser .inWaiting ())#read all the data that is comming from r305
2222print (DeleteAll .parse (response )) #parse the output of the command.
You can’t perform that action at this time.
0 commit comments