for (DeviceInfo d : devices) {
System.out.println("Device " + d.getId() + (d.getId() == m.getDeviceId() ? " (this device)" : "") + ":");
System.out.println(" Name: " + d.getName());
for (DeviceInfo d : devices) {
System.out.println("Device " + d.getId() + (d.getId() == m.getDeviceId() ? " (this device)" : "") + ":");
System.out.println(" Name: " + d.getName());
- System.out.println(" Created: " + d.getCreated());
- System.out.println(" Last seen: " + d.getLastSeen());
+ System.out.println(" Created: " + formatTimestamp(d.getCreated()));
+ System.out.println(" Last seen: " + formatTimestamp(d.getLastSeen()));
- m.receiveMessages(timeout, returnOnTimeout, new ReceiveMessageHandler(m));
+ m.receiveMessages((long) (timeout * 1000), TimeUnit.MILLISECONDS, returnOnTimeout, new ReceiveMessageHandler(m));
- m.receiveMessages(3600, false, new DbusReceiveMessageHandler(m, conn));
+ m.receiveMessages(1, TimeUnit.HOURS, false, new DbusReceiveMessageHandler(m, conn));
Subparser parserReceive = subparsers.addParser("receive");
parserReceive.addArgument("-t", "--timeout")
Subparser parserReceive = subparsers.addParser("receive");
parserReceive.addArgument("-t", "--timeout")
.help("Number of seconds to wait for new messages (negative values disable timeout)");
Subparser parserDaemon = subparsers.addParser("daemon");
.help("Number of seconds to wait for new messages (negative values disable timeout)");
Subparser parserDaemon = subparsers.addParser("daemon");