package types

type PacketByte byte

const (
	StartShortByte byte = 0x78
	StartLongByte  byte = 0x79
	StopByte1      byte = 0x0D
	StopByte2      byte = 0x0A
)

const (
	PacketLong  int = 4
	PacketShort int = 3
)

const (
	GlobalPacketSize int8 = 10
)

type ExtractStatus int

type ProtocolNumber byte

type DateTime struct {
	Year   byte
	Month  byte
	Day    byte
	Hour   byte
	Minute byte
	Second byte
}

type DevicePacket struct {
	ProtocolNumber string `json:"protocol_number"`
	Frame          string `json:"frame"`
	Raw            []byte `json:"raw"`
	Ack            string `json:"return_packet"`
	PacketFrom     string `json:"packet_from"`
	Time           int64  `json:"time"` // this time is not converted into 5:30 ist it is a server time
}

// Division Connection Metrics Models

type ConnectionStatus string

const (
	CONNECTED    ConnectionStatus = "CONNECTED"
	DISCONNECTED ConnectionStatus = "DISCONNECTED"
)

type DeviceConnectionMetric struct {
	Imei      int64            `json:"imei"`
	Status    ConnectionStatus `json:"status"`
	TimeStamp int64            `json:"timestamp"`
}

type CommandRequestPacket struct {
	Imei       int64  `json:"imei"`
	UserID     string `json:"user_id"`
	ServerFlag string `json:"server_flag"`
	Command    string `json:"command"`
	TimeStamp  int64  `json:"timestamp"`
}

type CommandResponsePacket struct {
	Imei       int64  `json:"imei"`
	ServerFlag string `json:"server_flag"`
	Response   string `json:"response"`
	TimeStamp  int64  `json:"timestamp"`
}
