The real correct answer to that question was never answered in the right context
The question was in details
I have tried to follow the passage of the program by using LEDs
It show a constant passage on the correct HID service
but at this place there is no way to get the report ID ( I have tried it is not
in the wValue I always get 0 (default) )
Contents of wValue field: The high byte contains the report type
(1=Input, 3=Feature), and the low byte contains the report ID. The default
report ID is zero.
I suspect that the setup is made once only at start up but I cannot find where
My problem is compouded by the use of PicMicrocontroller IDE from Oshonsoft (I
can barely digest C compilers)
I work only in ASM
Reading from your book about your example , the explanations are simple and
straight forward (as usual with your way of explaining things)
BUT it does not explain where the REPORT IDs are generated or found
I now stand corrected as I finally found the answer IN YOUR BOOK !!!
in the following passage
Quote :Page 363
"
For Input reports when there are multiple Input Report IDs, THE HOST's
DRIVER HAS NO WAY TO REQUEST A SPECIFIC REPORT from the HID.
On receiving the IN token packet, the device returns whatever report is in its buffer. In
other words, the device firmware decides which report to send. At the host,
the HID driver stores the received report and its report ID in a buffer.
"
Unquote
That is exactly in line with the difficulties I experienced
I SIMPLY toggle between the reports pointers,sendind one then the other
and it works perfectly .
I/e
bytes in buffer in bank 0
ID#1, Data1,Data2,Data3,Data4..DataX,ID#2,Data1,Data2,Data3End of data
;Sending to USB Buffer
btfsc Report_ID,0,0 ; if 0 use 1
bra WritingLoop2 ; if not 0 use 2
WritingLoop1:
MOVLW _write ;Beginning of Report in Bank 0
MOVLB 0
MOVWF HID_Write+0, 1
MOVLW 0;
MOVWF HID_Write+1, 1
MOVLW HID_EP1_IN_REPORT_BYTES ; Number of bytes
MOVWF HID_Write+2, 1 ;
CALL _HID_Write
MOVF Hack0, 1, 0
BZ WritingLoop1 ; Done is 1
BsF Report_ID,0 ; Set bit for next report = 2
BRA main_loop ; get data and wait for next request
WritingLoop2:
; The offset is nb of bytes report 1+1
MOVLW _write+OFFSET ;Beginning + OFFSET
MOVLB 0
MOVWF FARG_HID_Write+0, 1
MOVLW 0;@_write no
MOVWF FARG_HID_Write+1, 1
MOVLW HID_EP1_IN_REPORT_BYTES ; Number of bytes
MOVWF FARG_HID_Write+2, 1 ; into
CALL _HID_Write
MOVF STACK0, 1, 0
BZ WritingLoop2
BcF Report_ID,0 ; Set for Report 1
BRA main_loop
Many thanks for your help from every quarter.
I have learned plenty due to this problem.
gb