Library to allow your mbed device to communicate with the Android ADK.

Files at this revision

API Documentation at this revision

Comitter:
richbayliss
Date:
Tue Jul 12 17:36:58 2011 +0000
Parent:
2:0d8581013b28
Commit message:

Changed in this revision

AndroidAccessory.cpp Show annotated file Show diff for this revision Revisions of this file
AndroidAccessory.h Show annotated file Show diff for this revision Revisions of this file
diff -r 0d8581013b28 -r ca0516beb781 AndroidAccessory.cpp
--- a/AndroidAccessory.cpp	Tue Jul 12 16:11:13 2011 +0000
+++ b/AndroidAccessory.cpp	Tue Jul 12 17:36:58 2011 +0000
@@ -76,6 +76,7 @@
 
     log("AndroidAccessory::init \r\n");
 
+    USBInit();
 //    _initok=false;
     _device = device;
     _configuration = configuration;
diff -r 0d8581013b28 -r ca0516beb781 AndroidAccessory.h
--- a/AndroidAccessory.h	Tue Jul 12 16:11:13 2011 +0000
+++ b/AndroidAccessory.h	Tue Jul 12 17:36:58 2011 +0000
@@ -1,4 +1,3 @@
-
 #ifndef ADK_H_INCLUDED
 #define ADK_H_INCLUDED
 
@@ -39,10 +38,10 @@
   * 
   * Example:
   * @code
-  * class Demokit : public AndroidAccessory
+  * class DemoKit : public AndroidAccessory
   * {
   *   public:
-  *   Demokit() : AndroidAccessory      ( 3,
+  *     DemoKit() : AndroidAccessory    ( 3,
   *                                       3,
   *                                      "Google, Inc.",
   *                                      "DemoKit",
@@ -50,9 +49,10 @@
   *                                      "1.0",
   *                                      "http://www.android.com",
   *                                      "0000000012345678") {};
-  *   virtual int  callbackRead(u8 *buff, int len);
-  *   virtual void setupDevice();
-  *   virtual void resetDevice();
+  *     virtual int  callbackRead(u8 *buff, int len);
+  *     virtual void setupDevice();
+  *     virtual void resetDevice();
+  * }
   * @endcode
   */
 class AndroidAccessory {
@@ -75,8 +75,10 @@
     int write() {
         return write(_writebuff,_writebuffsize);
     }
-    //int read(u8 *buff, int len);
-
+    
+    void Sleep() {
+        USBLoop();
+    }
 
     void adkEnd() {
        // _initok=false;