interactive control LimeApiCmd
control limeApiCmd.exe via python uses subprocess , popen
import subprocess
from subprocess import Popen, PIPE
cmd = ['d:\\tools\\LimeApiCmd\\LimeApiCmd.exe']
p = Popen(cmd, text=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
print(p.poll()) None
p.stdout.readline()
..
.
p.stdout.readline() '\tfreq = 1575.419998 MHz \t gain = 20 dB\n'
p.stdout.readline() 'cmd_ok\n'
p.stdin.write('getchiptemperature(0)\n') 22
p.stdin.flush()
>>> p.stdout.readline() '\t32.7333\n'
>>> p.stdout.readline() 'cmd_ok\n'
- LimeProc(cmdPath) constructor
- alive() return True/False
- close() return True
- query(cmd,twait) return Tuple (True/False, res0, res1, ...)
- instId return deviceID
"""Tests init lime """
limecmd = ['d:\\tools\\LimeApiCmd\\LimeApiCmd.exe']
lime = LimeProc(limecmd)
print(lime.instId)
print(lime.query('getchiptemperature(0)'))
print(lime.query('getsamplerate(tx,0)'))
lime.close()
output
(base) ..\limeApiCtrl>python lime_test1.py
LimeSDR-Mini serial 1D4C38442B51E1
1D4C38442B51E1
(True, '43.2476')
(True, '15.36 MHz', '15.36 MHz')