pothosware / SoapyBladeRF

Soapy SDR plugin for the Blade RF
https://github.com/pothosware/SoapyBladeRF/wiki
23 stars 20 forks source link

Support device loading and programming #13

Closed karel closed 6 years ago

karel commented 6 years ago

How should the functions in libbladeRF: Device loading and programming be made available from SoapyBladeRF? Especially interested in the device reset functionality.

guruofquality commented 6 years ago

Theres never been a formal SoapySDR API for that because so many devices do it differently. Automatically on load, command line apps, and obviously APIs -- which in this case is great.

I recommend overloading the writeSettings(key, value) call to implement something like

#for example in python it could look like this
device.writeSettings('RESET', 'true');
device.writeSettings('FIRMWARE', open(fw_file).read());
karel commented 6 years ago

Apparently the firmware files are not well suited to be represented as strings, getting some encoding errors etc. I currently only need the reset function so I am skipping the others.

guruofquality commented 6 years ago

I may have wrongly assumed that the firmware functions took file contents, but given that the parameter is char *, they probably just take the file path, so device.writeSettings('FIRMWARE', open(fw_file).read()); is really device.writeSettings('FIRMWARE', fw_file); FWIW