ColdSync::SPC

ColdSync::SPC(3)      User Contributed Perl Documentation     ColdSync::SPC(3)



NAME
       SPC - Allows ColdSync conduits to communicate with the Palm.

SYNOPSIS
           use ColdSync;
           use ColdSync::SPC;


DESCRIPTION
       The SPC package includes functions for sending Serialized Request
       Protocol (SPC) requests in ColdSync conduits.

FUNCTIONS
       dlp_req

           ($err, @argv) = &dlp_req($reqno, @args)

       Sends a DLP request over SPC. $reqno is the DLP request number; @args
       is the array of DLP arguments.

       $err is the DLP return status; @argv is the array of values returned
       from the Palm.

       This is a fairly low-level function. It is much easier to use one of
       the DLP wrapper functions. However, not every DLP function has been
       implemented yet.

       spc_get_dbinfo

               $dbinfo = &spc_get_dbinfo();

       Returns a reference to a hash containing information about the database
       currently being synchronized:

               $dbinfo->{size}
               $dbinfo->{misc_flags}
               $dbinfo->{db_flags}
               $dbinfo->{type}
               $dbinfo->{creator}
               $dbinfo->{version}
               $dbinfo->{modnum}
               %{$dbinfo->{ctime}}
               %{$dbinfo->{mtime}}
               %{$dbinfo->{baktime}}
               $dbinfo->{db_index}
               $dbinfo->{name}

       The size field indicates the size of the database information block,
       and is not at all useful here.

       The creator and type fields are four-character strings specifying the
       creator and type of the databse.

       The version field indicates the version of the database.

       The modnum field indicates the modification number of the database.
       Each time the database is modified, this number is incremented. Since
       there is no mechanism within ColdSync to keep this number consistent
       between the Palm and the desktop, this number is not very useful.

       The name field gives the name of the database.

       $dbinfo->{ctime}, $dbinfo->{mtime}, and $dbinfo->{baktime} indicate the
       creation, modification, and backup time of the database. They are all
       of the following form:

               $dbinfo->{ctime}{year}
               $dbinfo->{ctime}{month}
               $dbinfo->{ctime}{day}
               $dbinfo->{ctime}{hour}
               $dbinfo->{ctime}{minute}
               $dbinfo->{ctime}{second}


       dlp_ReadSysInfo

               $sysinfo = &dlp_ReadSysInfo();

       Returns a reference to a hash containing information about the Palm:

               $sysinfo->{ROM_version}
               $sysinfo->{localization_ID}
               $sysinfo->{product_ID}
       The C<ROM_version> field indicates the version of the Palm's ROM.

       I don't know what the localization_ID field is.

       The product_ID indicates which particular model of Palm this is.

       The following fields may not be returned by all Palms:

               $sysinfo->{DLP_version}
               $sysinfo->{compat_version}
               $sysinfo->{maxrec}

       The DLP_version indicates the version of the DLP protocol that the Palm
       implements.

       I'm not sure what the compat_version field is. I suspect that it gives
       the earliest version of DLP with which this Palm is compatible.

       The maxrec field indicates the maximum size of a record or resource.

       dlp_OpenDB

               $dbh = &dlp_OpenDB($dbname, $mode);

       Opens a database on the Palm. $dbname is a string indicating the name
       of the database; the name of the current database can be gotten from
       &spc_get_dbinfo.

       $mode indicates how to open the database. It is the bitwise-or of any
       of the following values:

               0x80            Open for reading
               0x40            Open for writing
               0x20            Exclusive access
               0x10            Show secret records

       If successful, &dlp_OpenDB returns a database handle: a small integer
       that refers to the database that was just opened. The database handle
       will be passed to various other functions that operate on the database.

       If unsuccessful, &dlp_OpenDB returns undef.

       dlp_CloseDB

               &dlp_CloseDB($dbh);

       Closes the database associated with the database handle $dbh (see the
       dlp_OpenDB entry elsewhere in this document).

       dlp_ReadAppBlock

               $appinfo = &dlp_ReadAppBlock($dbh [, $offset, $len]);

       Reads the AppInfo block of the database associated with database handle
       $dbh (see the dlp_OpenDB entry elsewhere in this document).

       $offset is an integer specifying an offset from the beginning of the
       AppInfo block at which to start reading. $len is the length of the data
       to return.

       If omitted, $offset defaults to 0 (read from the beginning) and $len
       defaults to -1 (read to the end).

       The value returned by &dlp_ReadAppBlock is a string of binary data.  It
       is not parsed in any way.

       dlp_WriteAppBlock

               $err = &dlp_WriteAppBlock($dbh, $appinfo);

       Writes a new AppInfo block to the database indicated by database handle
       $dbh. $appinfo is a string of binary data, the raw AppInfo block; it is
       not parsed in any way.

       Returns the DLP error code.

SEE ALSO
       ColdSync(3)

       Palm::PDB(3)

       ColdSync Conduits: Specification and Hacker's Guide

AUTHOR
       Andrew Arensburger <arensb@ooblick.com>

BUGS
       ``SPC'' is a stupid name.



















3rd Berkeley Distribution    perl 5.005, patch 03             ColdSync::SPC(3)