Skip to content

Commit fcc08d9

Browse files
authored
Update RFE_Python_Example_2.py
1 parent 6cd3291 commit fcc08d9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

RFE_Python_Example_2.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#pylint: disable=too-many-branches, too-many-public-methods, too-many-locals, too-many-arguments
55

66
#============================================================================
7-
#This is an example code for RFExplorer python functionality.
8-
#Display amplitude in dBm and frequency in MHz of the maximum value of frequency range.
7+
# This is an example code for RF Explorer IoT board using Python 3.5 running on a Raspberry Pi
8+
# Display amplitude in dBm and frequency in MHz of the maximum value of frequency range.
99
#============================================================================
1010

1111
import time
@@ -65,7 +65,7 @@ def ControlSettings(objRFE):
6565
# global variables and initialization
6666
#---------------------------------------------------------
6767

68-
SERIALPORT = None #serial port data
68+
SERIALPORT = None #serial port autoselect
6969
BAUDRATE = 500000
7070

7171
objRFE = RFExplorer.RFECommunicator() #Initialize object and thread
@@ -88,22 +88,22 @@ def ControlSettings(objRFE):
8888
#Connect to available port
8989
if (objRFE.ConnectPort(SERIALPORT, BAUDRATE)):
9090
#Wait for unit to notify reset completed
91-
while(objRFE.IsResetEvent):
91+
while (objRFE.IsResetEvent):
9292
pass
9393
#Wait for unit to stabilize
9494
time.sleep(3)
9595

9696
#Request RF Explorer configuration
9797
objRFE.SendCommand_RequestConfigData()
9898
#Wait to receive configuration and model details
99-
while(objRFE.ActiveModel == RFExplorer.RFE_Common.eModel.MODEL_NONE):
99+
while (objRFE.ActiveModel == RFExplorer.RFE_Common.eModel.MODEL_NONE):
100100
objRFE.ProcessReceivedString(True) #Process the received configuration
101101

102102
#If object is an analyzer, we can scan for received sweeps
103-
if(objRFE.IsAnalyzer()):
103+
if (objRFE.IsAnalyzer()):
104104
#Control settings
105105
SpanSize, StartFreq, StopFreq = ControlSettings(objRFE)
106-
if(SpanSize and StartFreq and StopFreq):
106+
if (SpanSize and StartFreq and StopFreq):
107107
#set new frequency range
108108
objRFE.UpdateDeviceConfig(StartFreq, StopFreq)
109109

0 commit comments

Comments
 (0)