From: Nathan H. <hj...@ma...> - 2009-11-04 15:25:55
|
It turns out LG did not completely remove the phonebook protocol (old command 0xff). Newer phones (VX-5500, VX-9600, VX-11K, and likely others) use the 0xf1 command. Here is what I know so far (still looking for commands): command index option1 option2 effect 0xf1 0x01 -- -- -- returns carrier name at offset 38 0xf1 0x0a -- -- -- phone info (mtn, phone kind, sw version, hw revision, etc) 0xf1 0x28 -- -- -- phonebook info. returns the maximum count for contacts and calendar events 0xf1 0x29 0-max ?? ?? read contact 0xf1 0x2a 0-max ?? ?? write contact 0xf1 0x2c 0-max ?? ?? clear contact 0xf1 0x2d 0-max ?? ?? read name of built-in ringtone at index. last valid name is No Ring 0xf1 0x2e ?? ?? group index read group names 0xf1 0x2f ?? ?? ?? clears all contacts when index, option1, option2 are 0 (haven't tried any other values) 0xf1 0x32 0-max ?? ?? read event 0xf1 0x33 0-max ?? ?? delete event?? Here is the basic structure of the 0xf1 0x29 and 0xf1 0x2a commands: struct lg_pbv1_standard { u_int8_t command; /* 0xf1 */ u_int8_t option; /* 0x29: read, 0x2a: write */ u_int16_t index; /* */ u_int8_t unknown0[6]; /* 00 00 00 00 00 00 on write. might contain pic id/ring id settings */ char name[33]; /* contact name (iso-latin 1) */ u_int16_t gid; /* 0(no group)-30 */ char emails[2][49]; /* contact emails (iso-latin 1) */ u_int8_t unknown1[6]; /* 00 00 00 00 00 00 */ char numbers[5][49]; /* mobile1, home, work, mobile2, fax (ascii) */ u_int16_t default_number; /* 1-5 (index in numbers array + 1) */ u_int8_t unknown2[96]; /* doesn't matter */ u_int16_t validflag; /* 0x012f == invalid, 0x0000 == valid */ /* unknown/phone specific */ } __attribute__ ((__packed__)); UTF-16 version (VX-5500): struct lg_pbv1_unicode { u_int8_t command; /* 0xf1 */ u_int8_t option; /* 0x29: read, 0x2a: write */ u_int16_t index; /* */ u_int8_t unknown0[6]; /* 00 00 00 00 00 00 on write. might contain pic id/ring id settings */ u_int16_t name[33]; /* contact name (utf-16 le) */ u_int16_t gid; /* 0(no group)-30 */ char emails[2][49]; /* contact emails (iso-latin 1) */ u_int8_t unknown1[6]; /* 00 00 00 00 00 00 */ char numbers[5][49]; /* mobile1, home, work, mobile2, fax (ascii) */ u_int16_t default_number; /* 1-5 (index in numbers array + 1) */ u_int8_t unknown2[96]; /* doesn't matter */ u_int16_t validflag; /* 0x012f == invalid, 0x0000 == valid */ /* unknown/phone specific */ } __attribute__ ((__packed__)); If anyone has the time (and an older LGPBv1 phone-- VX-8550 and newer) I want to know if all LGPBv1 phones use the above protocol. If so then the 0xf1 0x2d command could be used in com_lgvx8550.py to generate the built-in ringtone list instead of us hard-coding the list. I still prefer directly modifying pbentry.dat and pbnumber.dat for reading/ writing the phonebook as they are more powerful (street address flags, for example, do not appear in the 0xf1 protocol). -Nathan |