removed minutes from the start and expiry time in Salto lock command
This commit is contained in:
parent
da5cafe031
commit
04c664294d
@ -31,8 +31,8 @@ func calculateLRC(data []byte) byte {
|
|||||||
func (lock *SaltoLockServer) BuildCommand(req DoorCardRequest, checkIn, checkOut time.Time) error {
|
func (lock *SaltoLockServer) BuildCommand(req DoorCardRequest, checkIn, checkOut time.Time) error {
|
||||||
// helper: hh[mm]DDMMYY
|
// helper: hh[mm]DDMMYY
|
||||||
fmtStamp := func(t time.Time) string {
|
fmtStamp := func(t time.Time) string {
|
||||||
return fmt.Sprintf("%02d%02d%02d%02d%02d",
|
return fmt.Sprintf("%02d%02d%02d%02d",
|
||||||
t.Hour(), t.Minute(), t.Day(), int(t.Month()), t.Year()%100)
|
t.Hour(), t.Day(), int(t.Month()), t.Year()%100)
|
||||||
}
|
}
|
||||||
start := fmtStamp(checkIn)
|
start := fmtStamp(checkIn)
|
||||||
expiry := fmtStamp(checkOut)
|
expiry := fmtStamp(checkOut)
|
||||||
@ -152,7 +152,7 @@ func (lock *SaltoLockServer) LockSequence() error {
|
|||||||
}
|
}
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
|
||||||
reader := bufio.NewReader(conn)
|
reader := bufio.NewReader(conn)
|
||||||
|
|
||||||
// 1. Send ENQ
|
// 1. Send ENQ
|
||||||
log.Infof("Sending ENQ")
|
log.Infof("Sending ENQ")
|
||||||
@ -210,11 +210,11 @@ func (lock *SaltoLockServer) LockSequence() error {
|
|||||||
case b1 == 'C' && b2 == 'C':
|
case b1 == 'C' && b2 == 'C':
|
||||||
log.Infof("LockSequence: command response is CC (follow-up)")
|
log.Infof("LockSequence: command response is CC (follow-up)")
|
||||||
case b1 == 'T' && b2 == 'D':
|
case b1 == 'T' && b2 == 'D':
|
||||||
log.Warnf("LockSequence: command response is TD (room does not exist)")
|
log.Warnf("LockSequence: command response is TD (room does not exist): %q", string(resp))
|
||||||
return fmt.Errorf("lock response indicates room does not exist")
|
return fmt.Errorf("lock response indicates room does not exist: %q", string(resp))
|
||||||
default:
|
default:
|
||||||
log.Warnf("LockSequence: unexpected command response %q", string(resp))
|
log.Warnf("LockSequence: unexpected command response %q", string(resp))
|
||||||
return fmt.Errorf("error encoding keycard, unexpected response")
|
return fmt.Errorf("error encoding keycard, unexpected response: %q", string(resp))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.Warnf("LockSequence: response too short: %q", string(resp))
|
log.Warnf("LockSequence: response too short: %q", string(resp))
|
||||||
|
|||||||
2
main.go
2
main.go
@ -29,7 +29,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
buildVersion = "1.0.19"
|
buildVersion = "1.0.20"
|
||||||
serviceName = "hardlink"
|
serviceName = "hardlink"
|
||||||
customLayout = "2006-01-02 15:04:05 -0700"
|
customLayout = "2006-01-02 15:04:05 -0700"
|
||||||
transactionUrl = "http://127.0.0.1:18181/start-transaction/"
|
transactionUrl = "http://127.0.0.1:18181/start-transaction/"
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
builtVersion is a const in main.go
|
builtVersion is a const in main.go
|
||||||
|
|
||||||
|
#### 1.0.20 - 06 October 2025
|
||||||
|
removed minutes from the start and expiry time in Salto lock command
|
||||||
|
|
||||||
#### 1.0.19 - 10 September 2025
|
#### 1.0.19 - 10 September 2025
|
||||||
allowed to continue if the connection to the lock server fails at startup
|
allowed to continue if the connection to the lock server fails at startup
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user