1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
import java.io.*;
public class test {
public static void main(String[] args) throws IOException, Pdapilot.DlpException {
System.out.println("Compiled with pilot-link " +
Pdapilot.constants.PILOT_LINK_VERSION + "." +
Pdapilot.constants.PILOT_LINK_MAJOR + "." +
Pdapilot.constants.PILOT_LINK_MINOR);
System.out.print("Port to use [/dev/cua3]? ");
System.out.flush();
String port = Pdapilot.Util.readLine();
if (port.equals("")) {
port = "/dev/cua3";
}
System.out.println("Please hit the HotSync button now.");
Pdapilot.Socket x = new Pdapilot.Socket(port);
Pdapilot.Dlp y = x.accept();
System.out.println(y.getTime().toString());
System.out.println(y.getUserInfo().toString());
System.out.println(y.getSysInfo().toString());
//System.out.println(y.getNetInfo().toString());
for (int i=0;;i++) {
Pdapilot.CardInfo c = y.getCardInfo(i);
if (c == null)
break;
System.out.println("Card #" + i + ": " + c.toString() );
}
for (int i=0;;i++) {
Pdapilot.DBInfo d = y.getDBInfo(i, true, true, 0);
if (d == null)
break;
System.out.println("DB #" + i + ": " + d.toString() );
}
Pdapilot.DB z = y.open(new Pdapilot.appointment.Database());
Pdapilot.RecordID ids[] = z.getRecordIDs(false, 0, 0xffff);
for (int i=0;i<ids.length;i++) {
System.out.print(ids[i].toString()+" ");
}
System.out.println("");
System.out.println(z.getAppBlock().toString());
Pdapilot.Pref p;
p = z.getPref(0);
if (p != null)
System.out.println(p.toString());
p = z.getPref(1);
if (p != null)
System.out.println(p.toString());
p = z.getPref(2);
if (p != null)
System.out.println(p.toString());
p = z.getPref(3);
if (p != null)
System.out.println(p.toString());
for (int i=0;;i++) {
Pdapilot.Record q = (Pdapilot.Record)z.getRecord(i);
if (q == null)
break;
System.out.println("Record #" + i +": " + q.toString() );
//z.setRecord(q);
}
Pdapilot.expense.Record newRecord = new Pdapilot.expense.Record();
newRecord.payment = Pdapilot.expense.payment.Check;
System.out.println(newRecord);
y.close(Pdapilot.end.Normal);
System.out.println("Done!");
}
}
|