The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)
Sync plugins
(Running sync over USB and bluetooth with libsyncml tool) |
|||
Line 32: | Line 32: | ||
<code>./gen_template.py -c storage-plugin.cfg -d <output dir></code> | <code>./gen_template.py -c storage-plugin.cfg -d <output dir></code> | ||
+ | |||
+ | == Sync with libsyncml == | ||
+ | [[https://libsyncml.opensync.org libsyncml ref]] | ||
+ | |||
+ | Buteo works with libsyncml over USB as well as bluetooth. | ||
+ | |||
+ | Following are the sequence of steps to perform this sync operation over USB | ||
+ | 1. Connect the Sailfish based device to your PC over USB. | ||
+ | 2. Select the MTP mode when asked for a USB mode selection | ||
+ | 3. From the PC (Ubuntu or a version supporting libsyncml), install libsyncml-utils (in debian, 'sudo apt-get install libsyncml-utils) | ||
+ | 4. Run the following sync command for USB: | ||
+ | |||
+ | <code> sudo syncml-ds-tool -u 1 --identifier "PC Suite" --sync text/x-vcard Contacts </code> | ||
+ | |||
+ | Note: The command has to run as 'sudo', else you will have to add the USB device into your udev list | ||
+ | 5. The above command should fetch all the contacts in the Sailfish phone to your PC and dump the output to the screen. For more options of syncml-ds-tool, look at its help or the libsyncml website | ||
+ | |||
+ | For synchronizing of contacts over bluetooth, below are the steps | ||
+ | 1. Pair your bluetooth enabled PC/laptop with Sailfish based device. Also enable the bluetooth options of "connect automatically" and "trust" | ||
+ | 2. Find out the bluetooth address of the sailfish based device by running the hcitool. | ||
+ | |||
+ | <code> hcitool scan </code> | ||
+ | |||
+ | 3. Run the following sync command: | ||
+ | |||
+ | <code> syncml-ds-tool -b <bluetooth address> 26 --identifier "PC Suite" --sync text/x-vcard Contacts </code> | ||
+ | |||
+ | 26 is the channel number of the SyncML bluetooth profile | ||
+ | Replace <bluetooth address> with the bluetooth address of your sailfish device (something like B4:EE:D4:F6:19:E7) | ||
+ | 4. The above command should fetch all the contacts in the Sailfish device to your PC and dump the output to the screen. | ||
--[[User:Kavuri|Kavuri]] 11:22, 22 August 2013 (UTC) | --[[User:Kavuri|Kavuri]] 11:22, 22 August 2013 (UTC) |
Revision as of 09:35, 3 September 2013
Contents |
Types of plugins
There are three kinds of sync plugins 1. Client plugin 2. Server plugin 3. Storage plugin
1. The client plugins as the name indicates is the client side part of a synchronization activitiy. For example, synchronization with Google services from the device would involve a client plugin and Google services acting as a server. The client plugins would be loaded on demand and would be unloaded once the sync activity is over. More than one client plugin can be loaded at any point of time, provided that they deal with different kinds of storages (contacts, calendar, notes etc.)
2. The server plugins enable a server role for the synchronization. A server plugin acts as a server for an external client to connect to. An example of a server plugin is a SyncML sync between two devices. When sync happens between two devices, one of the device has to act as a server. The protocol would be responsible for deciding the roles between the two devices. Whenever a device acts as a server, the server plugin is responsible for handling the server side activities. A server plugin is not unloaded for ever, since any client can connect to it at any point of time
3. A storage plugin is one that enables synchronization of a particular storage for a sync session. For example, a contacts storage plugin will be loaded for the duration of the sync session, would perform the sync activities between the sync agent (protocol) and the database (like store/retrieve) and gets unloaed once the sync session is over.
Creating a plugin
The buteo-syncfw comes with a tools package to create template plugin code that will help the developer to quickly create plugins
The tool uses Cheetah (www.cheetahtemplate.org/) template library to generate the templates. One can install cheetah in Ubuntu using command: 'sudo apt-get install python-cheetah'. Python 2.7 or greater is required
Instructions for generating template
The configuration files corresponding to a client/server/storage have to be filled-in with the appropriate information. Each of the fields in the config files are marked with MANDATORY/OPTIONAL. Info about the fields is provided in the config files
To generate client plugin, run the command:
./gen_template.py -c client-plugin.cfg -d <output dir>
To generate server plugin, run the command:
./gen_template.py -c server-plugin.cfg -d <output dir>
To generate storage plugin, run the command:
./gen_template.py -c storage-plugin.cfg -d <output dir>
Sync with libsyncml
Buteo works with libsyncml over USB as well as bluetooth.
Following are the sequence of steps to perform this sync operation over USB
1. Connect the Sailfish based device to your PC over USB. 2. Select the MTP mode when asked for a USB mode selection 3. From the PC (Ubuntu or a version supporting libsyncml), install libsyncml-utils (in debian, 'sudo apt-get install libsyncml-utils) 4. Run the following sync command for USB:
sudo syncml-ds-tool -u 1 --identifier "PC Suite" --sync text/x-vcard Contacts
Note: The command has to run as 'sudo', else you will have to add the USB device into your udev list 5. The above command should fetch all the contacts in the Sailfish phone to your PC and dump the output to the screen. For more options of syncml-ds-tool, look at its help or the libsyncml website
For synchronizing of contacts over bluetooth, below are the steps
1. Pair your bluetooth enabled PC/laptop with Sailfish based device. Also enable the bluetooth options of "connect automatically" and "trust" 2. Find out the bluetooth address of the sailfish based device by running the hcitool.
hcitool scan
3. Run the following sync command:
syncml-ds-tool -b <bluetooth address> 26 --identifier "PC Suite" --sync text/x-vcard Contacts
26 is the channel number of the SyncML bluetooth profile Replace <bluetooth address> with the bluetooth address of your sailfish device (something like B4:EE:D4:F6:19:E7) 4. The above command should fetch all the contacts in the Sailfish device to your PC and dump the output to the screen.
--Kavuri 11:22, 22 August 2013 (UTC)