BTstack for EA LPC4088 QSB example program
Dependencies: LPC4088-USBHost mbed
Fork of KL46Z-BTstack_example by
The usage is the same as KL46Z-BTstack_example.
使い方はKL46Z-BTstack_exampleと同じです。
Diff: KL46Z-USBHostBTstack/USBHostBTstack.h
- Revision:
- 4:cf1b23f4dcd4
- Parent:
- 3:54f9b5e0d12d
--- a/KL46Z-USBHostBTstack/USBHostBTstack.h Sat Jan 25 12:58:21 2014 +0000 +++ b/KL46Z-USBHostBTstack/USBHostBTstack.h Fri Jan 31 15:06:38 2014 +0000 @@ -7,7 +7,7 @@ /** * A class to communicate a BTstack */ -class USBHostBTstack { +class USBHostBTstack : public IUSBEnumerator { public: /** * Constructor @@ -34,13 +34,29 @@ void register_packet_handler( void (*pMethod)(uint8_t, uint8_t*, uint16_t)); void poll(); +protected: + //From IUSBEnumerator + virtual void setVidPid(uint16_t vid, uint16_t pid); + virtual bool parseInterface(uint8_t intf_nb, uint8_t intf_class, uint8_t intf_subclass, uint8_t intf_protocol); //Must return true if the interface should be parsed + virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir); //Must return true if the endpoint will be used + private: USBHost * host; USBDeviceConnected * dev; + bool dev_connected; uint8_t int_report[64]; uint8_t bulk_report[64]; + USBEndpoint * int_in; + USBEndpoint * bulk_in; USBEndpoint * bulk_out; + bool ep_int_in; + bool ep_bulk_in; + bool ep_bulk_out; + + bool btstack_device_found; + int btstack_intf; void (*m_pCb)(uint8_t, uint8_t*, uint16_t); + void init(); }; void _debug_bytes(const char* pretty, int line, const char* s, uint8_t* buf, int len);