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