diff --git a/radio.c b/radio.c index cef88a0..104bb31 100644 --- a/radio.c +++ b/radio.c @@ -158,10 +158,10 @@ void radio_download(radio_device_t* dev) // // Write firmware image to the device. // -void radio_upload(int cont_flag) +void radio_upload(radio_device_t* dev, int cont_flag) { // Check for compatibility. - if (! device->is_compatible(device)) { + if (! dev->is_compatible(dev)) { fprintf(stderr, "Incompatible image - cannot upload.\n"); exit(-1); } @@ -170,7 +170,7 @@ void radio_upload(int cont_flag) fprintf(stderr, "Write device: "); fflush(stderr); } - device->upload(device, cont_flag); + dev->upload(dev, cont_flag); if (! trace_flag) fprintf(stderr, " done.\n"); diff --git a/radio.h b/radio.h index d63223f..71eeb33 100644 --- a/radio.h +++ b/radio.h @@ -45,7 +45,7 @@ void radio_disconnect(void); // // Write firmware image to the device. // -void radio_upload(int cont_flag); +//void radio_upload(int cont_flag); // // Print a generic information about the device. diff --git a/src/radio.rs b/src/radio.rs index 66b17cf..0377d76 100644 --- a/src/radio.rs +++ b/src/radio.rs @@ -9,7 +9,7 @@ extern { fn radio_connect() -> *const RadioDeviceT; fn radio_disconnect(); fn radio_download(device: *const RadioDeviceT); - fn radio_upload(cont_flag: c_int); + fn radio_upload(device: *const RadioDeviceT, cont_flag: c_int); fn radio_list_c(); fn radio_verify_config(); fn radio_print_version(device: *const RadioDeviceT, stdout: *const libc::FILE); @@ -38,9 +38,9 @@ pub fn download(device: *const RadioDeviceT) { } } -pub fn upload(_device: *const RadioDeviceT, cont_flag: c_int) { +pub fn upload(device: *const RadioDeviceT, cont_flag: c_int) { unsafe { - radio_upload(cont_flag) + radio_upload(device, cont_flag) } }