feat: build vehicle data platform and production pipeline
This commit is contained in:
@@ -12,6 +12,7 @@ var ErrResponseFrameTooShort = errors.New("gb32960 response frame too short")
|
||||
|
||||
const (
|
||||
responseSuccess = byte(0x01)
|
||||
responseError = byte(0x02)
|
||||
responseCommand = byte(0xfe)
|
||||
encryptNone = byte(0x01)
|
||||
)
|
||||
@@ -37,7 +38,11 @@ func AutoResponse(raw []byte, env envelope.FrameEnvelope) ([]byte, bool, error)
|
||||
if timestamp := responseTime(raw, command); !timestamp.IsZero() {
|
||||
body = encodeGBTime(timestamp)
|
||||
}
|
||||
return buildResponse(raw[0], command, responseSuccess, raw[4:21], body), true, nil
|
||||
responseFlag := responseSuccess
|
||||
if command == 0x05 && env.AuthenticationEnforced && env.AuthenticationStatus != "accepted" {
|
||||
responseFlag = responseError
|
||||
}
|
||||
return buildResponse(raw[0], command, responseFlag, raw[4:21], body), true, nil
|
||||
}
|
||||
|
||||
func shouldRespond(command byte) bool {
|
||||
|
||||
Reference in New Issue
Block a user