# HG changeset patch
# User sl
# Date 1400750963 -7200
# Node ID 0d9d062609eb181801b59e1b194fc15f46f04c45
# Parent  14662967f9132270fb1614c497af8ad8d3b1cc98
Adding Futaba GP1212A01A read requests.

diff -r 14662967f913 -r 0d9d062609eb inc/FutabaVfd.h
--- a/inc/FutabaVfd.h	Thu May 22 09:31:23 2014 +0200
+++ b/inc/FutabaVfd.h	Thu May 22 11:29:23 2014 +0200
@@ -109,9 +109,13 @@
 	//From FutabaVfd
 	virtual void SetBrightness(int aBrightness);
 	virtual void Clear();
-	//
+
+	//Specific to GP1212A01A
 	void SetPixelBlock(int aX, int aY, int aHeight, int aSize, unsigned char aValue);
-
+    //
+    void RequestId();
+    void RequestFirmwareRevision();
+    void RequestPowerSupplyStatus();
 private:
 	///
 	//FutabaVfdReport iReport;
diff -r 14662967f913 -r 0d9d062609eb src/FutabaVfd.cpp
--- a/src/FutabaVfd.cpp	Thu May 22 09:31:23 2014 +0200
+++ b/src/FutabaVfd.cpp	Thu May 22 11:29:23 2014 +0200
@@ -170,15 +170,68 @@
 
 
 /**
+Clear our display's screen.
 */
 void GP1212A01A::Clear()
 	{
+    //Send Clear display command
 	FutabaVfdReport report;
 	report[0]=0x00; //Report ID
 	report[1]=0x04; //Report length
-	report[2]=0x1B; //
-	report[3]=0x5B; //
-	report[4]=0x32; //
-	report[5]=0x4A; //
+	report[2]=0x1B; //Command ID
+	report[3]=0x5B; //Command ID
+	report[4]=0x32; //Command ID
+	report[5]=0x4A; //Command ID
 	Write(report);
-	}
\ No newline at end of file
+	}
+
+/**
+*/
+void GP1212A01A::RequestId()
+    {
+    //1BH,5BH,63H,49H,44H
+    //Send Read ID command
+    FutabaVfdReport report;
+    report[0]=0x00; //Report ID
+    report[1]=0x05; //Report length
+    report[2]=0x1B; //Command ID
+    report[3]=0x5B; //Command ID
+    report[4]=0x63; //Command ID
+    report[5]=0x49; //Command ID
+    report[6]=0x44; //Command ID
+    Write(report);
+    }
+
+/**
+*/
+void GP1212A01A::RequestFirmwareRevision()
+    {
+    //1BH,5BH,63H,46H,52H
+    //Send Software Revision Read Command
+    FutabaVfdReport report;
+    report[0]=0x00; //Report ID
+    report[1]=0x05; //Report length
+    report[2]=0x1B; //Command ID
+    report[3]=0x5B; //Command ID
+    report[4]=0x63; //Command ID
+    report[5]=0x46; //Command ID
+    report[6]=0x52; //Command ID
+    Write(report);
+    }
+
+/**
+*/
+void GP1212A01A::RequestPowerSupplyStatus()
+    {
+    //1BH,5BH,63H,50H,4DH
+    //Send Power Suppply Monitor Command
+    FutabaVfdReport report;
+    report[0]=0x00; //Report ID
+    report[1]=0x05; //Report length
+    report[2]=0x1B; //Command ID
+    report[3]=0x5B; //Command ID
+    report[4]=0x63; //Command ID
+    report[5]=0x50; //Command ID
+    report[6]=0x4D; //Command ID
+    Write(report);
+    }
\ No newline at end of file
diff -r 14662967f913 -r 0d9d062609eb src/test.cpp
--- a/src/test.cpp	Thu May 22 09:31:23 2014 +0200
+++ b/src/test.cpp	Thu May 22 11:29:23 2014 +0200
@@ -725,6 +725,7 @@
 MainWindow::onFutabaReadId(FXObject *sender, FXSelector sel, void *ptr)
 {
 	//1BH,5BH,63H,49H,44H
+    /*
 	memset(iOutputReportBuffer, 0x0, KFutabaMaxHidReportSize);
 	iOutputReportBuffer[0]=0x00; //Report ID
 	iOutputReportBuffer[1]=0x05; //Report length
@@ -734,6 +735,9 @@
 	iOutputReportBuffer[5]=0x49; //
 	iOutputReportBuffer[6]=0x44; //
 	int res = hid_write(connected_device, iOutputReportBuffer, KFutabaMaxHidReportSize);
+    */
+
+    iVfd01.RequestId();
 
 	return 1;
 }
@@ -742,6 +746,7 @@
 MainWindow::onFutabaReadFirmwareRevision(FXObject *sender, FXSelector sel, void *ptr)
 {
 	//1BH,5BH,63H,46H,52H
+    /*
 	memset(iOutputReportBuffer, 0x0, KFutabaMaxHidReportSize);
 	iOutputReportBuffer[0]=0x00; //Report ID
 	iOutputReportBuffer[1]=0x05; //Report length
@@ -751,6 +756,8 @@
 	iOutputReportBuffer[5]=0x46; //
 	iOutputReportBuffer[6]=0x52; //
 	int res = hid_write(connected_device, iOutputReportBuffer, KFutabaMaxHidReportSize);
+    */
+    iVfd01.RequestFirmwareRevision();
 
 	return 1;
 }
@@ -759,6 +766,7 @@
 MainWindow::onFutabaPowerSupplyMonitor(FXObject *sender, FXSelector sel, void *ptr)
 {
 	//1BH,5BH,63H,50H,4DH
+    /*
 	memset(iOutputReportBuffer, 0x0, KFutabaMaxHidReportSize);
 	iOutputReportBuffer[0]=0x00; //Report ID
 	iOutputReportBuffer[1]=0x05; //Report length
@@ -768,6 +776,9 @@
 	iOutputReportBuffer[5]=0x50; //
 	iOutputReportBuffer[6]=0x4D; //
 	int res = hid_write(connected_device, iOutputReportBuffer, KFutabaMaxHidReportSize);
+    */
+
+    iVfd01.RequestPowerSupplyStatus();
 
 	return 1;
 }