-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathutility_test.go
44 lines (38 loc) · 1.08 KB
/
utility_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Copyright 2013-2016 Seagate Technology LLC.
*
* This Source Code Form is subject to the terms of the Mozilla
* Public License, v. 2.0. If a copy of the MPL was not
* distributed with this file, You can obtain one at
* https://mozilla.org/MP:/2.0/.
*
* This program is distributed in the hope that it will be useful,
* but is provided AS-IS, WITHOUT ANY WARRANTY; including without
* the implied warranty of MERCHANTABILITY, NON-INFRINGEMENT or
* FITNESS FOR A PARTICULAR PURPOSE. See the Mozilla Public
* License for more details.
*
* See www.openkinetic.org for more project information
*/
package kinetic
import "fmt"
func ExampleUpdateFirmware() {
// Set the log leverl to debug
SetLogLevel(LogLevelDebug)
// Client options
var option = ClientOptions{
Host: "127.0.0.1",
Port: 8123,
User: 1,
Hmac: []byte("asdfasdf")}
conn, err := NewBlockConnection(option)
if err != nil {
panic(err)
}
defer conn.Close()
file := "not/exist/firmare/unknown-version.slod"
err = UpdateFirmware(conn, file)
if err != nil {
fmt.Println("Firmware update fail: ", file, err)
}
}