aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSophia Papagiannaki <papagiannaki@stettbacher.ch>2020-05-12 11:09:42 +0200
committerSophia Papagiannaki <papagiannaki@stettbacher.ch>2020-05-12 11:09:42 +0200
commitc1847bdd4facbd48359690d584accc65fbc13ab8 (patch)
tree2a19c3161f206b4d284224a0f47b3d836e8c9656
parentdistinguish between 32 or 64 bit compiler version (diff)
downloado3000-driver-c1847bdd4facbd48359690d584accc65fbc13ab8.tar.gz
o3000-driver-c1847bdd4facbd48359690d584accc65fbc13ab8.zip
added firmware upgrade function
Diffstat (limited to '')
-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"