MBS USB Plugin Documentation
Total Page:16
File Type:pdf, Size:1020Kb
MBS USB Plugin Documentation Christian Schmitz September 6, 2021 2 0.1 Introduction This is the PDF version of the documentation for the Xojo Plug-in from Monkeybread Software Germany. Plugin part: MBS USB Plugin 0.2 Content • 1 List of all topics 3 • 2 List of all classes 39 • 3 List of all global methods 43 • 4 All items in this plugin 45 • 7 List of Questions in the FAQ 395 • 8 The FAQ 405 Chapter 1 List of Topics • 6 USB 239 – 6.1.1 class HIDAPIDeviceInfoMBS 239 ∗ 6.1.3 InterfaceNumber as Integer 239 ∗ 6.1.4 ManufacturerString as String 239 ∗ 6.1.5 NextDevice as HIDAPIDeviceInfoMBS 240 ∗ 6.1.6 Path as String 240 ∗ 6.1.7 ProductID as Integer 240 ∗ 6.1.8 ProductString as String 240 ∗ 6.1.9 ReleaseNumber as Integer 240 ∗ 6.1.10 SerialNumber as String 241 ∗ 6.1.11 Usage as Integer 241 ∗ 6.1.12 UsagePage as Integer 241 ∗ 6.1.13 VendorID as Integer 241 – 6.2.1 class HIDAPIDeviceMBS 242 ∗ 6.2.5 Close 242 ∗ 6.2.6 Constructor 243 ∗ 6.2.7 Enumerate(VendorID as Integer = 0, ProduceID as Integer = 0) as HIDAPIDeviceIn- foMBS 243 ∗ 6.2.8 GetFeatureReport(ReportID as Integer, MaxLength as Integer) as MemoryBlock 243 ∗ 6.2.9 GetInputReport(ReportID as Integer, MaxLength as Integer) as MemoryBlock 243 ∗ 6.2.10 IndexedString(Index as Integer, MaxLen as Integer = 1024) as String 244 ∗ 6.2.11 Init as Integer 244 ∗ 6.2.12 LoadError as String 244 ∗ 6.2.13 LoadLibrary(File as FolderItem) as boolean 244 ∗ 6.2.14 LoadLibrary(Path as string) as boolean 245 ∗ 6.2.15 Open(VendorID as Integer, ProduceID as Integer, SerialNumber as String = ””) as HIDAPIDeviceMBS 245 3 4 CHAPTER 1. LIST OF TOPICS ∗ 6.2.16 OpenPath(path as string) as HIDAPIDeviceMBS 245 ∗ 6.2.17 Read(MaxLength as Integer) as MemoryBlock 246 ∗ 6.2.18 ReadTimeOut(MaxLength as Integer, TimeoutMS as Integer) as MemoryBlock 246 ∗ 6.2.19 SendFeatureReport(data as MemoryBlock) as Integer 247 ∗ 6.2.20 SendFeatureReport(data as String) as Integer 247 ∗ 6.2.21 Shutdown as Integer 247 ∗ 6.2.22 VersionString as String 248 ∗ 6.2.23 Write(data as MemoryBlock) as Integer 248 ∗ 6.2.24 Write(data as String) as Integer 248 ∗ 6.2.26 DeviceHandle as Integer 249 ∗ 6.2.27 Error as String 249 ∗ 6.2.28 FeatureReportLength as Integer 250 ∗ 6.2.29 Handle as Integer 250 ∗ 6.2.30 InputReportLength as Integer 250 ∗ 6.2.31 ManufacturerString as String 250 ∗ 6.2.32 NonBlocking as Boolean 250 ∗ 6.2.33 OutputReportLength as Integer 251 ∗ 6.2.34 ProductString as String 251 ∗ 6.2.35 SerialNumber as String 251 5 • 4 IO Warrior 45 – 4.1.1 class IOWarriorCarbonDeviceMBS 45 ∗ 4.1.3 InterfaceHandle as Integer 45 ∗ 4.1.4 InterfaceOpen as Boolean 45 ∗ 4.1.5 InterfaceType as Integer 46 ∗ 4.1.6 SerialNumber as String 46 – 4.2.1 class IOWarriorCarbonMBS 47 ∗ 4.2.3 CountInterfaces as Integer 47 ∗ 4.2.4 FirstInterfaceOfType(InterfaceType as Integer) as Integer 47 ∗ 4.2.5 Init as Integer 47 ∗ 4.2.6 InterfaceAtIndex(index as Integer) as IOWarriorCarbonDeviceMBS 48 ∗ 4.2.7 IsPresent as Integer 48 ∗ 4.2.8 ReadFromInterface(InterfaceHandle as Integer, reportID as Integer, size as Integer, data as memoryblock) as Integer 48 ∗ 4.2.9 ReadInterface0(byref int32 as Integer) as Integer 48 ∗ 4.2.10 ReadInterface1(reportid as Integer, m as memoryblock) as Integer 48 ∗ 4.2.11 WriteInterface0(value as Integer) as Integer 48 ∗ 4.2.12 WriteInterface1(reportid as Integer, m as memoryblock) as Integer 49 ∗ 4.2.13 WriteToInterface(InterfaceHandle as Integer, size as Integer, data as memoryblock) as Integer 49 ∗ 4.2.15 USB24DeviceID as Integer 49 ∗ 4.2.16 USB24PVDeviceID as Integer 49 ∗ 4.2.17 USB40DeviceID as Integer 49 ∗ 4.2.18 USB56DeviceID as Integer 50 ∗ 4.2.19 USBVendorID as Integer 50 ∗ 4.2.21 kIOWarrior24Interface0 = 2 50 ∗ 4.2.22 kIOWarrior24Interface1 = 3 50 ∗ 4.2.23 kIOWarrior24PVInterface0 = 6 50 ∗ 4.2.24 kIOWarrior24PVInterface1 = 7 50 ∗ 4.2.25 kIOWarrior40Interface0 = 0 51 ∗ 4.2.26 kIOWarrior40Interface1 = 1 51 ∗ 4.2.27 kIOWarrior56Interface0 = 4 51 ∗ 4.2.28 kIOWarrior56Interface1 = 5 51 – 4.3.1 class IOWarriorWindowsMBS 52 ∗ 4.3.3 CancelIO(Pipe as Integer) as boolean 52 ∗ 4.3.4 close 52 ∗ 4.3.5 DeviceCount as Integer 53 ∗ 4.3.6 GetProductID as Integer 53 ∗ 4.3.7 GetRevision as Integer 53 ∗ 4.3.8 Open as boolean 53 ∗ 4.3.9 Read(pipe as Integer, buffer as memoryblock, bufferSize as Integer) as Integer 54 6 CHAPTER 1. LIST OF TOPICS ∗ 4.3.10 ReadImmediate(byref value as UInt32) as Integer 54 ∗ 4.3.11 ReadNonBlocking(pipe as Integer, buffer as memoryblock, bufferSize as Integer) as Integer 55 ∗ 4.3.12 SerialNumber as string 55 ∗ 4.3.13 SetTimeout(timeout as Integer) as boolean 55 ∗ 4.3.14 SetWriteTimeout(timeout as Integer) as boolean 56 ∗ 4.3.15 Version as string 56 ∗ 4.3.16 Write(pipe as Integer, buffer as memoryblock, bufferSize as Integer) as Integer 56 ∗ 4.3.18 DeviceIndex as Integer 57 ∗ 4.3.19 Handle as Integer 57 ∗ 4.3.20 USB24DeviceID as Integer 58 ∗ 4.3.21 USB40DeviceID as Integer 58 ∗ 4.3.22 USB56DeviceID as Integer 58 ∗ 4.3.23 USBVendorID as Integer 58 7 • 6 USB 239 – 6.3.1 class LibUSBConfigDescriptorMBS 252 ∗ 6.3.3 Constructor 252 ∗ 6.3.4 GetInterface(index as Integer) as LibUSBInterfaceMBS 252 ∗ 6.3.6 AttributesBitmap as Integer 252 ∗ 6.3.7 Configuration as Integer 252 ∗ 6.3.8 ConfigurationValue as Integer 253 ∗ 6.3.9 DescriptorType as Integer 253 ∗ 6.3.10 extra as MemoryBlock 253 ∗ 6.3.11 extraLength as Integer 253 ∗ 6.3.12 InterfaceDescriptors as Variant 253 ∗ 6.3.13 Length as Integer 253 ∗ 6.3.14 MaxPower as Integer 254 ∗ 6.3.15 NumInterfaces as Integer 254 ∗ 6.3.16 TotalLength as Integer 254 – 6.4.1 class LibUSBDeviceDescriptorMBS 255 ∗ 6.4.3 Constructor 255 ∗ 6.4.5 DescriptorType as Integer 255 ∗ 6.4.6 DeviceClass as Integer 255 ∗ 6.4.7 DeviceProtocol as Integer 255 ∗ 6.4.8 DeviceReleaseNumber as Integer 256 ∗ 6.4.9 DeviceSubClass as Integer 256 ∗ 6.4.10 IndexManufacturer as Integer 256 ∗ 6.4.11 IndexProduct as Integer 256 ∗ 6.4.12 IndexSerialNumber as Integer 256 ∗ 6.4.13 Length as Integer 257 ∗ 6.4.14 MaxPacketSize0 as Integer 257 ∗ 6.4.15 NumConfigurations as Integer 257 ∗ 6.4.16 ProductID as Integer 257 ∗ 6.4.17 USBReleaseNumber as Integer 257 ∗ 6.4.18 VendorID as Integer 257 ∗ 6.4.20 kClassApplication = & hfe 258 ∗ 6.4.21 kClassAudio = 1 258 ∗ 6.4.22 kClassComm = 2 258 ∗ 6.4.23 kClassContentSecurity = 13 258 ∗ 6.4.24 kClassData = 10 258 ∗ 6.4.25 kClassDiagnosticDevice = & hdc 259 ∗ 6.4.26 kClassHID = 3 259 ∗ 6.4.27 kClassHUB = 9 259 ∗ 6.4.28 kClassImage = 6 259 ∗ 6.4.29 kClassMassStorage = 8 259 8 CHAPTER 1. LIST OF TOPICS ∗ 6.4.30 kClassPerInterface = 0 259 ∗ 6.4.31 kClassPersonalHealthcare = 15 260 ∗ 6.4.32 kClassPhysical = 5 260 ∗ 6.4.33 kClassPrinter = 7 260 ∗ 6.4.34 kClassPTP = 6 260 ∗ 6.4.35 kClassSmartCard = 11 260 ∗ 6.4.36 kClassVendorSpecific = 255 261 ∗ 6.4.37 kClassVideo = 14 261 ∗ 6.4.38 kClassWireless = & he0 261 – 6.5.1 class LibUSBDeviceMBS 262 ∗ 6.5.7 AttachKernelDriver(interfaceNumber as Integer) 262 ∗ 6.5.8 BulkTransfer(endpoint as Integer, data as Ptr, Length as Integer, byref ActualLength as Integer, Timeout as Integer) 263 ∗ 6.5.9 ClaimInterface(interfaceNumber as Integer) 264 ∗ 6.5.10 ClearHalt(endpoint as Integer) 265 ∗ 6.5.11 Close 265 ∗ 6.5.12 ControlTransfer(requestType as Integer, Request as Integer, Value as Integer, Index as Integer, data as Ptr, Length as Integer, Timeout as Integer) as Integer 265 ∗ 6.5.13 DetachKernelDriver(interfaceNumber as Integer) 266 ∗ 6.5.14 Devices as LibUSBDeviceMBS() 267 ∗ 6.5.15 ErrorName(ErrorCode as Integer) as String 267 ∗ 6.5.16 GetActiveConfigDescriptor as LibUSBConfigDescriptorMBS 267 ∗ 6.5.17 GetConfigDescriptor(Index as Integer) as LibUSBConfigDescriptorMBS 268 ∗ 6.5.18 GetConfigDescriptorByValue(Value as Integer) as LibUSBConfigDescriptorMBS 268 ∗ 6.5.19 GetConfiguration as Integer 268 ∗ 6.5.20 GetDescriptor(descType as Integer, descIndex as Integer, data as Ptr, Length as Inte- ger) as Integer 269 ∗ 6.5.21 GetDeviceDescriptor as LibUSBDeviceDescriptorMBS 269 ∗ 6.5.22 GetMaxISOPacketSize(EndPoint as Integer) as Integer 270 ∗ 6.5.23 GetMaxPacketSize(EndPoint as Integer) as Integer 270 ∗ 6.5.24 GetStringDescriptor(descIndex as Integer, LangID as Integer = 0) as String 271 ∗ 6.5.25 GetStringDescriptor(descIndex as Integer, LangID as Integer = 0, data as Ptr, Length as Integer) as Integer 272 ∗ 6.5.26 GetStringDescriptorAscii(descIndex as Integer) as String 272 ∗ 6.5.27 GetStringDescriptorAscii(descIndex as Integer, data as Ptr, Length as Integer) as Integer 273 ∗ 6.5.28 HasCapability(Capability as UInt32) as Boolean 273 ∗ 6.5.29 Initialize as Integer 273 ∗ 6.5.30 InterruptTransfer(endpoint as Integer, data as Ptr, Length as Integer, byref Actual- Length as Integer, Timeout as Integer) 273 ∗ 6.5.31 KernelDriverActive(interfaceNumber as Integer) as Boolean 274 ∗ 6.5.32 LibraryLoaded as Boolean 275 9 ∗ 6.5.33 LibraryLoadErrorMessage as String 275 ∗ 6.5.34 LibVersion as LibUSBVersionMBS 275 ∗ 6.5.35 LoadLibrary(file as folderitem) as boolean 275 ∗ 6.5.36 LoadLibrary(path as string) as boolean 276 ∗ 6.5.37 Open as Boolean 276 ∗ 6.5.38 OpenDevice(VID as Integer, PID as Integer) as LibUSBDeviceMBS 277 ∗ 6.5.39 ReleaseInterface(interfaceNumber as Integer) 277 ∗ 6.5.40 Reset 278 ∗ 6.5.41 SetConfiguration(configuration as Integer) 278 ∗ 6.5.42 SetDebug(level as integer) 279 ∗ 6.5.43 SetInterfaceAltSetting(interfaceNumber as Integer, alternateSetting as Integer) 280 ∗ 6.5.44 Shutdown 280 ∗ 6.5.46 BusNumber as Integer 280 ∗ 6.5.47 DeviceAddress as Integer 281 ∗ 6.5.48 DeviceHandle as Integer 281 ∗ 6.5.49 DeviceSpeed as Integer 281 ∗ 6.5.50 Handle as Integer 281 ∗ 6.5.51 IsOpen as Boolean 281 ∗ 6.5.52 Lasterror as Integer 282 ∗ 6.5.54 kCapabilitiesHasCapabilities