Added repeat message

This commit is contained in:
nzkarit 2017-09-10 20:55:34 +12:00
parent c8e625f608
commit 552a7862a0

View File

@ -68,6 +68,9 @@ if __name__ == "__main__":
logger.info('Starting ADSB Encoder') logger.info('Starting ADSB Encoder')
logger.debug('The arguments: %s' % (arguments)) logger.debug('The arguments: %s' % (arguments))
logger.info('Repeating the message %s times' % (arguments.repeats))
SamplesFile = open('tmp.iq8s', 'wb')
for i in range(0, arguments.repeats):
modes = ModeS() modes = ModeS()
(df17_even, df17_odd) = modes.df17_pos_rep_encode(arguments.capability, arguments.icao, arguments.typecode, arguments.surveillancestatus, arguments.nicsupplementb, arguments.altitude, arguments.time, arguments.latitude, arguments.longitude, arguments.surface) (df17_even, df17_odd) = modes.df17_pos_rep_encode(arguments.capability, arguments.icao, arguments.typecode, arguments.surveillancestatus, arguments.nicsupplementb, arguments.altitude, arguments.time, arguments.latitude, arguments.longitude, arguments.surface)
@ -77,9 +80,10 @@ if __name__ == "__main__":
hackrf = HackRF() hackrf = HackRF()
samples_array = hackrf.hackrf_raw_IQ_format(df17_array) samples_array = hackrf.hackrf_raw_IQ_format(df17_array)
SamplesFile = open('tmp.iq8s', 'wb')
SamplesFile.write(samples_array) SamplesFile.write(samples_array)
SamplesFile.close() SamplesFile.close()
os.system('sync')
os.system("dd if=tmp.iq8s of=%s bs=4k seek=63" % (arguments.outputfilename)) # TODO redirect output to /dev/null os.system("dd if=tmp.iq8s of=%s bs=4k seek=63" % (arguments.outputfilename)) # TODO redirect output to /dev/null
os.system('sync') os.system('sync')
os.system('rm tmp.iq8s') os.system('rm tmp.iq8s')