+ Semaphore unit_info_done;
+
+ public void notify_unit_info(AltosUnitInfo unit_info) {
+ unit_info_done.release();
+ }
+
+ private void fetch_radio_cal() {
+ unit_info_done = new Semaphore(0);
+ AltosUnitInfo info = new AltosUnitInfo(serial_number, this);
+
+ /* Block waiting for the rf calibration data */
+ radio_calibration_broken = true;
+ try {
+ unit_info_done.acquire();
+ int new_cal = info.rfcal();
+ if (new_cal != AltosLib.MISSING) {
+ radio_calibration = new_cal;
+ radio_calibration_broken = false;
+ }
+ } catch (InterruptedException ie) {
+ }
+ }
+