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
1111import 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
6969BAUDRATE = 500000
7070
7171objRFE = 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