usbb2k-api-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Usbb2k-api-dev] P4K Development


From: Steve Underwood
Subject: Re: [Usbb2k-api-dev] P4K Development
Date: Sun, 19 Feb 2006 20:17:40 +0800
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)

Hi all,

address@hidden wrote:

On Sun, Feb 12, 2006 at 01:50:13PM +0000, Adam J. P. Wood wrote:
Thanks for the reply,

I can't immediately see any difference between the usb-p1k and the usb-p4k. USB programming is not my thing but I'll keep looking. I have a feeling this could be very tricky.

From an USB bus perspective there's no way to distinguish between P1K and P4K.
I suppose Yealink has a specific command that can query the phone model in its
protocol. (Hopefully Yealink will eventually make the spec public.)
The USB ID is the same, but some of the functions these phones support are different. I suspect you could tell the phones apart by testing which functions they support.

In the meantime we could enhance the driver with a tunable parameter
that sets the model to a specific type.

For example a sysfs interface "/sys/..../model" you could set to P1K or P4K.


The keyboard mappings for the P4K should be easily fixed once you turn on
debugging in the yealink driver.

In the standalone version turn on debugging n the makefile by appending V=1 to the MAKE_OPTS variable.

Cheers,
Henk
The keyboard mapping for the P4K is
int key_names[] =
{
   KEY_DIAL,           /* 0x00 */
   KEY_3,
   KEY_6,
   KEY_9,
   KEY_HASH,
   KEY_HELP,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   KEY_OUT,            /* 0x10 */
   KEY_2,
   KEY_5,
   KEY_8,
   KEY_0,
   KEY_FLASH,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   KEY_SPEAKER,        /* 0x20 */
   KEY_1,
   KEY_4,
   KEY_7,
   KEY_STAR,
   KEY_SEND,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   KEY_SCROLL_DOWN,    /* 0x30 */
   KEY_VOL_UP,
   KEY_SCROLL_UP,
   KEY_DEL,
   KEY_IN,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   KEY_VOL_DOWN,       /* 0x40 */
   0,
   0,
   0,
   KEY_REDIAL
};

The LCD is pretty much the same as the P1K - the LCD panel is different, with larger digits in the P4K, but the segments seem identical.

If anyone has better ideas about USB, I'm prepared to put the time in to try and make this work but I need some pointers on how to tell which phone is plugged in.
I suppose we need to compare USB message logs of P1K and P4K to figure
that one out.
The messages I have figured out so far for the P4K are:

/* Definitions of the USB control messages understood by the USB phone */

/* Ring control (Probably only power ringing for FXS devices)
*
* cmd      0x01
* size     1
* offset   0
* data[0]  0 OFF / 1 ON
*/
#define URB_CMD_POWER_RING          0x01        /* Not for P4K */

/* Set ringtone notes
*
* cmd      0x02
* size     1-11
* offset   0->
* data     binary representation LE16(-freq),  LE16(duration) ....
*/
#define URB_CMD_RING_CADENCE        0x02

/* Sound ringtone via the main speaker
*
* cmd      0x03
* size     1
* offset   0
* data[0]  0 OFF / 0x24 ON
*/
#define URB_CMD_SPEAKER_RING        0x03

/* Set LCD
*
* cmd      0x04
* size     1-11
* offset   0-23
* data     segment bits
*/
#define URB_CMD_LCD                 0x04

/* Set LED
*
* cmd      0x05
* size     1
* offset   0
* data[0]  0 OFF / 1 ON
*/
#define URB_CMD_SET_LED             0x05

/* ???? (happens at startup)
*
* cmd      0x06
* size     1
* offset   0
*/
#define URB_CMD_06                  0x06

/* ????
*
* cmd      0x07
* size     1
* offset   0
*/
#define URB_CMD_07                  0x07

/* ????
*
* cmd      0x08
* size * offset */
#define URB_CMD_08                  0x08

/* Play dialtone in the earpiece
*
* cmd      0x09
* size     1
* offset   0
* data[0]  0 OFF / 1 ON
*/
#define URB_CMD_DIALTONE            0x09

/* ???? (happens at call start, and speaker off hook)
*
* cmd      0x0A
* size     1
* offset   0
* data[0]  ???
* data[0] returns 0x20 for OK
*/
#define URB_CMD_0A                  0x0A

/* ???? (happens at call start)
*
* cmd      0x0C
* size     1
* offset   0
* data[0]  ???
* data[0] returns 0x20 for OK
*/
#define URB_CMD_0C                  0x0C

/* USB/PSTN selection
*
* cmd      0x0E
* size     1
* offset   0
* data[0]  0 USB OFF / 1 USB ON
*/
#define URB_CMD_USB_PSTN_SELECT     0x0E        /* Not for P4K */

/* ????
*
* cmd      0x0F
* size * offset */
#define URB_CMD_0F                  0x0F

/* Speaker selection
*
* cmd      0x11
* size     1
* offset   0
* data[0]  0 Speaker off / 0x10 speaker on
*/
#define URB_CMD_RING_VOLUME         0x11

/* LCD backlight control
*
* cmd      0x12
* size     1
* offset   0
* data[0]  0 OFF / 1 ON
* data[0]  returns last key scan code (???)
*/
#define URB_CMD_SET_LCD_BACKLIGHT   0x12

/* Request key scan
*
* cmd      0x80
* size     1
* offset   0
* data[0] returns the current key position in the scancode buffer of the phone. If it changes
*          there are new key presses to be grabbed from the phone.
*/
#define URB_CMD_GET_KEY_PTR         0x80

/* Request scancode
*
* cmd      0x81
* size     1
* offset   key number [0-1f]
* data[0]  on return returns the scancode
*/
#define URB_CMD_GET_SCANCODE        0x81

/* ????
*
* cmd      0x82
* size * offset */
#define URB_CMD_82                  0x82

/* ???? (happens at startup - seems to reinitialise the something)
*
* cmd      0x87
* size     1 or 2
* offset   0
* data[0]  on return returns the status (0x02 for OK)
*/
#define URB_CMD_87                  0x87

/* ????
*
* cmd      0x88
* size * offset */
#define URB_CMD_88                  0x88

/* Get hook switch status
*
* cmd      0x8B
* size     3
* offset   0
*/
#define URB_CMD_GET_HOOK_STATE      0x8B

/* Detect handset
*
* cmd      0x8D
* size     1
* offset   0
* data[0]  on return returns the status
*/
#define URB_CMD_HANDSET_DETECT      0x8D        /* Not for P4K */

/* Init registers
*
* cmd      0x8E
* size     10
* offset   0
* data     0,0,0,0....
* data[0]  on return returns the status (0x24 for OK)
*/
#define URB_CMD_INIT                0x8E

Any information anyone can provide about the messages I haven't figured out is most welcome.

What I find saddest about these phones is Skype supports wideband voice, but these phones only support narrow band, having standard telecoms ulaw codecs inside. Other than that, they are not too bad.

Steve





reply via email to

[Prev in Thread] Current Thread [Next in Thread]