• slider image 71
  • slider image 72
  • slider image 73
:::


Browsing this Thread:   1 Anonymous Users




(1) 2 »


USB HID Telephony Device
#1
新會員
新會員


查看用戶資訊
Hi,
如題,請問有這個範例嗎? 查看USB HID 的範例只有Keyboard、Mouse、Joystick....好像沒有Telephony
非常感謝回覆

發表於: 2017/6/22 11:51
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: USB HID Telephony Device
#2
資深會員
資深會員


查看用戶資訊
您可以參考一下Harmony中USB Device Library的USB Audio 1.0 Device Library. 

如下面文件
http://ww1.microchip.com/downloads/en ... /USB%20Libraries_v111.pdf

page 23中有提到

The MPLAB Harmony USB Audio 1.0 Device Library (also referred to as the Audio 1.0 Function Driver or library) features routines to implement a
USB Audio 1.0 Device. Examples of Audio USB Devices include USB Speakers, microphones, and voice telephony.

發表於: 2017/6/27 11:29
不要盲目地從一堆“嘗試”中去找答案;將時間用來找尋“最正確”的方法。
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: USB HID Telephony Device
#3
新會員
新會員


查看用戶資訊
非常感謝,不過資料裡面只有稍微提及telephony,還是沒有example code,因為對HID Descriptor不是那麼熟悉,所以想找看看有沒有現成的telephony example 可以直接使用它的descriptor,看起來還是得自己刻出這個descriptor

發表於: 2017/6/28 9:47
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: USB HID Telephony Device
#4
資深會員
資深會員


查看用戶資訊
您可以參考一下Audio範例中的usb_headset,我沒試過. 但可以參考一下.

C:\microchip\harmony\v2_03b\apps\audio\usb_headset

發表於: 2017/6/28 17:48
不要盲目地從一堆“嘗試”中去找答案;將時間用來找尋“最正確”的方法。
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: USB HID Telephony Device
#5
新會員
新會員


查看用戶資訊
usb_headset 看起來好像不是HID 的裝置,因為沒有看到類似HID的Descriptor
我現在做法是用keyboard 的範例來改,descriptor 用USB-IF 的Descriptor Tool 產生Telephony descriptor,然後直接替換掉Keyboard 範例原本的descriptor,載入後,電腦指認出是HID裝置,認不出是Telephony,Telephony Descriptor 如下
hid_kbd_report_desc = {
{
//0x95, 0x01, /*REPORT_COUNT (1)*/
0x05, 0x0B, /*USAGE_PAGE (Telephony Devices)*/
0x09, 0x01, /*USAGE (Phone)*/
0xA1, 0x01, /*COLLECTION (Application)*/
0x09, 0x07, /*USAGE (Programmable Button)*/
0xA1, 0x02, /*COLLECTION (Logical)*/
0x05, 0x09, /*USAGE_PAGE (Button)*/
0x19, 0x01, /*USAGE_MINIMUM (Button 1)*/
0x29, 0x06, /*USAGE_MAXIMUM (Button 6)*/
0x75, 0x03, /*REPORT_SIZE (3)*/
0x15, 0x01, /*LOGICAL_MINIMUM (1)*/
0x25, 0x06, /*LOGICAL_MAXIMUM (6)*/
0x81, 0x00, /*INPUT (Data,Ary,Abs)*/
0xC0, /*END_COLLECTION*/
0x05, 0x0B, /*USAGE_PAGE (Telephony Devices)*/
0x09, 0x06, /*USAGE (Telephony Key Pad)*/
0xA1, 0x02, /*COLLECTION (Logical)*/
0x05, 0x09, /*USAGE_PAGE (Button)*/
0x19, 0x01, /*USAGE_MINIMUM (Button 1)*/
0x29, 0x0C, /*USAGE_MAXIMUM (Button 12)*/
0x25, 0x0C, /*LOGICAL_MAXIMUM (12)*/
0x75, 0x04, /*REPORT_SIZE (4)*/
0x81, 0x00, /*INPUT (Data,Ary,Abs)*/
0xC0, /*END_COLLECTION*/
0x05, 0x0B, /*USAGE_PAGE (Telephony Devices)*/
0x09, 0x20, /*USAGE (Hook Switch)*/
0x09, 0x29, /*USAGE (Alternate Function)*/
0x09, 0x2C, /*USAGE (Conference)*/
0x09, 0x25, /*USAGE (Transfer)*/
0x09, 0x26, /*USAGE (Drop)*/
0x09, 0x23, /*USAGE (Hold)*/
0x09, 0x2B, /*USAGE (Speaker Phone)*/
0x25, 0x07, /*LOGICAL_MAXIMUM (7)*/
0x75, 0x03, /*REPORT_SIZE (3)*/
0x81, 0x00, /*INPUT (Data,Ary,Abs)*/
0x05, 0x0C, /*USAGE_PAGE (Consumer Devices)*/
0x09, 0xE0, /*USAGE (Volume)*/
0x15, 0xFF, /*LOGICAL_MINIMUM (-1)*/
0x25, 0x01, /*LOGICAL_MAXIMUM (1)*/
0x75, 0x02, /*REPORT_SIZE (2)*/
0x81, 0x02, /*INPUT (Data,Var,Abs)*/
0x75, 0x04, /*REPORT_SIZE (4)*/
0x81, 0x03, /*INPUT (Cnst,Var,Abs)*/
0x15, 0x00, /*LOGICAL_MINIMUM (0)*/
0x25, 0x01, /*LOGICAL_MAXIMUM (1)*/
0x05, 0x08, /*USAGE_PAGE (LEDs)*/
0x09, 0x3A, /*USAGE (Usage Selected Indicator)*/
0xA1, 0x02, /*COLLECTION (Logical)*/
0x05, 0x0B, /*USAGE_PAGE (Telephony Devices)*/
0x09, 0x07, /*USAGE (Programmable Button)*/
0xA1, 0x02, /*COLLECTION (Logical)*/
0x05, 0x09, /*USAGE_PAGE (Button)*/
0x19, 0x01, /*USAGE_MINIMUM (Button 1)*/
0x29, 0x02, /*USAGE_MAXIMUM (Button 2)*/
0x95, 0x02, /*REPORT_COUNT (2)*/
0x91, 0x02, /*OUTPUT (Data,Var,Abs)*/
0xC0, /*END_COLLECTION*/
0xC0, /*END_COLLECTION*/
0x05, 0x08, /*USAGE_PAGE (LEDs)*/
0x09, 0x3B, /*USAGE (Usage In Use Indicator)*/
0xA1, 0x02, /*COLLECTION (Logical)*/
0x05, 0x0B, /*USAGE_PAGE (Telephony Devices)*/
0x09, 0x07, /*USAGE (Programmable Button)*/
0xA1, 0x02, /*COLLECTION (Logical)*/
0x05, 0x09, /*USAGE_PAGE (Button)*/
0x19, 0x01, /*USAGE_MINIMUM (Undefined)*/
0x29, 0x06, /*USAGE_MAXIMUM (Undefined)*/
0x95, 0x06, /*REPORT_COUNT (6)*/
0x91, 0x02, /*OUTPUT (Data,Var,Abs)*/
0xC0, /*END_COLLECTION*/
0x05, 0x0B, /*USAGE_PAGE (Telephony Devices)*/
0x09, 0x29, /*USAGE (Alternate Function)*/
0x95, 0x01, /*REPORT_COUNT (1)*/
0x91, 0x02, /*OUTPUT (Data,Var,Abs)*/
0xC0, /*END_COLLECTION*/
0x05, 0x08, /*USAGE_PAGE (LEDs)*/
0x09, 0x3C, /*USAGE (Usage Multi Mode Indicator)*/
0xA1, 0x02, /*COLLECTION (Logical)*/
0x05, 0x0B, /*USAGE_PAGE (Telephony Devices)*/
0x09, 0x73, /*USAGE (Message)*/
0xA1, 0x02, /*COLLECTION (Logical)*/
0x05, 0x08, /*USAGE_PAGE (LEDs)*/
0x09, 0x3D, /*USAGE (Indicator On)*/
0x09, 0x40, /*USAGE (Indicator Fast Blink)*/
0x09, 0x41, /*USAGE (Indicator Off)*/
0x75, 0x02, /*REPORT_SIZE (2)*/
0x91, 0x00, /*OUTPUT (Data,Ary,Abs)*/
0xC0, /*END_COLLECTION*/
0xC0, /*END_COLLECTION*/
0x75, 0x05, /*REPORT_SIZE (5)*/
0x81, 0x03, /*INPUT (Cnst,Var,Abs)*/
0xC0 /*END_COLLECTION*/
}
};

發表於: 2017/6/30 10:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: USB HID Telephony Device
#6
資深會員
資深會員


查看用戶資訊
Device Descriptor & Configuration Descriptor & Interface Dsc應該都要修改.

您可以參考一下附件, 有詳細的說明.

Support for USB Telephony Devices in Microsoft Windows

Attach file:


Link only for registered users

發表於: 2017/6/30 16:33
不要盲目地從一堆“嘗試”中去找答案;將時間用來找尋“最正確”的方法。
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: USB HID Telephony Device
#7
新會員
新會員


查看用戶資訊
感謝,有發現問題了,主要是HID Descriptor 的問題
您附上的文件,表示hookswitch 是必需的,之前應該是在這邊沒有處理好,我將Keyborad 的HID Descriptor換成這份文件的5.2.4裡的Descriptor,電腦就任的出HID裝置了
不過現在還面臨一個問題,就是要怎麼發送Telephony的report,直接用keyboard 發送report的code看起來是不相容,這部分還要再研究看看

5.2.4 HID Report Descriptor
As is customary for HID report descriptors, the contents of the report descriptor are described here in a readable notation that can be readily assembled into binary form.
The following example is for a simple phone with the following features:
• A hookswitch for the handset. (This is mandatory.)
• A standard telephone keypad. (This is optional.)
• A volume control. (This is optional.)

發表於: 2017/7/4 12:11
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: USB HID Telephony Device
#8
資深會員
資深會員


查看用戶資訊
HID Report Descriptor也要follow HID Telephony Device的規範來做修改.

發表於: 2017/7/6 22:42
不要盲目地從一堆“嘗試”中去找答案;將時間用來找尋“最正確”的方法。
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: USB HID Telephony Device
#9
新會員
新會員


查看用戶資訊
再請教一下,因為我不需要Volume,因此我拿掉了,HID Descriptor 修改成下面這樣,但就認不出裝置了,請問改的這個Descriptor 有不合理的地方嗎?
udi_hid_telephony_report_desc_t udi_hid_kbd_report_desc = {
{
0x05, 0x0B, /*USAGE_PAGE (Telephony Devices)*/
0x09, 0x01, /*USAGE (Phone)*/
0xA1, 0x01, /*COLLECTION (Application)*/
0x09, 0x06, /*USAGE (Telephony Key Pad)*/
0xA1, 0x02, /*COLLECTION (Logical)*/
0x19, 0xB0, /*USAGE_MINIMUM (Phone Key 0)*/
0x29, 0xBB, /*USAGE_MAXIMUM (Phone Key Pound)*/
0x15, 0x00, /*LOGICAL_MINIMUM (0)*/
0x25, 0x0C, /*LOGICAL_MAXIMUM (12)*/
0x75, 0x04, /*REPORT_SIZE (4)*/
0x95, 0x01, /*REPORT_COUNT (1)*/
0x81, 0x00, /*INPUT (Data,Ary,Abs)*/
0xC0, /*END_COLLECTION*/
//HOOK SWITCH
0x09, 0x20, /*USAGE (Hook Switch)*/
0x15, 0x00, /*LOGICAL_MINIMUM (0)*/
0x25, 0x01, /*LOGICAL_MAXIMUM (1)*/
0x75, 0x01, /*REPORT_SIZE (1)*/
0x95, 0x01, /*REPORT_COUNT (1)*/
0x81, 0x02, /*INPUT (Data,Var,Abs)*/
0x09, 0x20, /*USAGE (Hook Switch)*/
0x15, 0x00, /*LOGICAL_MINIMUM (0)*/
0x25, 0x01, /*LOGICAL_MAXIMUM (1)*/
0x75, 0x01, /*REPORT_SIZE (1)*/
0x95, 0x01, /*REPORT_COUNT (1)*/
0xB1, 0x02, /*FEATURE (Data,Var,Abs)*/
//PAD
0x75, 0x01, /*REPORT_SIZE (1)*/
0x95, 0x01, /*REPORT_COUNT (1)*/
0x81, 0x03, /*INPUT (Cnst,Var,Abs)*/
0x95, 0x07, /*REPORT_COUNT (7)*/
0x75, 0x01, /*REPORT_SIZE (1)*/
0xB1, 0x07, /*FEATURE (Cnst,Var,Rel)*/
0xC0 /*END_COLLECTION*/
}
};

發表於: 2017/7/7 16:15
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: USB HID Telephony Device
#10
新會員
新會員


查看用戶資訊
我修改成這樣就可以認到了,測試的結果是,report size 全部加起來若不滿1個byte,好像必須要把它填滿,所以多加了
"0x75, 0x03, // REPORT_SIZE (3)
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x01, // INPUT (Cnst,Ary,Abs)"
另外我用Bus hound抓取report in的資料,看起來是有送出,但是keypad 的功能似乎不像原預想的一樣可以直接印出"0~9,*,#",這邊還是有點奇怪,看文件,結果應該會像keyboard一樣可以印出"字"
udi_hid_telephony_report_desc_t udi_hid_kbd_report_desc = {
{
0x05, 0x0b, // USAGE_PAGE (Telephony Devices)
0x09, 0x01, // USAGE (Phone)
0xa1, 0x01, // COLLECTION (Application)
0x09, 0x06, // USAGE (Telephony Key Pad)
0xa1, 0x02, // COLLECTION (Logical)
0x19, 0xb0, // USAGE_MINIMUM (Phone Key 0)
0x29, 0xbb, // USAGE_MAXIMUM (Phone Key Pound)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x0c, // LOGICAL_MAXIMUM (12)
0x75, 0x04, // REPORT_SIZE (4)
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x75, 0x03, // REPORT_SIZE (3)
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x01, // INPUT (Cnst,Ary,Abs)
0xc0, // END_COLLECTION
0x09, 0x20, /*USAGE (Hook Switch)*/
0x15, 0x00, /*LOGICAL_MINIMUM (0)*/
0x25, 0x01, /*LOGICAL_MAXIMUM (1)*/
0x75, 0x01, /*REPORT_SIZE (1)*/
0x95, 0x01, /*REPORT_COUNT (1)*/
0x81, 0x02, /*INPUT (Data,Var,Abs)*/
0xc0 // END_COLLECTION
}
};

發表於: 2017/7/7 18:02
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]