mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-03 21:20:31 -05:00 
			
		
		
		
	HackRF plugin: initialize hackrf library before trying to enumerate
This commit is contained in:
		
							parent
							
								
									c483bb815d
								
							
						
					
					
						commit
						1ba3324844
					
				@ -54,22 +54,18 @@ void HackRFPlugin::initPlugin(PluginAPI* pluginAPI)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
PluginInterface::SampleSourceDevices HackRFPlugin::enumSampleSources()
 | 
					PluginInterface::SampleSourceDevices HackRFPlugin::enumSampleSources()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	SampleSourceDevices result;
 | 
						hackrf_error rc = (hackrf_error) hackrf_init();
 | 
				
			||||||
	hackrf_device_list_t *hackrf_devices = hackrf_device_list();
 | 
					 | 
				
			||||||
	hackrf_device *hackrf_ptr;
 | 
					 | 
				
			||||||
	read_partid_serialno_t read_partid_serialno;
 | 
					 | 
				
			||||||
	hackrf_error rc;
 | 
					 | 
				
			||||||
	int i;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	rc = (hackrf_error) hackrf_init();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (rc != HACKRF_SUCCESS)
 | 
						if (rc != HACKRF_SUCCESS)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		qCritical("HackRFPlugin::SampleSourceDevices: failed to initiate HackRF library: %s", hackrf_error_name(rc));
 | 
							qCritical("HackRFPlugin::SampleSourceDevices: failed to initiate HackRF library: %s", hackrf_error_name(rc));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						SampleSourceDevices result;
 | 
				
			||||||
 | 
						hackrf_device_list_t *hackrf_devices = hackrf_device_list();
 | 
				
			||||||
 | 
						hackrf_device *hackrf_ptr;
 | 
				
			||||||
 | 
						read_partid_serialno_t read_partid_serialno;
 | 
				
			||||||
 | 
						int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (i=0; i < hackrf_devices->devicecount; i++)
 | 
						for (i=0; i < hackrf_devices->devicecount; i++)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user