Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: InnomatixUpdateAPI/inc/UpdateClientAPI.h
- Revision:
- 9:0c9f1c000706
diff -r a6311d40c5a2 -r 0c9f1c000706 InnomatixUpdateAPI/inc/UpdateClientAPI.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/InnomatixUpdateAPI/inc/UpdateClientAPI.h Fri Sep 30 17:14:01 2016 +0000
@@ -0,0 +1,78 @@
+/*******************************************************************
+ *
+ * File: updateclient_api.h
+ *
+ * Description: Coprocessor Update Client public API per specification document
+ *
+ * Copyright 2015 Innomatix, LLC., All Rights Reserved
+ *
+ * THIS DOCUMENT AND ITS CONTENTS ARE INTELLECTUAL PROPERTY
+ * OF INNOMATIX, LLC. ANY DUPLICATION IN PART OR WHOLE
+ * WITHOUT PRIOR WRITTEN CONSENT IS STRICTLY PROHIBITED.
+ *
+ *******************************************************************/
+#ifndef _UPDATECLIENT_API_H
+#define _UPDATECLIENT_API_H
+
+typedef enum
+{
+ statusSuccess = 0x00,
+ statusUpdateAvailable = 0x01,
+ statusNoUpdate = 0x02,
+ statusInvalidId = 0x03,
+ statusInvalidOffset = 0x04,
+ statusInvalidLength = 0x05,
+ statusInvalidChecksum = 0x06,
+ statusNameMismatch = 0x07,
+ statusDuplicateVersion = 0x08,
+ statusAbortUpdate = 0x09,
+ statusNoConnection = 0x0a
+}UpdateStatus_e;
+
+// Use the __attribute__((unused)) to supress the "unused variable" warning
+static const char *UpdateStatusNames[] __attribute__((unused)) =
+{
+ "Success", "UpdateAvailable", "NoUpdate", "InvalidID", "InvalidOffset",
+ "InvalidLength", "InvalidChecksum", "NameMismatch", "DuplicateVersion",
+ "AbortUpdate", "NoConnection"
+};
+
+
+
+/*************************************************/
+
+
+/**
+ This function initializes the API and sets up the Update Client.
+
+ Return Values:
+ TRUE client was able to setup the network and bind to the desired port
+ FALSE an error has occurred, the client is not functional
+*********************************************************************/
+UpdateStatus_e UpdateInit( const char *address, unsigned short port );
+
+
+
+/**
+ Shutdown and clean up the Update Client
+*********************************************************************/
+void UpdateClose();
+
+
+
+/**
+ Check for a pending update, compare versions to see if it should
+ be applied, receive, validate and apply the update. Report the
+ results to the client.
+
+ Return Values:
+ TRUE - an update was performed successfully. Reboot is needed.
+ FALSE - no update was pending, a pending update duplicates the
+ current application, a pending update was unsuccessful.
+ No further action is necessary regarding the update.
+*********************************************************************/
+UpdateStatus_e PerformUpdate( int timeout_msec );
+
+
+#endif /* _UPDATECLIENT_API_H */
+