Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed myUSBHost AvailableMemory
Dependents: mbed_TANK_Kinect myBlueUSB_ros ftusbClass
Diff: HCITransportUSB.h
- Revision:
- 1:0dde58e0cccf
- Parent:
- 0:81ed8b6e4a8b
- Child:
- 2:0118da9e5169
--- a/HCITransportUSB.h Mon Apr 04 16:41:03 2011 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-#ifndef HCITRANSPORTUSB_H
-#define HCITRANSPORTUSB_H
-#define MAX_HCL_SIZE 260
-#define MAX_ACL_SIZE 400
-#include "USBHost.h"
-
-extern int bulk;
-
-class HCITransportUSB : public HCITransport {
- int _device;
- u8* _hciBuffer;
- u8* _aclBuffer;
-
-public:
- void Open(int device, u8* hciBuffer, u8* aclBuffer) {
- _device = device;
- _hciBuffer = hciBuffer;
- _aclBuffer = aclBuffer;
- USBInterruptTransfer(_device,0x81,_hciBuffer,MAX_HCL_SIZE,HciCallback,this);
- USBBulkTransfer(_device,0x82,_aclBuffer,MAX_ACL_SIZE,AclCallback,this);
- }
-
- static void HciCallback(int device, int endpoint, int status, u8* data, int len, void* userData) {
- HCI* t = ((HCITransportUSB*)userData)->_target;
- if (t)
- t->HCIRecv(data,len);
- USBInterruptTransfer(device,0x81,data,MAX_HCL_SIZE,HciCallback,userData);
- }
-
- static void AclCallback(int device, int endpoint, int status, u8* data, int len, void* userData) {
- HCI* t = ((HCITransportUSB*)userData)->_target; //printf("ACL: %d bytes avail\n", len);
- if (t)
- t->ACLRecv(data,len);
- USBBulkTransfer(device,0x82,data,MAX_ACL_SIZE,AclCallback,userData);
- }
-
- virtual void HCISend(const u8* data, int len) {
- USBControlTransfer(_device,REQUEST_TYPE_CLASS, 0, 0, 0,(u8*)data,len);
- }
-
- virtual void ACLSend(const u8* data, int len) {
- USBBulkTransfer(_device,0x02,(u8*)data,len);
- }
-};
-
-#endif