![](/media/cache/profiles/ddcbe25988981920c872c1787382f04d.50x50_q85.jpg)
XOOMの動作状況を聞き処理を変えてみました。 USBケーブルを抜いた際に処理を終了するようにしました。
ADK.h@0:9fb6c423e32c, 2011-05-25 (annotated)
- Committer:
- abe00makoto
- Date:
- Wed May 25 09:34:38 2011 +0000
- Revision:
- 0:9fb6c423e32c
- Child:
- 2:a05c7cbe396f
support ADK
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
abe00makoto | 0:9fb6c423e32c | 1 | |
abe00makoto | 0:9fb6c423e32c | 2 | #ifndef ADK_H_INCLUDED |
abe00makoto | 0:9fb6c423e32c | 3 | #define ADK_H_INCLUDED |
abe00makoto | 0:9fb6c423e32c | 4 | |
abe00makoto | 0:9fb6c423e32c | 5 | #include "mbed.h" |
abe00makoto | 0:9fb6c423e32c | 6 | |
abe00makoto | 0:9fb6c423e32c | 7 | |
abe00makoto | 0:9fb6c423e32c | 8 | #define ACCESSORY_STRING_MANUFACTURER 0 |
abe00makoto | 0:9fb6c423e32c | 9 | #define ACCESSORY_STRING_MODEL 1 |
abe00makoto | 0:9fb6c423e32c | 10 | #define ACCESSORY_STRING_DESCRIPTION 2 |
abe00makoto | 0:9fb6c423e32c | 11 | #define ACCESSORY_STRING_VERSION 3 |
abe00makoto | 0:9fb6c423e32c | 12 | #define ACCESSORY_STRING_URI 4 |
abe00makoto | 0:9fb6c423e32c | 13 | #define ACCESSORY_STRING_SERIAL 5 |
abe00makoto | 0:9fb6c423e32c | 14 | |
abe00makoto | 0:9fb6c423e32c | 15 | #define ACCESSORY_GET_PROTOCOL 51 |
abe00makoto | 0:9fb6c423e32c | 16 | #define ACCESSORY_SEND_STRING 52 |
abe00makoto | 0:9fb6c423e32c | 17 | #define ACCESSORY_START 53 |
abe00makoto | 0:9fb6c423e32c | 18 | |
abe00makoto | 0:9fb6c423e32c | 19 | |
abe00makoto | 0:9fb6c423e32c | 20 | //void sendString(int device, int index, const char *str); |
abe00makoto | 0:9fb6c423e32c | 21 | //int getProtocol(int device); |
abe00makoto | 0:9fb6c423e32c | 22 | bool switchDevice(int device); |
abe00makoto | 0:9fb6c423e32c | 23 | |
abe00makoto | 0:9fb6c423e32c | 24 | class AdkUSB |
abe00makoto | 0:9fb6c423e32c | 25 | { |
abe00makoto | 0:9fb6c423e32c | 26 | public: |
abe00makoto | 0:9fb6c423e32c | 27 | AdkUSB(int device, int configuration, int interfaceNumber); |
abe00makoto | 0:9fb6c423e32c | 28 | int read(u8 *buff, int len, int nakLimit); |
abe00makoto | 0:9fb6c423e32c | 29 | int write(u8 *buff, int len ); |
abe00makoto | 0:9fb6c423e32c | 30 | void loop(); |
abe00makoto | 0:9fb6c423e32c | 31 | |
abe00makoto | 0:9fb6c423e32c | 32 | private: |
abe00makoto | 0:9fb6c423e32c | 33 | int input_ep; |
abe00makoto | 0:9fb6c423e32c | 34 | int output_ep; |
abe00makoto | 0:9fb6c423e32c | 35 | int _device; |
abe00makoto | 0:9fb6c423e32c | 36 | int _configuration; |
abe00makoto | 0:9fb6c423e32c | 37 | int _interfaceNumber; |
abe00makoto | 0:9fb6c423e32c | 38 | |
abe00makoto | 0:9fb6c423e32c | 39 | |
abe00makoto | 0:9fb6c423e32c | 40 | }; |
abe00makoto | 0:9fb6c423e32c | 41 | |
abe00makoto | 0:9fb6c423e32c | 42 | |
abe00makoto | 0:9fb6c423e32c | 43 | |
abe00makoto | 0:9fb6c423e32c | 44 | #endif |