|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
-
-
- #include <Arduino.h>
- #include "USBHost_t36.h"
-
- #define print USBHost::print_
- #define println USBHost::println_
-
-
-
-
-
-
-
-
-
- void BluetoothController::init()
- {
- contribute_Pipes(mypipes, sizeof(mypipes)/sizeof(Pipe_t));
- contribute_Transfers(mytransfers, sizeof(mytransfers)/sizeof(Transfer_t));
- contribute_String_Buffers(mystring_bufs, sizeof(mystring_bufs)/sizeof(strbuf_t));
- driver_ready_for_device(this);
- }
-
- bool BluetoothController::claim(Device_t *dev, int type, const uint8_t *descriptors, uint32_t len)
- {
-
- println("BluetoothController claim this=", (uint32_t)this, HEX);
- print("vid=", dev->idVendor, HEX);
- print(", pid=", dev->idProduct, HEX);
- print(", bDeviceClass = ", dev->bDeviceClass, HEX);
- print(", bDeviceSubClass = ", dev->bDeviceSubClass, HEX);
- println(", bDeviceProtocol = ", dev->bDeviceProtocol, HEX);
- print_hexbytes(descriptors, len);
-
-
-
- if (dev->bDeviceClass != 0xe0) return false;
- if ((dev->bDeviceSubClass != 1) || (dev->bDeviceProtocol != 1)) return false;
-
- if (type == 0) {
- }
-
- return false;
- }
-
-
- void BluetoothController::disconnect()
- {
- }
-
-
-
- void BluetoothController::control(const Transfer_t *transfer)
- {
-
- }
-
-
-
-
-
- void BluetoothController::rx_callback(const Transfer_t *transfer)
- {
- if (!transfer->driver) return;
- ((BluetoothController *)(transfer->driver))->rx_data(transfer);
- }
-
- void BluetoothController::tx_callback(const Transfer_t *transfer)
- {
- if (!transfer->driver) return;
- ((BluetoothController *)(transfer->driver))->tx_data(transfer);
- }
-
-
- void BluetoothController::rx_data(const Transfer_t *transfer)
- {
-
- }
-
-
- void BluetoothController::tx_data(const Transfer_t *transfer)
- {
- }
-
|