Changeset 2409

Show
Ignore:
Timestamp:
08/05/07 21:56:48 (1 year ago)
Author:
dgollub
Message:

struct member objtype in irmc_database is uneeeded.
dropped test connection code....

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/irmc-sync/src/irmc_sync.c

    r2408 r2409  
    340340} 
    341341 
    342 // TODO: drop me 
    343 #if 0 
    344 /** 
    345  * Tests whether a connection to a device with the given configuration can 
    346  * be established. 
    347  */ 
    348 int *test_connection( void *foo, const char *configuration, void *bar ) 
    349 { 
    350   osync_trace(TRACE_ENTRY, "%s(%p, %s, %p)", __func__, foo, configuration, bar);                         
    351   char data[10240]; 
    352   int size = 10240; 
    353   OSyncError *error = NULL; 
    354   irmc_config config; 
    355   int *result = (int*)malloc(sizeof(int)); 
    356  
    357   // parse the configuration 
    358   if (!parse_settings(&config, configuration, strlen(configuration), &error)) { 
    359     osync_error_unref(&error); 
    360     *result = 0; 
    361     osync_trace(TRACE_EXIT, "%s: %p", __func__, result); 
    362     return result; 
    363   } 
    364  
    365   config.obexhandle = irmc_obex_client(&config); 
    366  
    367   // connect to the device 
    368   if (!irmc_obex_connect(config.obexhandle, config.donttellsync ? NULL : "IRMC-SYNC", &error)) { 
    369     osync_error_unref(&error); 
    370     if (!irmc_obex_disconnect(config.obexhandle, &error)) 
    371       osync_error_unref(&error); 
    372  
    373     *result = 0; 
    374     osync_trace(TRACE_EXIT, "%s: %p", __func__, result); 
    375     return result; 
    376   } 
    377  
    378   memset( data, 0, sizeof( data ) ); 
    379   size = sizeof( data ); 
    380  
    381   // retrieve the 'telecom/devinfo.txt' file, which is available on all IrMC capable devices 
    382   if (!irmc_obex_get(config.obexhandle, "telecom/devinfo.txt", data, &size, &error)) { 
    383     osync_error_unref(&error); 
    384     if (!irmc_obex_disconnect(config.obexhandle, &error)) 
    385       osync_error_unref(&error); 
    386     irmc_obex_cleanup(config.obexhandle); 
    387  
    388     *result = 0; 
    389     osync_trace(TRACE_EXIT, "%s: %p", __func__, result); 
    390     return result; 
    391   } 
    392   data[ size ] = '\0'; 
    393  
    394   // succeeded to connect and fetch data 
    395   if (!irmc_obex_disconnect(config.obexhandle, &error)) 
    396     osync_error_unref(&error); 
    397   irmc_obex_cleanup(config.obexhandle); 
    398  
    399   *result = 1; 
    400   osync_trace(TRACE_EXIT, "%s: %p", __func__, result); 
    401   return result; 
    402 } 
    403 #endif 
    404  
    405342/** 
    406343 * Creates the calendar specific changeinfo for slow- and fastsync 
  • plugins/irmc-sync/src/irmc_sync.h

    r2408 r2409  
    7272typedef struct irmc_database { 
    7373  OSyncObjFormat *objformat;     // The configured objformat for this database 
    74   char *objtype;                 // The objtype of the database 
    7574} irmc_database; 
    7675