Developing lightweight computation at the DSG edge

Commit 08144e9f authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[monitor-assign] Remove unused function readDevsaddsFile()


Signed-off-by: Roger Pueyo Centelles's avatarRoger Pueyo Centelles <rpueyo@ac.upc.edu>
parent 6d49bdfc
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"math"
......@@ -199,36 +197,6 @@ func initializeFlags() {
}
}
// readDevsaddsFile reads a devices and IPv4 addresses list from a JSON file
func readDevsaddsFile(filename string, errLevel int) []cnml.DeviceIpv4sGraphserver {
var newdevs []cnml.DeviceIpv4sGraphserver
jdevsaddrsFile, err := os.Open(filename)
errCheck(err, errLevel, fmt.Sprintf("Error opening file %s", filename))
if err != nil {
return newdevs
}
defer jdevsaddrsFile.Close()
//Parse the JSON file, line by line
var lines []string
scanner := bufio.NewScanner(jdevsaddrsFile)
for scanner.Scan() {
lines = append(lines, scanner.Text())
}
//Unmarshal the JSON objects to DeviceAddresses objects
for _, v := range lines {
var devaddr cnml.DeviceIpv4sGraphserver
err := json.Unmarshal([]byte(v), &devaddr)
errCheck(err, INFO, "TODO")
newdevs = append(newdevs, devaddr)
}
fmt.Println(len(newdevs), "devices read from", filename)
return newdevs
}
// Get the global devices list from AntidoteDB
func getCnmlDevicesList() []cnml.DeviceIpv4sGraphserver {
return goclidote.ReadDevicesFromAntidote(dbHost, dbPort)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment