int bladerf_get_frequency(struct bladerf *dev, bladerf_module module, unsigned int *frequency) { struct lms_freq f; int rv = 0; rv = lms_get_frequency( dev, module, &f ); if (rv != 0) { return rv; } if( f.x == 0 ) { *frequency = 0 ; rv = BLADERF_ERR_INVAL; } else { *frequency = lms_frequency_to_hz(&f); } return rv; }
int tuning_get_freq(struct bladerf *dev, bladerf_module module, unsigned int *frequency) { bladerf_xb attached; bladerf_xb200_path path; struct lms_freq f; int rv = 0; rv = lms_get_frequency( dev, module, &f ); if (rv != 0) { return rv; } if( f.x == 0 ) { /* If we see this, it's most often an indication that communication * with the LMS6002D is not occuring correctly */ *frequency = 0 ; rv = BLADERF_ERR_IO; } else { *frequency = lms_frequency_to_hz(&f); } if (rv != 0) { return rv; } rv = xb_get_attached(dev, &attached); if (rv != 0) { return rv; } if (attached == BLADERF_XB_200) { rv = xb200_get_path(dev, module, &path); if (rv != 0) { return rv; } if (path == BLADERF_XB200_MIX) { *frequency = 1248000000 - *frequency; } } return rv; }
int tuning_get_freq(struct bladerf *dev, bladerf_module module, unsigned int *frequency) { bladerf_xb attached; bladerf_xb200_path path; struct lms_freq f; int rv = 0; rv = lms_get_frequency( dev, module, &f ); if (rv != 0) { return rv; } if( f.x == 0 ) { *frequency = 0 ; rv = BLADERF_ERR_INVAL; } else { *frequency = lms_frequency_to_hz(&f); } if (rv != 0) { return rv; } rv = xb_get_attached(dev, &attached); if (rv != 0) { return rv; } if (attached == BLADERF_XB_200) { rv = xb200_get_path(dev, module, &path); if (rv != 0) { return rv; } if (path == BLADERF_XB200_MIX) { *frequency = 1248000000 - *frequency; } } return rv; }