csx 4 vuotta sitten
vanhempi
commit
477aa8e132
1 muutettua tiedostoa jossa 10 lisäystä ja 4 poistoa
  1. 10 4
      controllers/sg/his_api_controller.go

+ 10 - 4
controllers/sg/his_api_controller.go Näytä tiedosto

98
 	result := int(ret)
98
 	result := int(ret)
99
 	fmt.Println("SSCard的运算结果为1:", result)
99
 	fmt.Println("SSCard的运算结果为1:", result)
100
 
100
 
101
-	path := ""
102
-	bytePath := []byte(path + "\x00")
103
-	bytePath2 := []byte(path + "\x00")
101
+	//path := ""
102
+	//bytePath := []byte(  "\x00")
103
+	//bytePath2 := []byte(  "\x00")
104
 
104
 
105
-	ret2, _, err2 := readCard.Call((uintptr)(unsafe.Pointer(&bytePath[0])), IntPtr(1024), (uintptr)(unsafe.Pointer(&bytePath2[0])), IntPtr(1024))
105
+	str := make([]byte, 256)
106
+	str1 := make([]byte, 256)
107
+
108
+	s2 := []byte(string(str) + "\x00")
109
+	s3 := []byte(string(str1) + "\x00")
110
+
111
+	ret2, _, err2 := readCard.Call((uintptr)(unsafe.Pointer(&s2[0])), IntPtr(1024), (uintptr)(unsafe.Pointer(&s3[0])), IntPtr(1024))
106
 	fmt.Println(" Add(4,5)的结果为:", ret2)
112
 	fmt.Println(" Add(4,5)的结果为:", ret2)
107
 	fmt.Println(" str:", bytePath)
113
 	fmt.Println(" str:", bytePath)
108
 	fmt.Println(" str1:", bytePath2)
114
 	fmt.Println(" str1:", bytePath2)