Innomatix Support / InnomatixSupport
Committer:
Innomatix
Date:
Fri Sep 30 17:14:01 2016 +0000
Revision:
9:0c9f1c000706
Publish Innomatix Support Library v1.0.5

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Innomatix 9:0c9f1c000706 1 /*******************************************************************
Innomatix 9:0c9f1c000706 2 *
Innomatix 9:0c9f1c000706 3 * File: updateclient_api.h
Innomatix 9:0c9f1c000706 4 *
Innomatix 9:0c9f1c000706 5 * Description: Coprocessor Update Client public API per specification document
Innomatix 9:0c9f1c000706 6 *
Innomatix 9:0c9f1c000706 7 * Copyright 2015 Innomatix, LLC., All Rights Reserved
Innomatix 9:0c9f1c000706 8 *
Innomatix 9:0c9f1c000706 9 * THIS DOCUMENT AND ITS CONTENTS ARE INTELLECTUAL PROPERTY
Innomatix 9:0c9f1c000706 10 * OF INNOMATIX, LLC. ANY DUPLICATION IN PART OR WHOLE
Innomatix 9:0c9f1c000706 11 * WITHOUT PRIOR WRITTEN CONSENT IS STRICTLY PROHIBITED.
Innomatix 9:0c9f1c000706 12 *
Innomatix 9:0c9f1c000706 13 *******************************************************************/
Innomatix 9:0c9f1c000706 14 #ifndef _UPDATECLIENT_API_H
Innomatix 9:0c9f1c000706 15 #define _UPDATECLIENT_API_H
Innomatix 9:0c9f1c000706 16
Innomatix 9:0c9f1c000706 17 typedef enum
Innomatix 9:0c9f1c000706 18 {
Innomatix 9:0c9f1c000706 19 statusSuccess = 0x00,
Innomatix 9:0c9f1c000706 20 statusUpdateAvailable = 0x01,
Innomatix 9:0c9f1c000706 21 statusNoUpdate = 0x02,
Innomatix 9:0c9f1c000706 22 statusInvalidId = 0x03,
Innomatix 9:0c9f1c000706 23 statusInvalidOffset = 0x04,
Innomatix 9:0c9f1c000706 24 statusInvalidLength = 0x05,
Innomatix 9:0c9f1c000706 25 statusInvalidChecksum = 0x06,
Innomatix 9:0c9f1c000706 26 statusNameMismatch = 0x07,
Innomatix 9:0c9f1c000706 27 statusDuplicateVersion = 0x08,
Innomatix 9:0c9f1c000706 28 statusAbortUpdate = 0x09,
Innomatix 9:0c9f1c000706 29 statusNoConnection = 0x0a
Innomatix 9:0c9f1c000706 30 }UpdateStatus_e;
Innomatix 9:0c9f1c000706 31
Innomatix 9:0c9f1c000706 32 // Use the __attribute__((unused)) to supress the "unused variable" warning
Innomatix 9:0c9f1c000706 33 static const char *UpdateStatusNames[] __attribute__((unused)) =
Innomatix 9:0c9f1c000706 34 {
Innomatix 9:0c9f1c000706 35 "Success", "UpdateAvailable", "NoUpdate", "InvalidID", "InvalidOffset",
Innomatix 9:0c9f1c000706 36 "InvalidLength", "InvalidChecksum", "NameMismatch", "DuplicateVersion",
Innomatix 9:0c9f1c000706 37 "AbortUpdate", "NoConnection"
Innomatix 9:0c9f1c000706 38 };
Innomatix 9:0c9f1c000706 39
Innomatix 9:0c9f1c000706 40
Innomatix 9:0c9f1c000706 41
Innomatix 9:0c9f1c000706 42 /*************************************************/
Innomatix 9:0c9f1c000706 43
Innomatix 9:0c9f1c000706 44
Innomatix 9:0c9f1c000706 45 /**
Innomatix 9:0c9f1c000706 46 This function initializes the API and sets up the Update Client.
Innomatix 9:0c9f1c000706 47
Innomatix 9:0c9f1c000706 48 Return Values:
Innomatix 9:0c9f1c000706 49 • TRUE – client was able to setup the network and bind to the desired port
Innomatix 9:0c9f1c000706 50 • FALSE – an error has occurred, the client is not functional
Innomatix 9:0c9f1c000706 51 *********************************************************************/
Innomatix 9:0c9f1c000706 52 UpdateStatus_e UpdateInit( const char *address, unsigned short port );
Innomatix 9:0c9f1c000706 53
Innomatix 9:0c9f1c000706 54
Innomatix 9:0c9f1c000706 55
Innomatix 9:0c9f1c000706 56 /**
Innomatix 9:0c9f1c000706 57 Shutdown and clean up the Update Client
Innomatix 9:0c9f1c000706 58 *********************************************************************/
Innomatix 9:0c9f1c000706 59 void UpdateClose();
Innomatix 9:0c9f1c000706 60
Innomatix 9:0c9f1c000706 61
Innomatix 9:0c9f1c000706 62
Innomatix 9:0c9f1c000706 63 /**
Innomatix 9:0c9f1c000706 64 Check for a pending update, compare versions to see if it should
Innomatix 9:0c9f1c000706 65 be applied, receive, validate and apply the update. Report the
Innomatix 9:0c9f1c000706 66 results to the client.
Innomatix 9:0c9f1c000706 67
Innomatix 9:0c9f1c000706 68 Return Values:
Innomatix 9:0c9f1c000706 69 • TRUE - an update was performed successfully. Reboot is needed.
Innomatix 9:0c9f1c000706 70 • FALSE - no update was pending, a pending update duplicates the
Innomatix 9:0c9f1c000706 71 current application, a pending update was unsuccessful.
Innomatix 9:0c9f1c000706 72 No further action is necessary regarding the update.
Innomatix 9:0c9f1c000706 73 *********************************************************************/
Innomatix 9:0c9f1c000706 74 UpdateStatus_e PerformUpdate( int timeout_msec );
Innomatix 9:0c9f1c000706 75
Innomatix 9:0c9f1c000706 76
Innomatix 9:0c9f1c000706 77 #endif /* _UPDATECLIENT_API_H */
Innomatix 9:0c9f1c000706 78