Refactor and enhance handling of payloads and data structures

Added support for handling various payload types, including GPS and alarms, with new structures and constants. Introduced helper methods for JSON marshalling/unmarshalling of GPS data and modularized the handling of certificates, configurations, and alarms. Implemented foundational server code for testing and expanded several package functionalities.
This commit is contained in:
2025-02-22 19:23:16 +03:00
parent f3083820dc
commit 16da4affa8
7 changed files with 607 additions and 61 deletions

View File

@ -23,7 +23,7 @@ const (
type CertificateConnectRequest struct {
Net NetConnectionType `json:"NET"`
SerialNumber string `json:"DNSO"`
SerialNumber string `json:"DSNO"`
DeviceName string `json:"DEVNAME"`
ChannelsNumber uint `json:"CHANNEL"`
LicensePlate string `json:"CARNUM"`
@ -35,6 +35,25 @@ type CertificateConnectRequest struct {
EvidenceSupport string `json:"EV"`
}
type CertificateConnectResponse struct {
ErrorCode uint `json:"ERRORCODE"`
ErrorCause string `json:"ERRORCAUSE"`
CommandMask uint `json:"MASKCMD"`
}
type CommandMaskParameters uint
const (
CommandMaskAlarm = 1 << iota
CommandMaskScanningGun
CommandMaskPassengerFlow
CommandMaskFaceContrast
CommandMaskCard
CommandMaskShutdownReport
CommandMaskGPSReport
CommandMaskAll = 0b1111111
)
/*
func (e *Package) RequestConnect(session string, serial string, numOfCams int) {
e.Payload = map[string]any{