Removed internet and sms temporarily.
This commit is contained in:
parent
dde1411b18
commit
b3fb13b7b3
@ -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 {
|
||||
|
16
main.go
16
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user