; Descriptors
dtw macro x
dt low x,high x
endm
DEVICE_DESC
dt 18 ; bLength
dt 1 ; bDescriptorType
dtw 0x0210 ; bcdUSB (USB 2.10)
dt 0xEF ; bDeviceClass (Miscellaneous)
dt 2 ; bDeviceSubclass
dt 1 ; bDeviceProtocol (IAD follows)
dt 1<<E0_SSH ; bMaxPacketSize0 (16 Byte)
dtw 0x04D8 ; idVendor (Microchip)
dtw 0xEFDD ; idProduct
dtw 0x11 ; bcdDevice
dt 1 ; iManufacturer
dt 2 ; iProduct
dt 3 ; iSerialNumber
dt 1 ; bNumConfigurations
CONFIG_DESC
dt 9 ; bLength
dt 2 ; bDescriptorType
dtw CONFIG_DESC_LEN ; wTotalLength
dt 3 ; bNumInterfaces
CONST1 dt 1 ; bConfigurationValue
CONST0 dt 0 ; iConfiguration
dt 0x80 ; bmAttributes
dt 25 ; bMaxPower
;Erst WebUSB, dann CDC. Nur so kommt (bei Edge) ein nicht-leerer
;Stringdeskriptor für manufacturerName und productName an.
;Iface-Desc: WebUSB
dt 9 ; bLength
dt 4 ; bDescriptorType (INTERFACE)
dt 0 ; bInterfaceNumber
dt 0 ; bAlternateSetting
dt 2 ; bNumEndpoints
dt 0xFF ; bInterfaceClass
dt 0 ; bInterfaceSubclass
dt 0 ; bInterfaceProtocol
dt 5 ; iInterface
;Endpoint-Desc
dt 7 ; bLength
dt 5 ; bDescriptorType (ENDPOINT)
dt 0x03 ; bEndpointAddress (1 OUT)
dt 0x02 ; bmAttributes (transfer type: bulk)
dtw 1<<E3O_SSH ; wMaxPacketSize (64)
dt 0 ; bInterval
;Endpoint-Desc
dt 7 ; bLength
dt 5 ; bDescriptorType (ENDPOINT)
dt 0x83 ; bEndpointAddress (1 IN)
dt 0x02 ; bmAttributes (transfer type: bulk)
dtw 1<<E3I_SSH ; wMaxPacketSize (64)
dt 0 ; bInterval
;Interface Association descriptor
;Normalerweise ist CDC ein „Unfall“ (= Murks) bei der USB-Geräteklassenspezifikation.
;Denn normalwerweise besteht eine 1:1-Beziehung zwischen Interface und Gerätetreiber.
;CDC benötigt hingegen 2 Interfaces, um mit 1 Gerätetreiber zu funktionieren.
;Normalerweise wird das Problem gelöst, indem das ganze Gerät zum CDC erklärt wird;
;in diesem Fall lädt Windows statt dem Multifunktionstreiber (der für alle
;USB-Geräte mit mehreren Interfaces zuständig ist) den seriellen Treiber (usbcdc.sys).
;Will man jedoch neben CDC noch ein anderes Interface haben,
;etwa ein weiteres CDC oder (wie hier) WebUSB, ist die nachträglich „erfundene“
;Lösung dieser „Interface Association descriptor“.
dt 8 ; bLength
dt 11 ; bDescriptorType: Interface-Zusammenhang
dt 1 ; bFirst
dt 2 ; bCount
dt 2 ; bFunctionClass (communication)
dt 2 ; bFunctionSubclass
dt 0 ; bFunctionProtocol
dt 4 ; bFunction
;Iface-Desc: CDC-Steuerung
dt 9 ; bLength
dt 4 ; bDescriptorType (INTERFACE)
dt 1 ; bInterfaceNumber
dt 0 ; bAlternateSetting
dt 1 ; bNumEndpoints
dt 2 ; bInterfaceClass (communication)
dt 2 ; bInterfaceSubclass (abstract control model)
dt 1 ; bInterfaceProtocol (V.25ter, common AT commands)
dt 4 ; iInterface
;HEADER_FUNCTIONAL_DESCRIPTOR
dt 5 ; bFunctionLength
dt 0x24 ; bDescriptorType (CS_INTERFACE)
dt 0 ; bDescriptorSubtype (header functional descriptor)
dtw 0x0110 ; bcdCDC (specification version, 1.1)
;ABSTRACT_CONTROL_MANAGEMENT_FUNCTIONAL_DESCRIPTOR
dt 4 ; bFunctionLength
dt 0x24 ; bDescriptorType (CS_INTERFACE)
dt 2 ; bDescriptorSubtype (abstract control management functional descriptor)
dt 0x02 ; bmCapabilities
;UNION_FUNCTIONAL_DESCRIPTOR
dt 5 ; bFunctionLength
dt 0x24 ; bDescriptorType (CS_INTERFACE)
dt 6 ; bDescriptorSubtype (union functional descriptor)
dt 0 ; bMasterInterface
dt 1 ; bSlaveInterface0
;CALL_MANAGEMENT_FUNCTIONAL_DESCRIPTOR
dt 5 ; bFunctionLength
dt 0x24 ; bDescriptorType (CS_INTERFACE)
dt 1 ; bDescriptorSubtype (call management functional descriptor)
dt 3 ; bmCapabilities
dt 1 ; dDataInterface
;Endpoint-Desc
dt 7 ; bLength
dt 5 ; bDescriptorType (ENDPOINT)
dt 0x82 ; bEndpointAddress (2 IN)
dt 0x03 ; bmAttributes (transfer type: interrupt)
dtw 1<<E2I_SSH ; wMaxPacketSize (16)
dt 2 ; bInterval
;Iface-Desc: CDC-Daten
dt 9 ; bLength
dt 4 ; bDescriptorType (INTERFACE)
dt 2 ; bInterfaceNumber
dt 0 ; bAlternateSetting
dt 2 ; bNumEndpoints
dt 0x0A ; bInterfaceClass (data)
dt 0 ; bInterfaceSubclass
dt 0 ; bInterfaceProtocol
dt 0 ; iInterface
;Endpoint-Desc
dt 7 ; bLength
dt 5 ; bDescriptorType (ENDPOINT)
dt 0x01 ; bEndpointAddress (1 OUT)
dt 0x02 ; bmAttributes (transfer type: bulk)
dtw 1<<E1O_SSH ; wMaxPacketSize (64)
dt 0 ; bInterval
;Endpoint-Desc
dt 7 ; bLength
dt 5 ; bDescriptorType (ENDPOINT)
dt 0x81 ; bEndpointAddress (1 IN)
dt 0x02 ; bmAttributes (transfer type: bulk)
dtw 1<<E1I_SSH ; wMaxPacketSize (64)
dt 0 ; bInterval
CONFIG_DESC_LEN equ $-CONFIG_DESC
STRING_DESC
S0 dt S1-S0,3
dtw 0x0407 ; deutsch
S1 dt S2-S1,3
dt 'T',0,'U',0,' ',0,'C',0,'h',0,'e',0,'m',0,'n',0
dt 'i',0,'t',0,'z',0,',',0,' ',0,'E',0,'W',0,'A',0
S2 dt S3-S2,3
dt '8',0,' ',0,'T',0,'h',0,'e',0,'r',0,'m',0,'o',0
dt 'e',0,'l',0,'e',0,'m',0,'e',0,'n',0,'t',0,'e',0
S3 dt S4-S3,3
dt 'h',0,'e',0,'h',0,'a',0,'@',0,'h',0,'r',0,'z',0
dt '.',0,'t',0,'u',0,'-',0,'c',0,'h',0,'e',0,'m',0
dt 'n',0,'i',0,'t',0,'z',0,'.',0,'d',0,'e',0
S4 dt S5-S4,3
dt 'C',0,'D',0,'C',0
S5 dt S6-S5,3
dt 'W',0,'e',0,'b',0,'U',0,'S',0,'B',0
S6 equ $
STRING_DESC_N equ 6 ;0..5
BOS_DESC
dt 5,15
dtw BOS_DESC_LEN
dt 2 ;Anzahl der Deskriptoren
dt 24,16,5,0
dt 0x38,0xB6,0x08,0x34,0xA9,0x09,0xA0,0x47
dt 0x8B,0xFD,0xA0,0x76,0x88,0x15,0xB6,0x65 ;WebUSB GUID
dtw 0x100
dt 1,1 ;bRequest, iLandingPage
dt 28,16,5,0
dt 0xDF,0x60,0xDD,0xD8,0x89,0x45,0xC7,0x4C
dt 0x9C,0xD2,0x65,0x9D,0x9E,0x64,0x8A,0x9F ;MS OS 2.0 GUID
dt 0,0,3,6 ;dwWindowsVersion
dtw MSOS20_DESC_LEN
dt 2,0 ;bRequest
BOS_DESC_LEN equ $-BOS_DESC
MSOS20_DESC
dt 0x0A,0,0x00,0,0,0,3,6,0xB2,0
dt 0x08,0,0x01,0,0x00,0,0xA8,0
dt 0x08,0,0x02,0
dt 0 ;Interface-Nummer des WinUSB-Geräts
dt 0,0xA0,0
dt 20,0,3,0,"WINUSB",0,0
dt 0,0,0,0,0,0,0,0
dt 4+21+1+40<<1,0,4,0,7,0,21<<1,0
dt 'D',0,'e',0,'v',0,'i',0,'c',0,'e',0
dt 'I',0,'n',0,'t',0,'e',0,'r',0,'f',0,'a',0,'c',0,'e',0
dt 'G',0,'U',0,'I',0,'D',0,'s',0,0,0
dt 40<<1,0
dt '{',0,'9',0,'7',0,'5',0,'F',0,'4',0,'4',0,'D',0,'9',0,'-',0
dt '0',0,'D',0,'0',0,'8',0,'-',0,'4',0,'3',0,'F',0,'D',0,'-',0
dt '8',0,'B',0,'3',0,'E',0,'-',0,'1',0,'2',0,'7',0,'C',0,'A',0
dt '8',0,'A',0,'F',0,'F',0,'F',0,'9',0,'D',0,'}',0,0 ,0,0 ,0
MSOS20_DESC_LEN equ $-MSOS20_DESC
URL_DESC
dt URL_DESC_LEN,3
dt 1 ;0 = "http://", 1 = "https://"
dt "www.tu-chemnitz.de/~heha/ewa/Ofen/8te.htm"
URL_DESC_LEN equ $-URL_DESC
| Detected encoding: UTF-8 | 0
|