sim-modem/main.go
2024-07-26 22:58:34 +03:00

32 lines
625 B
Go

package main
import (
"log"
"os"
"github.com/CGSG-2021-AE4/modem-test/api/modem"
)
func main() {
log.Println("CGSG forever!!!")
if err := mainE(); err != nil {
log.Println("MAIN finished with error:", err.Error())
}
log.Println("END")
}
func mainE() error {
m := modem.New(log.New(os.Stdout, "modem:", log.LstdFlags))
log.Println("||||||||||||||||| INIT |||||||||||||||")
if err := m.Init(); err != nil {
return err
}
if !m.Validate() {
log.Println("AAAAAAAAAAAAAAA Validation failed")
return nil
}
log.Println("||||||||||||||||| GET INFO |||||||||||||||||")
log.Println(m.GetInfo())
return nil
}