Improving support for device ID and Firmware revision. Untested.
authorsl
Tue, 08 Jul 2014 21:50:53 +0200
changeset 533e930b11152
parent 4 36894fc4dad6
child 6 b1c1b2be9a1c
Improving support for device ID and Firmware revision. Untested.
FutabaVfd.cpp
FutabaVfd.h
MiniDisplay.cpp
MiniDisplay.h
     1.1 --- a/FutabaVfd.cpp	Tue Jul 08 18:59:41 2014 +0200
     1.2 +++ b/FutabaVfd.cpp	Tue Jul 08 21:50:53 2014 +0200
     1.3 @@ -84,6 +84,8 @@
     1.4      iNeedFullFrameUpdate(0),
     1.5      iRequest(EMiniDisplayRequestNone),iPowerOn(false)
     1.6  	{
     1.7 +	iDeviceId[0]=0;
     1.8 +	iFirmwareRevision[0]=0;
     1.9  	//ResetBuffers();
    1.10  	}
    1.11  
    1.12 @@ -662,6 +664,16 @@
    1.13              iPowerOn = false;
    1.14              }
    1.15          }
    1.16 +	else if (CurrentRequest()==EMiniDisplayRequestDeviceId)
    1.17 +		{
    1.18 +			unsigned char* ptr=&iInputReport[1];
    1.19 +			strcpy(iDeviceId,(const char*)ptr);
    1.20 +		}
    1.21 +	else if (CurrentRequest()==EMiniDisplayRequestFirmwareRevision)
    1.22 +		{
    1.23 +			unsigned char* ptr=&iInputReport[1];
    1.24 +			strcpy(iFirmwareRevision,(const char*)ptr);
    1.25 +		}
    1.26  
    1.27      TMiniDisplayRequest completed=iRequest;
    1.28      //Our request was completed
     2.1 --- a/FutabaVfd.h	Tue Jul 08 18:59:41 2014 +0200
     2.2 +++ b/FutabaVfd.h	Tue Jul 08 21:50:53 2014 +0200
     2.3 @@ -164,6 +164,8 @@
     2.4      TMiniDisplayRequest AttemptRequestCompletion();
     2.5      FutabaVfdReport& InputReport() {return iInputReport;}
     2.6      bool PowerOn(){return iPowerOn;}
     2.7 +	char* DeviceId(){return iDeviceId;};
     2.8 +	char* FirmwareRevision(){return iFirmwareRevision;};
     2.9  
    2.10  private:
    2.11  	enum DW
    2.12 @@ -205,6 +207,9 @@
    2.13  	//unsigned char *iBackBuffer;
    2.14      TMiniDisplayRequest iRequest;
    2.15      FutabaVfdReport iInputReport;
    2.16 +	//
    2.17 +	char iDeviceId[KFutabaMaxHidReportSize];
    2.18 +	char iFirmwareRevision[KFutabaMaxHidReportSize];
    2.19      bool iPowerOn;
    2.20  	};
    2.21  
     3.1 --- a/MiniDisplay.cpp	Tue Jul 08 18:59:41 2014 +0200
     3.2 +++ b/MiniDisplay.cpp	Tue Jul 08 21:50:53 2014 +0200
     3.3 @@ -176,3 +176,20 @@
     3.4      ((GP1212A01A*)aDevice)->CancelRequest();
     3.5      }
     3.6  
     3.7 +//-------------------------------------------------------------
     3.8 +TMiniDisplayRequest MiniDisplayAttempRequestCompletion(MiniDisplayDevice aDevice)
     3.9 +	{
    3.10 +	return ((GP1212A01A*)aDevice)->AttemptRequestCompletion();
    3.11 +	}
    3.12 +
    3.13 +//-------------------------------------------------------------
    3.14 +char* MiniDisplayDeviceId(MiniDisplayDevice aDevice)
    3.15 +	{
    3.16 +	return ((GP1212A01A*)aDevice)->DeviceId();
    3.17 +	}
    3.18 +
    3.19 +//-------------------------------------------------------------
    3.20 +char* MiniDisplayFirmwareRevision(MiniDisplayDevice aDevice)
    3.21 +	{
    3.22 +	return ((GP1212A01A*)aDevice)->FirmwareRevision();
    3.23 +	}
    3.24 \ No newline at end of file
     4.1 --- a/MiniDisplay.h	Tue Jul 08 18:59:41 2014 +0200
     4.2 +++ b/MiniDisplay.h	Tue Jul 08 21:50:53 2014 +0200
     4.3 @@ -163,5 +163,26 @@
     4.4  */
     4.5  extern "C" MDAPI void MiniDisplayCancelRequest(MiniDisplayDevice aDevice);
     4.6  
     4.7 +/**
     4.8 +Attempt request completion.
     4.9 +@param [IN] The device to apply this command to.
    4.10 +*/
    4.11 +extern "C" MDAPI TMiniDisplayRequest MiniDisplayAttempRequestCompletion(MiniDisplayDevice aDevice);
    4.12 +
    4.13 +/**
    4.14 +Provide device ID.
    4.15 +@param [IN] The device to apply this command to.
    4.16 +@return Device ID name.
    4.17 +*/
    4.18 +extern "C" MDAPI char* MiniDisplayDeviceId(MiniDisplayDevice aDevice);
    4.19 +
    4.20 +/**
    4.21 +Provide firmware revision.
    4.22 +@param [IN] The device to apply this command to.
    4.23 +@return Firmware revision name.
    4.24 +*/
    4.25 +extern "C" MDAPI char* MiniDisplayFirmwareRevision(MiniDisplayDevice aDevice);
    4.26 +
    4.27 +
    4.28  #endif
    4.29