Commit e3111040 authored by szh's avatar szh

add serial

parent 29c7f65e
...@@ -101,7 +101,7 @@ func broadcast() { ...@@ -101,7 +101,7 @@ func broadcast() {
if err != nil{ if err != nil{
fmt.Println(err) fmt.Println(err)
} }
//log.Println(send) log.Println(send)
time.Sleep(time.Second) time.Sleep(time.Second)
} }
} }
\ No newline at end of file
...@@ -11,6 +11,10 @@ import ( ...@@ -11,6 +11,10 @@ import (
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
) )
var (
pai_serial string
)
type Pai struct { type Pai struct {
Hardware string `json:"hardware"` Hardware string `json:"hardware"`
Revision string `json:"revision"` Revision string `json:"revision"`
...@@ -24,6 +28,9 @@ type Pai struct { ...@@ -24,6 +28,9 @@ type Pai struct {
} }
func (p *Pai) GetConfig() bool { func (p *Pai) GetConfig() bool {
if pai_serial != "" {
p.Serial = pai_serial
}
if p.Serial != "" { if p.Serial != "" {
return true return true
} }
...@@ -108,6 +115,9 @@ func getPaiConfig(command string ,arg ...string) (config map[string]string,err e ...@@ -108,6 +115,9 @@ func getPaiConfig(command string ,arg ...string) (config map[string]string,err e
//fmt.Println("KEY:",k, "VAL:", v) //fmt.Println("KEY:",k, "VAL:", v)
if _, ok := list[k]; !ok { if _, ok := list[k]; !ok {
list[k] = v list[k] = v
if k == "serial" {
pai_serial = v
}
} }
} }
} }
......
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