synce_info_new

Langue: en

Autres versions - même langue

Version: 2007-08-26 (fedora - 05/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

synce_info_new - allocate a new SynceInfo struct

SYNOPSIS

 #include <synce.h>
 
 SynceInfo *synce_info_new(const char *device_name);
 
 void synce_info_destroy(SynceInfo *info);
 

DESCRIPTION

The synce_info_new() function returns a pointer to a newly allocated and populated SynceInfo struct for a mobile device.

If device_name is non-NULL, the returned struct relates to a mobile device with that name, or NULL if no device of that name is connected.

If device_name is NULL, the exact behaviour depends on the flavour of dccm daemon in use. When using vdccm(1) or the deprecated dccm(1), the current active device is selected. This is usually the last device connected, specifically that described in the active_connection file which is by default in the ~/.synce/ directory. With odccm(1) the first device connected will be returned.

This struct should be freed with synce_info_destroy(3).

 typedef struct _SynceInfo {
     pid_t dccm_pid;      /* process id of dccm daemon */
     char* ip;            /* device ip address */
     char* password;      /* device password */
     int key;             /* device pass key */
     int os_version;      /* device OS major version */
     int os_minor;        /* device OS minor version */
     int build_number;    /* OS build number */
     int processor_type;  /* device processor */
     int partner_id_1;    /* first sync partner id number */
     int partner_id_2;    /* second sync partner id number */
     char* name;          /* device name */
     char* os_name;       /* device OS name eg. PocketPC */
     char* model;         /* device hardware name */
     char* transport;     /* interface type */
     int fd;              /* file descriptor for RAPI calls */
 } SynceInfo;
 

The particular fields populated depend on the flavour of dccm daemon in use.

The use of dccm(1) is deprecated. When using vdccm(1) all fields are populated except for fd and os_minor. With odccm(1) and synce-hal, dccm_pid, password, key, build_number, partner_id_1 and partner_id_2 are not used.

RETURN VALUE

The synce_info_new() function returns a pointer to the allocated SynceInfo struct, or NULL if an error occured.

SEE ALSO

synce(7), odccm(1), vdccm(1)