diff --git a/CMakeLists.txt b/CMakeLists.txt index f61faa9ef42f028a15cebc80ff83a567702e3178..e25cc1f80ad09ce916eb10b2e7c256fa2931cb7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,8 +16,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) # library version definition set(VERSION_MAJOR "2") -set(VERSION_MINOR "0") -set(VERSION_RELEASE "3") +set(VERSION_MINOR "1") +set(VERSION_RELEASE "0") set(VERSION_STR "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}") # pass macros to preprocessor @@ -37,6 +37,9 @@ add_library( ${LIB_NAME} SHARED o3000_private.h o3000_xfer_handler.c o3000_xfer_handler.h + o3000_upgrade.c + md5_helper.c + md5.c ) set_target_properties ( ${LIB_NAME} PROPERTIES diff --git a/ChangeLog b/ChangeLog index 0884cb095285f8cdb6feb4f6373f1dbaebf2ebf6..48318629338af5ca39260490cab5a642a380460d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ - ChangeLog O-3000 Host Driver ------------------------------------------------------------------------------- +Version 2.1.0 SP + 2020-05-19 + * Added firmware update function. + Version 2.0.3 2019-09-25 SP * Added "paranoia check" for wraparound_chunk_size check in handle_transfer(). diff --git a/md5.c b/md5.c new file mode 100644 index 0000000000000000000000000000000000000000..8cef19e232451f0168c8fbf3a7dbacad440212c8 --- /dev/null +++ b/md5.c @@ -0,0 +1,276 @@ +/* + ********************************************************************** + ** md5.c ** + ** RSA Data Security, Inc. MD5 Message Digest Algorithm ** + ** Created: 2/17/90 RLR ** + ** Revised: 1/91 SRD,AJ,BSK,JT Reference C Version ** + ********************************************************************** + */ + +/* + ********************************************************************** + ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** + ** ** + ** License to copy and use this software is granted provided that ** + ** it is identified as the "RSA Data Security, Inc. MD5 Message ** + ** Digest Algorithm" in all material mentioning or referencing this ** + ** software or this function. ** + ** ** + ** License is also granted to make and use derivative works ** + ** provided that such works are identified as "derived from the RSA ** + ** Data Security, Inc. MD5 Message Digest Algorithm" in all ** + ** material mentioning or referencing the derived work. ** + ** ** + ** RSA Data Security, Inc. makes no representations concerning ** + ** either the merchantability of this software or the suitability ** + ** of this software for any particular purpose. It is provided "as ** + ** is" without express or implied warranty of any kind. ** + ** ** + ** These notices must be retained in any copies of any part of this ** + ** documentation and/or software. ** + ********************************************************************** + */ + +/* -- include the following line if the md5.h header file is separate -- */ +#include "md5.h" + +/* forward declaration */ +static void Transform (); + +static unsigned char PADDING[64] = { + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +/* F, G and H are basic MD5 functions: selection, majority, parity */ +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define I(x, y, z) ((y) ^ ((x) | (~z))) + +/* ROTATE_LEFT rotates x left n bits */ +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) + +/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */ +/* Rotation is separate from addition to prevent recomputation */ +#define FF(a, b, c, d, x, s, ac) \ + {(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define GG(a, b, c, d, x, s, ac) \ + {(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define HH(a, b, c, d, x, s, ac) \ + {(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define II(a, b, c, d, x, s, ac) \ + {(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } + +void MD5Init (mdContext) +MD5_CTX *mdContext; +{ + mdContext->i[0] = mdContext->i[1] = (UINT4)0; + + /* Load magic initialization constants. + */ + mdContext->buf[0] = (UINT4)0x67452301; + mdContext->buf[1] = (UINT4)0xefcdab89; + mdContext->buf[2] = (UINT4)0x98badcfe; + mdContext->buf[3] = (UINT4)0x10325476; +} + +void MD5Update (mdContext, inBuf, inLen) +MD5_CTX *mdContext; +unsigned char *inBuf; +unsigned int inLen; +{ + UINT4 in[16]; + int mdi; + unsigned int i, ii; + + /* compute number of bytes mod 64 */ + mdi = (int)((mdContext->i[0] >> 3) & 0x3F); + + /* update number of bits */ + if ((mdContext->i[0] + ((UINT4)inLen << 3)) < mdContext->i[0]) + mdContext->i[1]++; + mdContext->i[0] += ((UINT4)inLen << 3); + mdContext->i[1] += ((UINT4)inLen >> 29); + + while (inLen--) { + /* add new character to buffer, increment mdi */ + mdContext->in[mdi++] = *inBuf++; + + /* transform if necessary */ + if (mdi == 0x40) { + for (i = 0, ii = 0; i < 16; i++, ii += 4) + in[i] = (((UINT4)mdContext->in[ii+3]) << 24) | + (((UINT4)mdContext->in[ii+2]) << 16) | + (((UINT4)mdContext->in[ii+1]) << 8) | + ((UINT4)mdContext->in[ii]); + Transform (mdContext->buf, in); + mdi = 0; + } + } +} + +void MD5Final (mdContext) +MD5_CTX *mdContext; +{ + UINT4 in[16]; + int mdi; + unsigned int i, ii; + unsigned int padLen; + + /* save number of bits */ + in[14] = mdContext->i[0]; + in[15] = mdContext->i[1]; + + /* compute number of bytes mod 64 */ + mdi = (int)((mdContext->i[0] >> 3) & 0x3F); + + /* pad out to 56 mod 64 */ + padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); + MD5Update (mdContext, PADDING, padLen); + + /* append length in bits and transform */ + for (i = 0, ii = 0; i < 14; i++, ii += 4) + in[i] = (((UINT4)mdContext->in[ii+3]) << 24) | + (((UINT4)mdContext->in[ii+2]) << 16) | + (((UINT4)mdContext->in[ii+1]) << 8) | + ((UINT4)mdContext->in[ii]); + Transform (mdContext->buf, in); + + /* store buffer in digest */ + for (i = 0, ii = 0; i < 4; i++, ii += 4) { + mdContext->digest[ii] = (unsigned char)(mdContext->buf[i] & 0xFF); + mdContext->digest[ii+1] = + (unsigned char)((mdContext->buf[i] >> 8) & 0xFF); + mdContext->digest[ii+2] = + (unsigned char)((mdContext->buf[i] >> 16) & 0xFF); + mdContext->digest[ii+3] = + (unsigned char)((mdContext->buf[i] >> 24) & 0xFF); + } +} + +/* Basic MD5 step. Transform buf based on in. + */ +static void Transform (buf, in) +UINT4 *buf; +UINT4 *in; +{ + UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; + + /* Round 1 */ +#define S11 7 +#define S12 12 +#define S13 17 +#define S14 22 + FF ( a, b, c, d, in[ 0], S11, 3614090360U); /* 1 */ + FF ( d, a, b, c, in[ 1], S12, 3905402710U); /* 2 */ + FF ( c, d, a, b, in[ 2], S13, 606105819U); /* 3 */ + FF ( b, c, d, a, in[ 3], S14, 3250441966U); /* 4 */ + FF ( a, b, c, d, in[ 4], S11, 4118548399U); /* 5 */ + FF ( d, a, b, c, in[ 5], S12, 1200080426U); /* 6 */ + FF ( c, d, a, b, in[ 6], S13, 2821735955U); /* 7 */ + FF ( b, c, d, a, in[ 7], S14, 4249261313U); /* 8 */ + FF ( a, b, c, d, in[ 8], S11, 1770035416U); /* 9 */ + FF ( d, a, b, c, in[ 9], S12, 2336552879U); /* 10 */ + FF ( c, d, a, b, in[10], S13, 4294925233U); /* 11 */ + FF ( b, c, d, a, in[11], S14, 2304563134U); /* 12 */ + FF ( a, b, c, d, in[12], S11, 1804603682U); /* 13 */ + FF ( d, a, b, c, in[13], S12, 4254626195U); /* 14 */ + FF ( c, d, a, b, in[14], S13, 2792965006U); /* 15 */ + FF ( b, c, d, a, in[15], S14, 1236535329U); /* 16 */ + + /* Round 2 */ +#define S21 5 +#define S22 9 +#define S23 14 +#define S24 20 + GG ( a, b, c, d, in[ 1], S21, 4129170786U); /* 17 */ + GG ( d, a, b, c, in[ 6], S22, 3225465664U); /* 18 */ + GG ( c, d, a, b, in[11], S23, 643717713U); /* 19 */ + GG ( b, c, d, a, in[ 0], S24, 3921069994U); /* 20 */ + GG ( a, b, c, d, in[ 5], S21, 3593408605U); /* 21 */ + GG ( d, a, b, c, in[10], S22, 38016083U); /* 22 */ + GG ( c, d, a, b, in[15], S23, 3634488961U); /* 23 */ + GG ( b, c, d, a, in[ 4], S24, 3889429448U); /* 24 */ + GG ( a, b, c, d, in[ 9], S21, 568446438U); /* 25 */ + GG ( d, a, b, c, in[14], S22, 3275163606U); /* 26 */ + GG ( c, d, a, b, in[ 3], S23, 4107603335U); /* 27 */ + GG ( b, c, d, a, in[ 8], S24, 1163531501U); /* 28 */ + GG ( a, b, c, d, in[13], S21, 2850285829U); /* 29 */ + GG ( d, a, b, c, in[ 2], S22, 4243563512U); /* 30 */ + GG ( c, d, a, b, in[ 7], S23, 1735328473U); /* 31 */ + GG ( b, c, d, a, in[12], S24, 2368359562U); /* 32 */ + + /* Round 3 */ +#define S31 4 +#define S32 11 +#define S33 16 +#define S34 23 + HH ( a, b, c, d, in[ 5], S31, 4294588738U); /* 33 */ + HH ( d, a, b, c, in[ 8], S32, 2272392833U); /* 34 */ + HH ( c, d, a, b, in[11], S33, 1839030562U); /* 35 */ + HH ( b, c, d, a, in[14], S34, 4259657740U); /* 36 */ + HH ( a, b, c, d, in[ 1], S31, 2763975236U); /* 37 */ + HH ( d, a, b, c, in[ 4], S32, 1272893353U); /* 38 */ + HH ( c, d, a, b, in[ 7], S33, 4139469664U); /* 39 */ + HH ( b, c, d, a, in[10], S34, 3200236656U); /* 40 */ + HH ( a, b, c, d, in[13], S31, 681279174U); /* 41 */ + HH ( d, a, b, c, in[ 0], S32, 3936430074U); /* 42 */ + HH ( c, d, a, b, in[ 3], S33, 3572445317U); /* 43 */ + HH ( b, c, d, a, in[ 6], S34, 76029189U); /* 44 */ + HH ( a, b, c, d, in[ 9], S31, 3654602809U); /* 45 */ + HH ( d, a, b, c, in[12], S32, 3873151461U); /* 46 */ + HH ( c, d, a, b, in[15], S33, 530742520U); /* 47 */ + HH ( b, c, d, a, in[ 2], S34, 3299628645U); /* 48 */ + + /* Round 4 */ +#define S41 6 +#define S42 10 +#define S43 15 +#define S44 21 + II ( a, b, c, d, in[ 0], S41, 4096336452U); /* 49 */ + II ( d, a, b, c, in[ 7], S42, 1126891415U); /* 50 */ + II ( c, d, a, b, in[14], S43, 2878612391U); /* 51 */ + II ( b, c, d, a, in[ 5], S44, 4237533241U); /* 52 */ + II ( a, b, c, d, in[12], S41, 1700485571U); /* 53 */ + II ( d, a, b, c, in[ 3], S42, 2399980690U); /* 54 */ + II ( c, d, a, b, in[10], S43, 4293915773U); /* 55 */ + II ( b, c, d, a, in[ 1], S44, 2240044497U); /* 56 */ + II ( a, b, c, d, in[ 8], S41, 1873313359U); /* 57 */ + II ( d, a, b, c, in[15], S42, 4264355552U); /* 58 */ + II ( c, d, a, b, in[ 6], S43, 2734768916U); /* 59 */ + II ( b, c, d, a, in[13], S44, 1309151649U); /* 60 */ + II ( a, b, c, d, in[ 4], S41, 4149444226U); /* 61 */ + II ( d, a, b, c, in[11], S42, 3174756917U); /* 62 */ + II ( c, d, a, b, in[ 2], S43, 718787259U); /* 63 */ + II ( b, c, d, a, in[ 9], S44, 3951481745U); /* 64 */ + + buf[0] += a; + buf[1] += b; + buf[2] += c; + buf[3] += d; +} + +/* + ********************************************************************** + ** End of md5.c ** + ******************************* (cut) ******************************** + */ diff --git a/md5.h b/md5.h new file mode 100644 index 0000000000000000000000000000000000000000..1a642c158769f2aaad66dc65bd3ff1836f565ad0 --- /dev/null +++ b/md5.h @@ -0,0 +1,65 @@ +/* + ********************************************************************** + ** md5.h -- Header file for implementation of MD5 ** + ** RSA Data Security, Inc. MD5 Message Digest Algorithm ** + ** Created: 2/17/90 RLR ** + ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** + ** Revised (for MD5): RLR 4/27/91 ** + ** -- G modified to have y&~z instead of y&z ** + ** -- FF, GG, HH modified to add in last register done ** + ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** + ** -- distinct additive constant for each step ** + ** -- round 4 added, working mod 7 ** + ********************************************************************** + */ + +/* + ********************************************************************** + ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** + ** ** + ** License to copy and use this software is granted provided that ** + ** it is identified as the "RSA Data Security, Inc. MD5 Message ** + ** Digest Algorithm" in all material mentioning or referencing this ** + ** software or this function. ** + ** ** + ** License is also granted to make and use derivative works ** + ** provided that such works are identified as "derived from the RSA ** + ** Data Security, Inc. MD5 Message Digest Algorithm" in all ** + ** material mentioning or referencing the derived work. ** + ** ** + ** RSA Data Security, Inc. makes no representations concerning ** + ** either the merchantability of this software or the suitability ** + ** of this software for any particular purpose. It is provided "as ** + ** is" without express or implied warranty of any kind. ** + ** ** + ** These notices must be retained in any copies of any part of this ** + ** documentation and/or software. ** + ********************************************************************** + */ + +#ifndef __MD5_H__ +#define __MD5_H__ + +/* typedef a 32 bit type */ +// typedef unsigned long int UINT4; +typedef unsigned int UINT4; + +/* Data structure for MD5 (Message Digest) computation */ +typedef struct { + UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ + UINT4 buf[4]; /* scratch buffer */ + unsigned char in[64]; /* input buffer */ + unsigned char digest[16]; /* actual digest after MD5Final call */ +} MD5_CTX; + +void MD5Init (); +void MD5Update (); +void MD5Final (); + +/* + ********************************************************************** + ** End of md5.h ** + ******************************* (cut) ******************************** + */ + +#endif // __MD5_H__ diff --git a/md5_helper.c b/md5_helper.c new file mode 100644 index 0000000000000000000000000000000000000000..895ea3c283af3982e0eaeb0cc91f207d2dbacca3 --- /dev/null +++ b/md5_helper.c @@ -0,0 +1,54 @@ +/** +* @file md5_helper.c +* @brief MD5 checksum generation. +* @author Patrick Roth - roth@stettbacher.ch +* @date 2010-04-30 +* @copyright 2010 Stettbacher Signal Processing AG +* +* @remarks +* +*
+* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*+* +*/ + +#include
+* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*+* +*/ + +#ifndef __MD5_HELPER_H +#define __MD5_HELPER_H + +void getMd5ChecksumString(void *addr, ssize_t size, char *buf); + +#endif /* __MD5_HELPER_H */ diff --git a/o3000.c b/o3000.c index dd99f97c26271df731b379680074e8dbdbf751fe..f53bce218af1cd4669e0cf0298e29a434ea24b56 100644 --- a/o3000.c +++ b/o3000.c @@ -240,6 +240,7 @@ or a transfer may contain several frames. #include "o3000_private.h" #include "o3000.h" #include "o3000_xfer_handler.h" +#include "o3000_upgrade.h" #define CAM_IN_EP (1 | LIBUSB_ENDPOINT_IN) ///< endpoint for video data @@ -867,6 +868,79 @@ int __stdcall o3000_send_xml(int id, const char *msg, int msg_len) { return (send_xml(session, msg, msg_len)); } +/** + * Get the number of open sessions. + * + * @return number of open sessions + */ +static int get_num_open_sessions(void) { + int i, num_sessions = 0; + + for(i = 0; i < MAX_NUM_SESSION; i++) { + if(session_table[i] != NULL) { + num_sessions ++; + } + } + return num_sessions; +} + +/** + * Do firmware upgrade of connected camera device. + * + * Make sure, that all O-3000 sessions are closed before calling this + * function. Further, only one camera must be connected to the host system. + * Otherwise the update process will fail. + * + * @param data pointer to firmware update data binary + * @param data_len firmware update data lenght in bytes + * @return 0 on success, error code on failure defined at @ref o3000.h. + */ +int __stdcall o3000_firmware_upgrade(unsigned char *data, int data_len) { + + int ret , num_sessions, num_cam; + + // paranoia checks + if(data == NULL) { + printf("%s: Firmware binary not defined!\n", __func__); + return O3000_ERROR_NOT_VALID_ARGUMENT; + } + if(data_len <= 0) { + printf("%s: Invalid firmware binary length of %d bytes!\n", __func__, data_len); + return O3000_ERROR_NOT_VALID_ARGUMENT; + } + + // checking whether all camera sessions are closed + num_sessions = get_num_open_sessions(); + if (num_sessions > 0) { + printf("%s: There're still %d camera session(s) opened. Close all session to perform firmware upgrade.\n", __func__, num_sessions); + return O3000_ERROR_SESSION_STILL_OPEN; + } + + // checking whether only one camera is connected to the system + num_cam = o3000_get_num_cam(); + if(num_cam < 0) { + // forward error + printf("%s: Getting number of connected cameras failed with error code %d\n", __func__, num_cam); + return num_cam; + } + if(num_cam == 0) { + // no camera connected to the system + printf("%s: No camera connected to the host system.\n", __func__); + return O3000_ERROR_NODEV; + } + if(num_cam > 1) { + printf("%s: %d cameras connected to the host system. Make sure only one camera is connected.\n", __func__, num_cam); + return O3000_ERROR_OTHER; + } + + // At this point only one camera is connected and all sessions are closed. Perform upgrade now. + ret = firmware_upgrade(data, data_len); + if(ret != 0) { + printf("%s: Firmware upgrade failed with error code %d.\n", __func__, ret); + } + return ret; +} + /** * Disconnect a currently claimed USB connection. @@ -892,7 +966,7 @@ int __stdcall o3000_disconnect(int id) { o3000_log(session, O3000_LOG_WARNING, "%s: driver is not connected!\n", __func__); return O3000_ERROR_DRV_NOT_CONNECTED; } - + o3000_log(session, O3000_LOG_DEBUG, "%s: disconnect USB device (release interface)\n", __func__); session->cleanup_transfers = TRUE; session->disconnect_dev = TRUE; @@ -906,6 +980,7 @@ int __stdcall o3000_disconnect(int id) { else if(retval != 0) { o3000_log(session, O3000_LOG_ERROR, "%s: releasing interface failed (code %d)\n", __func__, retval); } + return retval; } @@ -1033,7 +1108,7 @@ int __stdcall o3000_connect(int id, int device_nr, char *config_msg, int config_ o3000_log(session, O3000_LOG_ERROR, "%s: sending configuration string failed (code %d)\n", __func__, ret); } } - + /* * Finally enter main-loop */ diff --git a/o3000.h b/o3000.h index 51c8c3b8b4ba35e50f5d2dad876c402a83825b99..17aa6a5585b414eb4d1796d3a4fe8e53841c7c76 100644 --- a/o3000.h +++ b/o3000.h @@ -53,6 +53,10 @@ #define O3000_ERROR_USB_TRANSFER_TIMEOUT -10 ///< USB transfer timeout #define O3000_ERROR_USB_EP_HALTED -11 ///< USB endpoint halted #define O3000_ERROR_LESS_DATA -12 ///< USB received less data than expected +#define O3000_ERROR_NOT_VALID_ARGUMENT -13 ///< at least one function argument is not valid +#define O3000_ERROR_SESSION_STILL_OPEN -14 ///< there is at least one session still open +#define O3000_ERROR_BOOTLOADER_TIMEOUT -15 ///< camera could not start in bootloader mode in given time +#define O3000_ERROR_USB_INIT_FAILURE -16 ///< failed to initialize the usb #define O3000_ERROR_OTHER -1000 ///< other (unspecified) error @@ -88,6 +92,7 @@ int __stdcall o3000_disconnect(int id); int __stdcall o3000_send_xml(int id, const char *msg, int msg_len); +int __stdcall o3000_firmware_upgrade(unsigned char *data, int data_len); #if defined(__cplusplus) || defined(c_plusplus) } // extern "C" diff --git a/o3000_upgrade.c b/o3000_upgrade.c new file mode 100644 index 0000000000000000000000000000000000000000..9e461e8dde366fda5584c22c2a113d6bd2550367 --- /dev/null +++ b/o3000_upgrade.c @@ -0,0 +1,495 @@ +/** +* @file o3000_upgrade.c +* @brief O-3000 firmware upgrade +* @author Patrick Roth - roth@stettbacher.ch +* @author Patrick Brunner - brunner@stettbacher.ch +* @author Sophia Papagiannaki - papagiannaki@stettbacher.ch +* @version 0.1 +* @date 2020-05-12 +* @copyright 2020 Stettbacher Signal Processing AG +* +* @remarks +* +*
+* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*+* +*/ + +#include
+* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*+* +*/ +#ifndef __O3000_UPGRADE_H +#define __O3000_UPGRADE_H + +int firmware_upgrade(unsigned char *data, int data_len); + +#endif