From b3fb13b7b36d1e13d7b18d31247064d11c34ff27 Mon Sep 17 00:00:00 2001 From: Andrey Egorov Date: Fri, 9 Aug 2024 11:42:55 +0300 Subject: [PATCH] Removed internet and sms temporarily. --- api/modem/modem.go | 26 +++++++++++++------------- main.go | 16 ++++++++-------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/api/modem/modem.go b/api/modem/modem.go index d15ccb7..df6726e 100644 --- a/api/modem/modem.go +++ b/api/modem/modem.go @@ -112,19 +112,19 @@ func (m *modem) Init() error { // submodulesLogger := io.Discard // FOR less logs m.logger.Println("=============================== Init submodules") - m.ic = internet.New(log.New(submodulesLogger, "modem-internet : ", log.LstdFlags), m.port) - if err := m.ic.Init(); err != nil { - m.logger.Printf("\x1b[38;2;255;0;0mInternet: %s\x1b[38;2;255;255;255m\n", err.Error()) - } else { - m.logger.Println("\x1b[38;2;0;255;0mInternet OK\x1b[38;2;255;255;255m") - } - - m.sms = sms.New(log.New(submodulesLogger, "modem-sms : ", log.LstdFlags), m.port) - if err := m.sms.Init(); err != nil { - m.logger.Printf("\x1b[38;2;255;0;0mSMS: %s\x1b[38;2;255;255;255m\n", err.Error()) - } else { - m.logger.Println("\x1b[38;2;0;255;0mSMS OK\x1b[38;2;255;255;255m") - } + //m.ic = internet.New(log.New(submodulesLogger, "modem-internet : ", log.LstdFlags), m.port) + //if err := m.ic.Init(); err != nil { + // m.logger.Printf("\x1b[38;2;255;0;0mInternet: %s\x1b[38;2;255;255;255m\n", err.Error()) + //} else { + // m.logger.Println("\x1b[38;2;0;255;0mInternet OK\x1b[38;2;255;255;255m") + //} + // + //m.sms = sms.New(log.New(submodulesLogger, "modem-sms : ", log.LstdFlags), m.port) + //if err := m.sms.Init(); err != nil { + // m.logger.Printf("\x1b[38;2;255;0;0mSMS: %s\x1b[38;2;255;255;255m\n", err.Error()) + //} else { + // m.logger.Println("\x1b[38;2;0;255;0mSMS OK\x1b[38;2;255;255;255m") + //} m.gps = gps.New(log.New(submodulesLogger, "modem-gps : ", log.LstdFlags), m.port) if err := m.gps.Init(); err != nil { diff --git a/main.go b/main.go index b2dc805..641f5a1 100644 --- a/main.go +++ b/main.go @@ -43,16 +43,16 @@ func mainE() error { logger.Println(m.Update()) logger.Printf("DATA: %+v\n", m.GetData()) - logger.Println("||||||||||||||||| SEND SMS |||||||||||||||||") - logger.Println(m.At().Send("AT+CNUM")) - // if err := m.Sms().Send("+79218937173", "CGSG forever"); err != nil { + // logger.Println("||||||||||||||||| SEND SMS |||||||||||||||||") + // logger.Println(m.At().Send("AT+CNUM")) + // // if err := m.Sms().Send("+79218937173", "CGSG forever"); err != nil { + // // return err + // // } + // if ms, err := m.Sms().ReadNew(); err != nil { // return err + // } else { + // logger.Println("NEW:", ms) // } - if ms, err := m.Sms().ReadNew(); err != nil { - return err - } else { - logger.Println("NEW:", ms) - } logger.Println("||||||||||||||||| Checking gps status |||||||||||||||||") st, err := m.Gps().GetStatus() if err != nil {