Exemplo n.º 1
0
 def loadBasicTestParameters(self):
     self.verbose = False
     self.samp_rate = 830e3
     self.center_freq = 304.55e6
     self.basebandSampleRate = 100e3
     self.iqFileName = "../input_files/fan_all_dip1101_pruned_dec_c304p55M_s830k.iq"
     self.waveformFileName = ""
     self.outputHex = False
     self.timingError = 0.2
     self.showAllTx = False
     self.timeBetweenTx = 3000
     self.timeBetweenTx_samp = self.timeBetweenTx * self.basebandSampleRate / 1e6
     self.frequency = 304.48e6
     self.glitchFilterCount = 2
     self.threshold = 0.05
     
     # set up globals
     wcv.samp_rate = self.samp_rate
     wcv.basebandSampleRate = self.basebandSampleRate
     
     # load protocol
     self.protocol = fetchProtocol(3)
     
     return(0)
Exemplo n.º 2
0
 def loadBasicTestParameters(self):
     self.verbose = False
     self.samp_rate = 200e3
     self.center_freq = 434e6
     self.basebandSampleRate = 100e3
     self.iqFileName = "../input_files/weather_c434M_s200k.iq"
     self.waveformFileName = ""
     self.outputHex = False
     self.timingError = 0.2
     self.showAllTx = False
     self.timeBetweenTx = 3000
     self.timeBetweenTx_samp = self.timeBetweenTx * self.basebandSampleRate / 1e6
     self.frequency = 433.935e6
     self.glitchFilterCount = 2
     self.threshold = 0.045
     
     # set up globals
     wcv.samp_rate = self.samp_rate
     wcv.basebandSampleRate = self.basebandSampleRate
     
     # load protocol
     self.protocol = fetchProtocol(4)
     
     return(0)
Exemplo n.º 3
0
    try:
        inFile = file(inFileName, "r")
        protocolString = inFile.read()
    except:
        print "Trouble reading input text file {}, exiting...".format(
            inFileName)
        exit(1)
    protocol_lib.createProtocolFromText(protocolString)
    print "Protocol import complete."
    exit(0)

wcv.outFileName = args.output
if not args.export_protocol is None:
    wcv.protocol_number = args.export_protocol
    try:
        wcv.protocol = protocol_lib.fetchProtocol(wcv.protocol_number)
    except:
        print "Protocol {} does not exist, please supply valid protocol ID for export".format(
            wcv.protocol_number)
        exit(1)
    try:
        outFile = file(wcv.outFileName, "w")
        outFile.write(wcv.protocol.fullProtocolString())
        outFile.close()
    except:
        print "Error exporting protocol to file: {} \nPlease check if supplied file is writeable".format(
            wcv.outFileName)
        exit(1)
    print "Protocol {} exported successfully to {}".format(
        wcv.protocol_number, wcv.outFileName)
    exit(0)