1SYNCE_INFO_NEW(3) http://www.synce.org/ SYNCE_INFO_NEW(3)
2
3
4
6 synce_info_new - allocate a new SynceInfo struct
7
9 #include <synce.h>
10
11 SynceInfo *synce_info_new(const char *device_name);
12
13 void synce_info_destroy(SynceInfo *info);
14
15 const char *synce_info_get_name(SynceInfo *info);
16 bool synce_info_get_os_version(SynceInfo *info, int os_major, int os_minor);
17 int synce_info_get_build_number(SynceInfo *info);
18 int synce_info_get_processor_type(SynceInfo *info);
19 const char *synce_info_get_os_name(SynceInfo *info);
20 const char *synce_info_get_model(SynceInfo *info);
21 const char *synce_info_get_device_ip(SynceInfo *info);
22 const char *synce_info_get_local_ip(SynceInfo *info);
23 int synce_info_get_partner_id_1(SynceInfo *info);
24 int synce_info_get_partner_id_2(SynceInfo *info);
25 const char *synce_info_get_object_path(SynceInfo *info);
26 pid_t synce_info_get_dccm_pid(SynceInfo *info);
27 const char *synce_info_get_transport(SynceInfo *info);
28 const char *synce_info_get_password(SynceInfo *info);
29 int synce_info_get_key(SynceInfo *info);
30
32 The synce_info_new() function returns a pointer to a newly allocated
33 and populated SynceInfo struct for a mobile device.
34
35 If device_name is non-NULL, the returned struct relates to a mobile
36 device with that name, or NULL if no device of that name is connected.
37
38 If device_name is NULL, the exact behaviour depends on the flavour of
39 dccm daemon in use. When using vdccm(1) or the deprecated dccm(1), the
40 current active device is selected. This is usually the last device con‐
41 nected, specifically that described in the active_connection file which
42 is by default in the ~/.synce/ directory. With odccm(1) the first
43 device connected will be returned. With synce-hal this depends on the
44 device(s) in question, and should be considered undefined.
45
46 This struct should be freed with synce_info_destroy(3).
47
48 typedef struct _SynceInfo {
49 pid_t dccm_pid; /* process id of dccm daemon */
50 char* device_ip; /* device ip address */
51 char* local_iface_ip; /* local interface ip address */
52 char* password; /* device password */
53 int key; /* device pass key */
54 int os_major; /* device OS major version */
55 int os_minor; /* device OS minor version */
56 int build_number; /* OS build number */
57 int processor_type; /* device processor */
58 int partner_id_1; /* first sync partner id number */
59 int partner_id_2; /* second sync partner id number */
60 char* name; /* device name */
61 char* os_name; /* device OS name eg. PocketPC */
62 char* model; /* device hardware name */
63 char* transport; /* interface type */
64 char* object_path; /* path to device's information */
65 } SynceInfo;
66
67 These fields must be accessed with the synce_info_get_ functions. The
68 particular fields populated depend on the flavour of dccm daemon in
69 use.
70
71 The use of dccm(1) is deprecated. When using vdccm(1) all fields are
72 populated except for local_iface_ip and os_minor. With odccm(1) and
73 synce-hal, dccm_pid, password, key, build_number, partner_id_1 and
74 partner_id_2 are not used. odccm(1) also does not populate
75 local_iface_ip.
76
78 The synce_info_new() function returns a pointer to the allocated Synce‐
79 Info struct, or NULL if an error occured.
80
82 synce(7), odccm(1), vdccm(1)
83
84
85
86The SynCE Project 2007-08-26 SYNCE_INFO_NEW(3)