(7) Introduction to IRMC
To achieve a synchronization of the communication, the calendar, and sign, you need to use the IRMC section in the IRDA protocol.
IRMC is all called IR Mobile Communications. It defines the rules of communication between devices that use IR wireless transmission. The IRMC protocol document describes the side of the IRMC, which can be downloaded to the PDF version in my home page (http://dream-world.nease.net).
The following mainly tells the parts and implementation methods used in development. For more detailed information, please refer to the IRMC protocol.
Phonebook
The management of mobile phone software desktop communication is one of the essential features of the entire software, using its information to be easily synchronized with software such as Outlook, and achieve more powerful functions.
The management of communication is divided into read, delete, add, modify. A more powerful synchronization feature can be achieved by a combination of these functions. Summary below.
l Read
n Read all Entry Use the Obex GET command to get the /TElecM/PB.vcf file. The resulting file is a vcard file that contains all the communication thin. The format is a VCARD format. About the brief introduction of VCARD and the encoder decoder see it. Below is given below: begin: vcardversion: 2.1x-irmc-luid: 1017646x-esi-categories; charSet = UTF-8; Encoding = quoted-printable: = E5 = AE = B6 = E4 = ba = BAN: TestAdr: CETRYORG: Company; Home: 123456tel; Cell: 123456tel; fax: 123456tel; fax; home: 123456email; Internet: a@aoemail; home; internet: b @ GURL : httpbday:
1985-04-23
END: VCARD can also achieve the corresponding VCARD directly via the LUID number given by X-IRMC-LUID.
1. Read the entry of the specified Luid using the Obex's get command to get /Telecom/PB/luid/xxxx.vcf, where xxxx represents the Luid number. Get it is still a vcard file, but only VCARD information containing only a specific LUID number. You can simply view the information contained in VCARD through Outlook.
l Delete wants to remove an Entry
1. Connect to IRMC_SYNC_SERVICE (send 0x80, 0x0, 0x13, 0x10, 0x0, 0x40, 0x6, 0x46, 0x0, 0xc, 0x49, 0x52, 0x4d, 0x43, 0x2d, 0x53, 0x59, 0x4e, 0x43) to make the phone in synchronization status .
2. Get ChangeCount
ChangeCount is a value of the number of modifications in the phone, mainly for synchronization. Please refer to the IRMC protocol for specific information.
3. Build a packet. Opcode: PutnameHeader: XXXX.VCF (xxxx For the Entry's Luid's Luid) AppPaAm: 0x11, Changcount String Form Length (Integer), ChangeCount ANSI Form
4. Use the Obex's PUT command to transfer an XXXX.vcf (XXXX, LUID) empty file to / Telecom / PB / Luid overwritten.
5. Send 0x81, 0x0, 0x3 to disconnect IRMC_SYNC_SERVICE
l Adding a file:
1. Connect to IRMC_SYNC_SERVICE
2. Get the ChangeCount3. Build a Packet Opcode: PutnameHeader: .vcfappheader: 0x11, ChangeCount String Length (Interger), changcount ANSI Form Body or end-of-body header: VCF file content
4. Obex's PUT command is uploaded to the /telecom/pb/.vcf file. Note: The file name is named ".vcf".
5. Send 0x81, 0x0, 0x3 to disconnect IRMC_SYNC_SERVICE
l Modifying the modification The process is similar to the adding process, just change the file name to the VCARD of the VCARD to modify. VCF.
Notes
The cascading is the functionality provided by most mobile phones, and it is convenient to record short information. In my M55 mobile phone, you can store 150byte information, which is 150 English or 75 Chinese characters. The software can be synchronized with software such as Outlook by administrative stilers to achieve more advanced features.
Manage Notes methods and PhoneBook is similar. Get all NOTES's VNOTE only needs to get /TElecom/nt.vnt. Delete, add, modification only needs to change the / Telecom / PB / Luid to / Telecom / NT / Luid. Not described herein.
The Calendar calendar feature provides an event reminder, divided into important Notepads (VEVENT) and Tasks (VTODO). Through the management calendar, you can also achieve synchronization with Outlook, and realize the synchronization of your computer and your phone.
Manage Calendar method and PhoneBook is similar. Get all Vcalendar only needs to get /TElecom/cal.vcs. Delete, add, modify only to change the / Telecom / PB / Luid to / Telecom / Cal / Luid. Not described herein.
But it is worth noting that Vcalendar's structure
Begin: vcalendar
Version: 1.0
Begin: vevent
.
END: VEVENT
Begin: vtodo
...
End: vtodo
End: vcalendar
Complete Vcalender contains at least one VEVENT or a VTODO, so adds, modifying VEVENT, VTODO, adds it to a complete Vcalender structure, otherwise the server will refuse.
I have encountered problems:
In actual operation, there is a problem in the PHONEBOOK part. When my mobile phone first synchronizes the database, the database is locked, and it is also the same as SIMOCO, indicating that the phone refuses to write. At this time, turn off the phone and restart it. As for the reason, I have not figured out, I hope I can have a high person.