init
This commit is contained in:
parent
a5e67c8e8d
commit
f89f91f4ab
|
@ -11,22 +11,22 @@ import (
|
|||
|
||||
func main() {
|
||||
// connect to HPDS-MQ.
|
||||
source := hpds_node.NewAccessPoint(
|
||||
ap := hpds_node.NewAccessPoint(
|
||||
"hpds-ap",
|
||||
hpds_node.WithMqAddr("localhost:27188"),
|
||||
hpds_node.WithCredential("token:z1"),
|
||||
)
|
||||
err := source.Connect()
|
||||
err := ap.Connect()
|
||||
if err != nil {
|
||||
log.Printf("[AccessPoint] Emit the data to HPDS-MQ failure with err: %v", err)
|
||||
return
|
||||
}
|
||||
defer source.Close()
|
||||
defer ap.Close()
|
||||
|
||||
source.SetDataTag(0x33)
|
||||
ap.SetDataTag(0x33)
|
||||
|
||||
// generate mock data and send it to HPDS-MQ.
|
||||
err = generateAndSendData(source)
|
||||
err = generateAndSendData(ap)
|
||||
if err != nil {
|
||||
log.Printf("[AccessPoint] >>>> ERR >>>> %v", err)
|
||||
os.Exit(1)
|
||||
|
|
Loading…
Reference in New Issue