mirror of
https://github.com/UbiquitousIntelligentSystemBINUS/SleepMonitoringSystemUsingEdgeCache.git
synced 2026-07-11 06:58:12 +07:00
Add files via upload
This commit is contained in:
28
Thesis_Code/gateway-classification/main.go
Normal file
28
Thesis_Code/gateway-classification/main.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/stanleydv12/gateway-classification/src/database"
|
||||
"github.com/stanleydv12/gateway-classification/src/handler"
|
||||
"github.com/stanleydv12/gateway-classification/src/mqtt"
|
||||
)
|
||||
|
||||
// main initializes the database and MQTT setup, then starts listening for MQTT messages.
|
||||
//
|
||||
// No parameters.
|
||||
// No return types.
|
||||
func main() {
|
||||
// Setup Database
|
||||
db := database.SetupDatabase()
|
||||
handler.SetDBInstance(db)
|
||||
|
||||
// Setup Mqtt
|
||||
mqtt.SetupMqtt()
|
||||
|
||||
// Application set to listen
|
||||
mqtt.Sub(mqtt.Client)
|
||||
|
||||
handler.StartTimer()
|
||||
|
||||
// Block the main function with a select statement
|
||||
select {}
|
||||
}
|
||||
Reference in New Issue
Block a user