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.
Revision 11:b28c0d6773bf, committed 2017-09-06
- Comitter:
- Innomatix
- Date:
- Wed Sep 06 19:18:48 2017 +0000
- Parent:
- 10:5fbe72ffb725
- Child:
- 12:3d37c8a7be2b
- Commit message:
- Innomatix Support Library v1.0.7 (additional files)
Changed in this revision
diff -r 5fbe72ffb725 -r b28c0d6773bf InnomatixCanAPI/Innomatix Coprocessor CAN API.docx Binary file InnomatixCanAPI/Innomatix Coprocessor CAN API.docx has changed
diff -r 5fbe72ffb725 -r b28c0d6773bf InnomatixCanAPI/inc/InnomatixCanAPI.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/InnomatixCanAPI/inc/InnomatixCanAPI.h Wed Sep 06 19:18:48 2017 +0000
@@ -0,0 +1,170 @@
+/*******************************************************************
+ *
+ * File: InnomatixCanAPI.h
+ *
+ * Description: Simple CAN API for Innomatix Coprocessor applications
+ *
+ * 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 _INNOMATIX_CAN_API_H
+#define _INNOMATIX_CAN_API_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/*************************************************/
+
+typedef enum
+{
+ canSuccess, // 0
+ canInvalidChannel, // 1
+ canInvalidSpeed, // 2
+ canInvalidIdentifier, // 3
+ canInvalidLength, // 4
+ canNoData, // 5
+ canNotInitialized, // 6
+ canGeneralError // N
+}CanResults_e;
+
+typedef enum
+{
+ canChDAP3, // CAN 3 interface on the DAP connector or wiring harness
+ canChDAP4 // CAN 4 interface on the DAP connector or wiring harness
+}CanChannel_e;
+static const char *CanChannelName[] = {"CanChDAP3", "CanChDAP4"};
+
+
+typedef enum
+{
+ canFormatStandard, // A standard, 11-bit identifier
+ canFormatExtended, // An extended, 29-bit identifier
+}CanFormat_e;
+
+typedef struct
+{
+ int TxMessageCount;
+ int RxMessageCount;
+
+ // Increments when the internal message receive buffer is full and another message is received
+ int OverflowCount;
+}StatisticsStruct_t, *StatisticsStruct_p;
+
+
+typedef struct
+{
+ int Id;
+ int DataLen;
+ int Timestamp;
+ CanFormat_e Format;
+ unsigned char Data[ 8 ];
+}CanMessage_t, *CanMessage_p;
+
+
+/**
+ * These functions are the event handlers for incoming CAN messages.
+ * They buffer the messages so they can be retrieved (by the application) later
+ *
+ * The mechanics of the API require that the application assign the event
+ * handler rather than take care of it internally.
+ * Example:
+ * CAN can0( p9, p10 );
+ * CAN can1( p30, p29 );
+ *
+ * CanInit( &can0, &can1 );
+ * can0.attach( OnReceiveCanZero );
+ * Can1.attach( OnReceiveCanOne );
+ *
+ * while( something )
+ * result = CanReceive( canChDAP3, ... )
+ *
+ ************************************************************************/
+void OnReceiveCanZero( void );
+void OnReceiveCanOne( void );
+
+
+/**
+ * This function initializes the API and the designated CAN interface.
+ * Return Values:
+ * Success - the API was initialized and the channel is ready to use.
+ * InvalidChannel - the specified channel is not supported
+ * InvalidSpeed - the specified network speed is not supported
+ * GeneralError - an unknown or unspecified error has occurred
+ *************************************************************************/
+CanResults_e CanInit( CAN *Can0, CAN *Can1 );
+
+/**
+ * This function opens the CAN channel at the specified baud rate and
+ * begins receiving messages.
+ * Return Values:
+ * Success - the API was initialized and the channel is ready to use.
+ * InvalidChannel - the specified channel is not supported
+ * InvalidSpeed - the specified network speed is not supported
+ * GeneralError - an unknown or unspecified error has occurred
+ *************************************************************************/
+CanResults_e CanOpen( CanChannel_e Channel, int Speed );
+
+
+/**
+ * This function disables the designated CAN interface.
+ *************************************************************************/
+void CanClose( CanChannel_e Channel );
+
+
+/**
+ * Allow the client to send a message on the CAN bus.
+ * Return Values:
+ * Success - the message was sent
+ * InvalidChannel - the specified channel is not supported
+ * InvalidIdentifier - the provided message id is not a valid for the specified format
+ * InvalidLength - more than 8 bytes of data were indicated
+ * GeneralError - an unknown or unspecified error has occurred
+ *************************************************************************/
+CanResults_e CanSend( CanChannel_e Channel, unsigned long Id, CanFormat_e Format, const unsigned char *Data, char DLen );
+
+
+/**
+ * Allow the client to get a message from the CAN bus.
+ * Return Values:
+ * Success - a message was retrieved, the parameters hold the message values.
+ * InvalidChannel - the specified channel is not supported
+ * NoData - no message is available on the requested channel
+ * GeneralError - an unknown or unspecified error has occurred
+ *************************************************************************/
+CanResults_e CanReceive( CanChannel_e Channel, unsigned long *Timestamp, unsigned long *Id, CanFormat_e *Format, unsigned char *Data, char *DLen );
+
+
+/**
+ * Allow the client to retrieve statistics about the CAN interface.
+ *
+ * Return Values:
+ * Success - statistics were retrieved
+ * InvalidChannel - the specified channel is not supported
+ * GeneralError - an unknown or unspecified error has occurred
+ *************************************************************************/
+CanResults_e CanStatistics( CanChannel_e Channel, StatisticsStruct_t *Stats );
+
+
+/**
+ * Flush the Rx buffer - all messages are discarded, Rx and Overflow stats are cleared
+ *
+ * Return Values:
+ * Success - statistics were retrieved
+ * InvalidChannel - the specified channel is not supported
+ * GeneralError - an unknown or unspecified error has occurred
+ *************************************************************************/
+CanResults_e CanFlush( CanChannel_e Channel );
+
+
+/*************************************************/
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _INNOMATIX_CAN_API_H */
diff -r 5fbe72ffb725 -r b28c0d6773bf InnomatixCanAPI/lib/libcanapi.ar Binary file InnomatixCanAPI/lib/libcanapi.ar has changed
diff -r 5fbe72ffb725 -r b28c0d6773bf InnomatixDataStoreAPI/Innomatix Remote DataStore API.docx Binary file InnomatixDataStoreAPI/Innomatix Remote DataStore API.docx has changed
diff -r 5fbe72ffb725 -r b28c0d6773bf InnomatixDataStoreAPI/inc/NBO.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/InnomatixDataStoreAPI/inc/NBO.h Wed Sep 06 19:18:48 2017 +0000
@@ -0,0 +1,66 @@
+/*******************************************************************
+ *
+ * File: NBO.h
+ *
+ * Description: Library to get Network to Host byte order and
+ * vice versa.
+ *
+ * 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 _NBO_H_
+#define _NBO_H_
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+* Function to aid the MessageBuilders and ParseHelpers Libraries. It allows user
+* to get a 32 bit number in Network Byte Order to host byte order (little endian).
+*
+* @param network - 32 bit number in network byte order.
+* @retval host - the 32 bit number in host byte order.
+***************************************************************************************/
+uint32_t ntohl( uint32_t network);
+
+/**
+* Function to aid the MessageBuilders and ParseHelpers Libraries. It allows user
+* to get a 32 bit number in host byte order (little endian) to network byte order.
+*
+* @param host - 32 bit number in host byte order.
+* @retval network - the 32 bit number network byte order.
+**************************************************************************************/
+uint32_t htonl( uint32_t host);
+
+/**
+* Function to aid the MessageBuilders and ParseHelpers Libraries. It allows user
+* to get a 16 bit number host byte order (little endian) to network byte order.
+*
+* @param host - 16 bit number in host byte order.
+* @retval network - the 16 bit number in network byte order.
+**************************************************************************************/
+uint16_t htons( uint16_t host);
+
+/**
+* Function to aid the MessageBuilders and ParseHelpers Libraries. It allows user
+* to get a 16 bit number in Network Byte Order to host byte order (little endian).
+*
+* @param network - 16 bit number in network byte order.
+* @retval host - the 16 bit number in host byte order.
+**************************************************************************************/
+uint16_t ntohs( uint16_t network);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _NBO_H__
\ No newline at end of file
diff -r 5fbe72ffb725 -r b28c0d6773bf InnomatixDataStoreAPI/inc/RemoteDataStoreAPI.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/InnomatixDataStoreAPI/inc/RemoteDataStoreAPI.h Wed Sep 06 19:18:48 2017 +0000
@@ -0,0 +1,141 @@
+/*******************************************************************
+ *
+ * File: RemoteDataStoreAPI.h
+ *
+ * Description: Remote DataStore API definition
+ *
+ * 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 _REMOTEDATASTOREAPI_H_
+#define _REMOTEDATASTOREAPI_H_
+
+typedef enum
+{
+ rdsSuccess,
+ rdsNoConnection,
+ rdsNotAllowed,
+ rdsServerFull,
+ rdsInvalidBin,
+ rdsNoData,
+ rdsTooBig,
+ rdsBadParameter,
+ rdsIncompatibleType,
+ rdsInUse,
+ rdsReadOnly,
+ rdsGeneralError
+}RdsResults_e;
+
+
+// Information about a data bin
+typedef struct
+{
+ unsigned int BinId;
+ unsigned char BinDataType; // Store as uchar instead of DataType so
+ // we dont have to include rdsdefinds.h
+ char BinName[ 64 ]; /* NULL terminated */
+
+}BinInfoStruct_t;
+
+
+// Since storage for the data bin is a short,
+#define BinId_None ((unsigned int)-1)
+
+
+/**
+* Initialize the Remote DataStore API and establish a connection to the server
+*
+* @retval RdsResults_e -
+* ⢠rdsSuccess â a connection was established
+* ⢠rdsNoConnection â the timeout expired without a connection
+***************************************************************************************************************************/
+RdsResults_e DataStoreInit( const char *addr, unsigned short port );
+
+/**
+* Close the host connection and shut down the Remote DataStore API
+**************************************************************************************************************************/
+void DataStoreClose();
+
+/**
+* Retrieve information from the server about the named data bin
+*
+* @param binName - name of bin of interest
+* @param BinInfoStruct - structure to be populated with the data bin info
+* @retval RdsResults_e -
+* ⢠rdsSuccess â the BinInfoStruct has been filled with information about the requested data bin
+* ⢠resNoConnection â the connection has been lost, or the timeout expired with no response
+* from the server
+* ⢠rdsInvalidDataBin â a data bin with the given name does not exist
+* ⢠rdsGeneralError â an unknown or unspecified error has occurred
+*
+**************************************************************************************************************************/
+RdsResults_e GetDataBinInfo(const char *Name, BinInfoStruct_t *Info);
+
+/**
+* Retrieve the current value from a data bin
+*
+* @param BinId - Bin ID as returned by GetBinInfo
+* @param Value - value retrieved from the data bin
+* @param Timestamp - system-relative timestamp that the data bin was last udpated
+* NOTE: the value may not coorelate to clock-time. Checking
+* the value against a previously-saved timestamp indicates
+* the data bin has been updated since the previous timestamp
+* was saved.
+* @retval RdsResults_e -
+* ⢠rdsSuccess â the Value and Timestamp parameters have been filled
+* ⢠rdsNoConnection â the connection has been lost, or the timeout expired with no response from the server
+* ⢠rdsInvalidBin â a data bin with the given ID does not exist
+* ⢠rdsIncompatibleType â the specified data bin is not of the requested type and the data bin value cannot
+* be convereted to the requested type.
+* ⢠rdsNoData â the specified data bin has not been written to yet
+* ⢠rdsBadParameter â the value buffer pointer is NULL
+* ⢠rdsTooBig â the value buffer is not big enough to hold the retrieved data, the value buffer is left unchanged
+* ⢠rdsInUse â the requested data bin is in use by another application or client and cannot be read
+* ⢠rdsGeneralError â an unknown or unspecified error has occurred
+***************************************************************************************************************************/
+RdsResults_e GetSignedInteger(unsigned int BinId, int *Value, unsigned int *Timestamp);
+RdsResults_e GetUnsignedInteger(unsigned int BinId, unsigned int *Value, unsigned int *Timestamp);
+RdsResults_e GetDouble(unsigned int BinId, double *Value, unsigned int *Timestamp);
+RdsResults_e GetString(unsigned int BinId, char *Str, unsigned short MaxStrLen,unsigned int *Timestamp);
+RdsResults_e GetBlob( unsigned int BinId, unsigned char *Blob, unsigned short MaxBlobLen, unsigned short *ActualBlobLen, unsigned int *Timestamp);
+
+/**
+* Put a new value into the data bin
+*
+* @param BinId - Bin ID to update, as retrieved from GetBinInfo()
+* @param Value - new value for the data bin
+* @retval RdsResults_e -
+* ⢠rdsSuccess â the Value and Timestamp parameters have been filled
+* ⢠rdsNoConnection â the connection has been lost, or the timeout expired with no response from the server
+* ⢠rdsInvalidBin â a data bin with the given ID does not exist
+* ⢠rdsIncompatibleType â the specified data bin is not of the requested type and the data bin value cannot
+* be convereted to the requested type.
+* ⢠rdsNoData â the specified data bin has not been written to yet
+* ⢠rdsBadParameter â the value buffer pointer is NULL
+* ⢠rdsTooBig â the value buffer is not big enough to hold the retrieved data, the value buffer is left unchanged
+* ⢠rdsInUse â the requested data bin is in use by another application or client and cannot be read
+* ⢠rdsGeneralError â an unknown or unspecified error has occurred
+*
+* example function call: PutSignedInteger( BinId, SignedValue )
+******************************************************************************************************************************/
+RdsResults_e PutSignedInteger(unsigned int BinId, int Value);
+RdsResults_e PutUnsignedInteger(unsigned int BinId, unsigned int Value);
+RdsResults_e PutDouble(unsigned int BinId, double Value);
+RdsResults_e PutString(unsigned int BinId, char *Str);
+RdsResults_e PutBlob( unsigned int BinId, unsigned char *Blob, unsigned short BlobLen );
+
+
+/**
+* Helper function to send a string to a pre-defined "debug log" data bin
+*
+* @param String - the message to send
+* @retval RdsResults_e - same as PutString()
+******************************************************************************************************************************/
+RdsResults_e PutDebug( char *Str );
+
+
+#endif // _REMOTEDATASTOREAPI_H_
\ No newline at end of file
diff -r 5fbe72ffb725 -r b28c0d6773bf InnomatixDataStoreAPI/lib/librdsapi.ar Binary file InnomatixDataStoreAPI/lib/librdsapi.ar has changed
diff -r 5fbe72ffb725 -r b28c0d6773bf InnomatixUpdateAPI/inc/UpdateClientAPI.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/InnomatixUpdateAPI/inc/UpdateClientAPI.h Wed Sep 06 19:18:48 2017 +0000
@@ -0,0 +1,79 @@
+/*******************************************************************
+ *
+ * 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,
+ statusTimeout = 0x0b
+}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", "Timeout"
+};
+
+
+
+/*************************************************/
+
+
+/**
+ 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 */
+
diff -r 5fbe72ffb725 -r b28c0d6773bf InnomatixUpdateAPI/lib/libupdateapi.ar Binary file InnomatixUpdateAPI/lib/libupdateapi.ar has changed
diff -r 5fbe72ffb725 -r b28c0d6773bf MbedTransport/inc/MbedTransport.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MbedTransport/inc/MbedTransport.h Wed Sep 06 19:18:48 2017 +0000
@@ -0,0 +1,90 @@
+/*******************************************************************
+ *
+ * File: MbedTransport.h
+ *
+ * Description: Communications transport layer API for Mbed
+ *
+ * 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 _MBEDTRANSPORT_H_
+#define _MBEDTRANSPORT_H_
+
+
+#define DO_SERIAL_NET
+
+#ifndef DO_SERIAL_NET
+#include "EthernetInterface.h"
+#endif
+
+
+#define ADDRESS_LENGTH 256
+
+
+typedef struct
+{
+ char Address[ADDRESS_LENGTH];
+ int Port;
+#ifndef DO_SERIAL_NET
+ UDPSocket sendSocket;
+ UDPSocket receiveSocket;
+ Endpoint sendEndpoint;
+ Endpoint receiveEndpoint;
+#endif
+
+}TransportHandle_t, *TransportHandle_p;
+
+/**
+* Function to initialize ethernet, UDP socket sending and UDP socket receiving.
+*
+* @param h - TransportHandle that saves all of the socket information for future
+ use when we need to send/recieve information.
+* @retval result - lets us know if there was a success or error.
+***********************************************************************************/
+int TransportInit( TransportHandle_p handle, const char *address, unsigned short port );
+
+
+
+/***********************************************************************************/
+void TransportClose( TransportHandle_p handle );
+
+
+/**
+* Test if the transport is ready to use. Ensures that TransportInit() has been
+* called for the given handle. May include other conditions based on the underlying
+* interface/connection.
+* serial_net - includes testing that the DAP side of the connection is open
+*
+* NOTE: calls to TransportSend() and TransportReceive() when the transport reports
+* not Ready() may block.
+*
+* @retval result - 0 indicates not ready or not connected. 1 indicates ready to use
+***********************************************************************************/
+int TransportReady( TransportHandle_p handle );
+
+
+/**
+* Function for sending a buffer via UDP with the socket we set up in Init.
+*
+* @param len - length of the buffer we want to send to the server.
+* @param buff - the buffer we would like to send to the server.
+* @retval result - Value < 0 indicates error or no remote device connected. Value >= 0 indicates number bytes sent
+******************************************************************************************/
+int TransportSend( TransportHandle_p handle, unsigned short len, const unsigned char *buff, int timeout);
+
+
+/**
+* Function for receving a buffer via UDP with the socket we set up in Init.
+*
+* @param maxlen - the maximum length of the buffer we want to receive from the server.
+* @param buff - the buffer we would like to receiver from the server.
+* @retval result - Value < 0 indicates error or no remote device connected. Value >= 0 indicates number bytes received
+***********************************************************************************************/
+int TransportReceive( TransportHandle_p handle, unsigned short maxlen, unsigned char *buff, int timeout );
+
+
+#endif /* _MBEDTRANSPORT_H_ */
\ No newline at end of file
diff -r 5fbe72ffb725 -r b28c0d6773bf MbedTransport/lib/libtranspapi.ar Binary file MbedTransport/lib/libtranspapi.ar has changed
diff -r 5fbe72ffb725 -r b28c0d6773bf UserGuide/InnomatixDAP3CoprocessorDevelopersGuide.docx Binary file UserGuide/InnomatixDAP3CoprocessorDevelopersGuide.docx has changed
diff -r 5fbe72ffb725 -r b28c0d6773bf UserGuide/InnomatixDAP3CoprocessorQuickStart.docx Binary file UserGuide/InnomatixDAP3CoprocessorQuickStart.docx has changed