commit | f7e3a0c1cdc9d9c6c4c596701b7ef4501e526ad2 | [log] [tgz] |
---|---|---|
author | Ankur <ataly@google.com> | Fri May 29 12:04:14 2015 -0700 |
committer | Ankur <ataly@google.com> | Fri May 29 12:04:15 2015 -0700 |
tree | 55e24c3a5faa15d31b794e5c3b1c3261f8870f43 | |
parent | 1c15b586a6f6113d3f8b583c7a1e09ccc3c0e9b3 [diff] |
"physical-lock": Simplify scanning for lock devices This CL simplifies the mechanism for discovering lock devices by globbing the neighborhood. Major changes 1) neighborhood-name under which a lock device's mounttable is made visible is always of the form "lock-<lock name>", regardless of whether the lock is claimed or unclaimed. Therefore discovering lock devices simply requires a glob with the pattern "nh/lock-*". This is a purely local operation at the clients. All locks objects are accessible, by convention, under the name "nh/lock-<lock name>/lock. 2) The command for scanning lock objects globs over the neighborhood in a loop in order to accomodate for any time lags in listening to MDNS advertisments from the lock devices. Minor change: The command for scanning for lock objects is renamed from "find-locks" to "scan". Change-Id: Ie95b7dcffae7bc3a67de6b06b2e125a2359b09f4
This is an example application built on the Vanadium stack.
Features to add to the Lock server:
AuditLog(startTime, endTime time.Time) []AuditLog | error type AuditLog struct { Blessing string Action LockStatus Timestamp time.Time }
We'd also have to work out how to control access to this AuditLog. One option is to use caveats - so when “making” a new key one can choose to insert the “noadmin” caveat?
Features to add to the Lock client:
sendkey <lockname> <email>
sendkey sends a key for the specified lock and any principal with the specified <email>
who is currently running a recvkey
command.Apologies for this unconventional, possibly unreadable circuit representation. Putting it down so that the author can remember! TODO(ashankar): Clean it up!
The pin number assignments here work both for RaspberryPi Model B/B+ and RaspberryPi2-ModelB.
---(Pin 1)-------/\/\(10KΩ)/\/\---------(COM port of magnetic switch) \ \----/\/\(1KΩ)/\/\---------(Pin 15 = GPIO22) \ \----(LED)-----| | | (N.O. port of magnetic switch)--| | | (-ve terminal of active buzzer)--| | | | (Pin 6 = GND)--| ---(Pin 11 = GPIO17)-----------(+ terminal of active buzzer)
To build for the RaspberryPi setup with the circuitry mentioned above:
v23 go get -u github.com/davecheney/gpio V23_PROFILE=arm v23 go install v.io/x/lock/lockd scp $V23_ROOT/release/projects/physical-lock/go/bin/lockd <rpi_scp_location>
If building without the arm
profile, there are no physical switches/relays and instead a simulated hardware is used that uses the interrupt signal (SIGINT) to simulate locking/unlocking externally.