diff options
author | Sophia Papagiannaki <papagiannaki@stettbacher.ch> | 2020-05-12 11:09:42 +0200 |
---|---|---|
committer | Sophia Papagiannaki <papagiannaki@stettbacher.ch> | 2020-05-12 11:09:42 +0200 |
commit | c1847bdd4facbd48359690d584accc65fbc13ab8 (patch) | |
tree | 2a19c3161f206b4d284224a0f47b3d836e8c9656 | |
parent | distinguish between 32 or 64 bit compiler version (diff) | |
download | o3000-driver-c1847bdd4facbd48359690d584accc65fbc13ab8.tar.gz o3000-driver-c1847bdd4facbd48359690d584accc65fbc13ab8.zip |
added firmware upgrade function
-rw-r--r-- | o3000.c | 27 | ||||
-rw-r--r-- | o3000.h | 1 |
2 files changed, 28 insertions, 0 deletions
@@ -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 @@ -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"
|