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