BaseUsbHost example program

Dependencies:   BaseUsbHost FATFileSystem mbed mbed-rtos

Revision:
3:6ae9a03a6145
Parent:
2:c10029b87439
Child:
5:495f7536897b
--- a/LogitechC270/LogitechC270.cpp	Tue Dec 11 15:28:00 2012 +0000
+++ b/LogitechC270/LogitechC270.cpp	Sun Jan 06 11:47:51 2013 +0000
@@ -1,4 +1,4 @@
-// LogitechC270.cpp 2012/12/11
+// LogitechC270.cpp 2013/1/3
 #include "mbed.h"
 #include "rtos.h"
 #include "BaseUsbHost.h"
@@ -8,7 +8,7 @@
 #include "BaseUsbHostTest.h"
 #include "LogitechC270.h"
 
-LogitechC270::LogitechC270(int frameIndex, uint32_t interval, ControlEp* ctlEp)
+LogitechC270::LogitechC270(int formatIndex, int frameIndex, uint32_t interval, ControlEp* ctlEp)
 {
     uint8_t buf[26];
     
@@ -47,7 +47,7 @@
     DBG_BYTES("GET_CUR Probe", buf, 26);
 
     memset(buf, 0, 26);
-    buf[2] = C270_MJPEG;
+    buf[2] = formatIndex;
     buf[3] = frameIndex;
     *reinterpret_cast<uint32_t*>(buf+4) = interval;
     
@@ -57,7 +57,7 @@
 
     rc = Control(GET_CUR, VS_COMMIT_CONTROL, 1, buf, 26);
     TEST_ASSERT(rc == USB_OK);
-    TEST_ASSERT_EQUAL(buf[2], C270_MJPEG);
+    TEST_ASSERT_EQUAL(buf[2], formatIndex);
     TEST_ASSERT_EQUAL(buf[3], frameIndex);
     TEST_ASSERT_EQUAL(*reinterpret_cast<uint32_t*>(buf+4), interval);
     DBG_BYTES("GET_CUR Commit", buf, 26);