sim-modem/main.go

32 lines
625 B
Go
Raw Normal View History

2024-07-18 16:34:26 +00:00
package main
import (
"log"
2024-07-23 16:02:28 +00:00
"os"
2024-07-22 15:53:34 +00:00
"github.com/CGSG-2021-AE4/modem-test/api/modem"
2024-07-18 16:34:26 +00:00
)
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 {
2024-07-23 16:02:28 +00:00
m := modem.New(log.New(os.Stdout, "modem:", log.LstdFlags))
2024-07-23 19:04:15 +00:00
log.Println("||||||||||||||||| INIT |||||||||||||||")
2024-07-23 14:59:26 +00:00
if err := m.Init(); err != nil {
return err
}
2024-07-26 19:58:34 +00:00
if !m.Validate() {
log.Println("AAAAAAAAAAAAAAA Validation failed")
return nil
}
2024-07-23 19:04:15 +00:00
log.Println("||||||||||||||||| GET INFO |||||||||||||||||")
2024-07-25 14:05:15 +00:00
log.Println(m.GetInfo())
2024-07-23 14:59:26 +00:00
return nil
2024-07-18 16:34:26 +00:00
}