diff --git a/lockserver/saltolockserver.go b/lockserver/saltolockserver.go index 543e12b..49911db 100644 --- a/lockserver/saltolockserver.go +++ b/lockserver/saltolockserver.go @@ -31,8 +31,8 @@ func calculateLRC(data []byte) byte { func (lock *SaltoLockServer) BuildCommand(req DoorCardRequest, checkIn, checkOut time.Time) error { // helper: hh[mm]DDMMYY fmtStamp := func(t time.Time) string { - return fmt.Sprintf("%02d%02d%02d%02d%02d", - t.Hour(), t.Minute(), t.Day(), int(t.Month()), t.Year()%100) + return fmt.Sprintf("%02d%02d%02d%02d", + t.Hour(), t.Day(), int(t.Month()), t.Year()%100) } start := fmtStamp(checkIn) expiry := fmtStamp(checkOut) @@ -151,8 +151,8 @@ func (lock *SaltoLockServer) LockSequence() error { return err } defer conn.Close() - - reader := bufio.NewReader(conn) + + reader := bufio.NewReader(conn) // 1. Send ENQ log.Infof("Sending ENQ") @@ -210,11 +210,11 @@ func (lock *SaltoLockServer) LockSequence() error { case b1 == 'C' && b2 == 'C': log.Infof("LockSequence: command response is CC (follow-up)") case b1 == 'T' && b2 == 'D': - log.Warnf("LockSequence: command response is TD (room does not exist)") - return fmt.Errorf("lock response indicates 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: %q", string(resp)) default: 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 { log.Warnf("LockSequence: response too short: %q", string(resp)) diff --git a/main.go b/main.go index 83c2caa..14278cd 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,7 @@ import ( ) const ( - buildVersion = "1.0.19" + buildVersion = "1.0.20" serviceName = "hardlink" customLayout = "2006-01-02 15:04:05 -0700" transactionUrl = "http://127.0.0.1:18181/start-transaction/" diff --git a/release notes.md b/release notes.md index a0d1cec..9175d7b 100644 --- a/release notes.md +++ b/release notes.md @@ -2,6 +2,9 @@ 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 allowed to continue if the connection to the lock server fails at startup