Corrections List for USB Complete, Second Edition by Jan Axelson Last update: 4/22/04 Thanks to the alert and helpful readers who have helped to find these. If you find other errors, please send them to me at jan@janaxelson.com and I'll add them to the list. This list is available online at www.janaxelson.com. These errors are corrected with each printing of the book, so your copy may have some or all of these errors corrected. Check my website’s USB pages (www.janaxelson.com) for code fixes, additions, enhancements, and updates. p. 13. Under Speed Limits, change 3.2 Gigabytes to 3.2 Gigabits. p. 48. In Table 3-1, Transfer Type column, change bytes/millisecond (3 instances) to bits/millisecond. p. 114. In Table 5-8 the offset for bInterval should be 6, not 5. p. 117 Fourth paragraph In 1.x descriptors, bInterval=1, not zero. p. 118 Table 5-10 Change bcdDevice to bcdUSB. p. 168 In the second-to-last line, change: SCK to: SCL p. 194 Table 8-5 Change the three cells under Register from Data Mode 0 Mode 1 to Data Mode 1 Mode 0 p. 216 Change: mov A, ACK_OUT_NAK_INe to: mov A, ACK_OUT_NAK_IN p. 331 On the last line, change Shorter reports that are not a multiple of the maximum to Shorter reports that are a multiple of the maximum p. 336 Table 14-4 For temperature, Kelvin is the SI unit and Fahrenheit is the English unit, so Row 4 should read from left to right: 4, Temperature, None, Kelvin, Fahrenheit p. 337 Line 23 should read: 1 to select degrees Fahrenheit p. 338 In the fifth paragraph, change: (cm^2)*(gm)/(sec^-3)*(amp^-1) to: (cm^2)*(gm)*(sec^-3)*(amp^-1) ("^" indicates superscript.) p. 368 In the Visual Basic code, change hDevInfo = SetupDiGetClassDevs _ to DeviceInfoSet = SetupDiGetClassDevs _ to match the code on pages 371, 374, and 399, which uses the DeviceInfoSet value. p. 374 Line 4 Change DevicePath as String to DevicePath as Byte pp. 376-377 The call to CreateFile may fail on some Windows 2000 systems. The solution is to use a SECURITY_ATTRIBUTES parameter in CreateFile. Make the following three changes: Change: DeviceHandle=CreateFile (detailData->DevicePath, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); to: DeviceHandle=CreateFile (detailData->DevicePath, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, (LPSECURITY_ATTRIBUTES)NULL, OPEN_EXISTING, 0, NULL); Change: Public Declare Function CreateFile _ Lib "kernel32" _ Alias "CreateFileA" _ (ByVal lpFileName As String, _ ByVal dwDesiredAccess As Long, _ ByVal dwShareMode As Long, _ ByVal lpSecurityAttributes As Long, _ ByVal dwCreationDisposition As Long, _ ByVal dwFlagsAndAttributes As Long, _ ByVal hTemplateFile As Long) _ As Long to: Public Declare Function CreateFile _ Lib "kernel32" _ Alias "CreateFileA" _ (ByVal lpFileName As String, _ ByVal dwDesiredAccess As Long, _ ByVal dwShareMode As Long, _ ByVal lpSecurityAttributes As SECURITY_ATTRIBUTES, _ ByVal dwCreationDisposition As Long, _ ByVal dwFlagsAndAttributes As Long, _ ByVal hTemplateFile As Long) _ As Long Change: Dim HidDevice As Long HidDevice = CreateFile _ (DevicePathName, _ GENERIC_READ Or GENERIC_WRITE, _ (FILE_SHARE_READ Or FILE_SHARE_WRITE), _ 0, _ OPEN_EXISTING, _ 0, _ 0) to: Dim HidDevice As Long HidDevice = CreateFile _ (DevicePathName, _ GENERIC_READ Or GENERIC_WRITE, _ (FILE_SHARE_READ Or FILE_SHARE_WRITE), _ Security, _ OPEN_EXISTING, _ 0, _ 0) See the usbhido2 and usbhidio2 example code at janaxelson.com for a complete example. p. 449 Fifth paragraph, first sentence Change An exception is a bus-powered composite device to An exception is a bus-powered compound device p. 467 Second paragraph, second line Change Full speed's bit rate of 480 Megabits to Full speed's bit rate of 12 Megabits p. 479 In Figure 21-4, the top 1.5k resistor should be a pull-up to 3.3V (not a pull- down). The resistor connects to D- and a pull-up enable switch.