Code: Select all
int main() {
bladerf *dev_master;
bladerf *dev_slave;
//struct bladerf *dev = NULL
int status;
status = bladerf_open(&dev_master, "*:instance=0");
if (status != 0) {
std::cout << "Failed to open bladeRF device MASTER: " << std::endl;
return 1;
}
status = bladerf_open(&dev_slave, "*:instance=1");
if (status != 0) {
std::cout << "Failed to open bladeRF device SLAVE: " << std::endl;
return 1;
}
status = bladerf_set_smb_mode(dev_master,BLADERF_SMB_MODE_OUTPUT);
if (status != 0) {
std::cout << "Failed to set SMB CLKOUT in MASTER: " << std::endl;
std::cout<<status<<std::endl;
return 1;
}
status = bladerf_set_smb_mode(dev_slave,BLADERF_SMB_MODE_INPUT);
if (status != 0) {
std::cout << "Failed to set SMB CLKIN in SLAVE: " << std::endl;
std::cout<<status<<std::endl;
return 1;
}
std::cout<<"cofiguring master"<<std::endl;
configure_bladerf_master(dev_master); //MASTER will transmit and receive
std::cout<<"cofiguring slave"<<std::endl;
configure_bladerf_slave(dev_slave); // SLAVE is receive only