Official support library for using mbed as a programmable coprocessor in the Innomatix DAP-III+ telematics platform

Committer:
root@developer-sjc-cyan-compiler.local.mbed.org
Date:
Wed Sep 06 19:19:37 2017 +0000
Revision:
12:3d37c8a7be2b
Parent:
11:b28c0d6773bf
Added tag v1.0.7 for changeset b28c0d6773bf

Who changed what in which revision?

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