aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--o3000.c27
-rw-r--r--o3000.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/o3000.c b/o3000.c
index dd99f97..c68baf7 100644
--- a/o3000.c
+++ b/o3000.c
@@ -869,6 +869,33 @@ int __stdcall o3000_send_xml(int id, const char *msg, int msg_len) {
/**
+ * Do firmware update of the device
+ *
+ * @param data pointer to firmware update data
+ * @param data_len update package lenght in bytes
+ * @return 0 on success, -1 on failure
+ */
+int __stdcall o3000_firmware_update(unsigned char *data, int data_len) {
+
+ int ret;
+
+ // paranoia checks
+ if(data == NULL) {
+ return -1;
+ }
+
+
+ if(data_len <= 0) {
+ return -1;
+ }
+
+ // checking whether all connection are closed
+ ret = firmware_update(data, data_len);
+ return ret;
+}
+
+
+/**
* Disconnect a currently claimed USB connection.
* Use this function if the driver is connected to an USB device. The o3000_connect() function-call is blocking now.
* After disconnecting, the function o3000_connect() returns. The session is not cleaned-up due to the driver is ready the reconnect
diff --git a/o3000.h b/o3000.h
index 51c8c3b..2ec4d07 100644
--- a/o3000.h
+++ b/o3000.h
@@ -88,6 +88,7 @@ int __stdcall o3000_disconnect(int id);
int __stdcall o3000_send_xml(int id, const char *msg, int msg_len);
+int __stdcall o3000_firmware_update(unsigned char *data, int data_len);
#if defined(__cplusplus) || defined(c_plusplus)
} // extern "C"