@@ -77,9 +77,6 @@ func (d device) deviceSend(interval int, ch chan<- string) {
77
77
}
78
78
79
79
func (d device ) createDevice () (* http.Response , error ) {
80
- client := & http.Client {
81
- Timeout : time .Second * 10 ,
82
- }
83
80
84
81
reqBody , _ := json .Marshal (devicebody {DeviceID : d .Name })
85
82
@@ -98,9 +95,6 @@ func (d device) createDevice() (*http.Response, error) {
98
95
// get device in IoT Hub
99
96
// return 200 if device is found, 404 if not
100
97
func (d device ) getDevice () (* http.Response , error ) {
101
- client := & http.Client {
102
- Timeout : time .Second * 10 ,
103
- }
104
98
105
99
req , _ := http .NewRequest ("GET" , "https://" + Conf .IoTHubs [d .IoTHub ]+ "/devices/" + d .Name + "?api-version=2016-02-03" , nil )
106
100
@@ -115,9 +109,6 @@ func (d device) getDevice() (*http.Response, error) {
115
109
}
116
110
117
111
func (d device ) sendData (message devicemessage ) (* http.Response , error ) {
118
- client := & http.Client {
119
- Timeout : time .Second * 10 ,
120
- }
121
112
122
113
reqBody , _ := json .Marshal (message )
123
114
@@ -135,9 +126,6 @@ func (d device) sendData(message devicemessage) (*http.Response, error) {
135
126
}
136
127
137
128
func (d device ) deleteDevice () (* http.Response , error ) {
138
- client := & http.Client {
139
- Timeout : time .Second * 10 ,
140
- }
141
129
142
130
//fmt.Println("https://" + Conf.IoTHubs[d.IoTHub] + "/devices/" + d.Name + "?api-version=2016-11-14")
143
131
0 commit comments