Skip to content

Commit e0e07c5

Browse files
author
rsora
committed
Refreshed client example
1 parent 3888017 commit e0e07c5

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed
File renamed without changes.

client_example/hello/sketch.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cpu": {
3+
"fqbn": "arduino:samd:mkr1000",
4+
"name": "Arduino MKR1000"
5+
}
6+
}

client_example/main.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ func main() {
9494

9595
// With a brand new instance, the first operation should always be updatating
9696
// the index.
97-
//log.Println("calling UpdateIndex")
98-
//callUpdateIndex(client, instance)
99-
//
97+
log.Println("calling UpdateIndex")
98+
callUpdateIndex(client, instance)
99+
100100
// Let's search for a platform (also known as 'core') called 'samd'.
101101
log.Println("calling PlatformSearch(samd)")
102102
callPlatformSearch(client, instance)
@@ -120,17 +120,17 @@ func main() {
120120

121121
// Attach a board to a sketch.
122122
// Uncomment if you do have an actual board connected.
123-
// log.Println("calling BoardAttach(serial:///dev/ttyACM0)")
124-
// callBoardAttach(client, instance)
123+
//log.Println("calling BoardAttach(serial:///dev/ttyACM0)")
124+
//callBoardAttach(client, instance)
125125

126126
// Compile a sketch
127-
log.Println("calling Compile(arduino-pippo:samd:mkr1000, VERBOSE, hello.ino)")
127+
log.Println("calling Compile(arduino:samd:mkr1000, VERBOSE, hello.ino)")
128128
callCompile(client, instance)
129129

130130
// Upload a sketch
131131
// Uncomment if you do have an actual board connected.
132-
// log.Println("calling Upload(arduino:samd:mkr1000, /dev/ttyACM0, VERBOSE, hello.ino)")
133-
// callUpload(client, instance)
132+
//log.Println("calling Upload(arduino:samd:mkr1000, /dev/ttyACM0, VERBOSE, hello.ino)")
133+
//callUpload(client, instance)
134134

135135
// Debug a sketch on a board
136136
// Uncomment if you do have an actual board connected via debug port,
@@ -140,8 +140,8 @@ func main() {
140140
//if err != nil {
141141
// log.Fatalf("debug steraming open error: %s\n", err)
142142
//}
143-
// log.Println("calling Debug(arduino:samd:mkr1000, hello.ino)")
144-
// callDebugger(debugStreamingClient, instance)
143+
//log.Println("calling Debug(arduino:samd:mkr1000, hello.ino)")
144+
//callDebugger(debugStreamingClient, instance)
145145

146146
// List all boards
147147
log.Println("calling BoardListAll(mkr)")
@@ -489,7 +489,7 @@ func callCompile(client rpc.ArduinoCoreClient, instance *rpc.Instance) {
489489
compRespStream, err := client.Compile(context.Background(),
490490
&rpc.CompileReq{
491491
Instance: instance,
492-
Fqbn: "arduino-pippo:samd:mkr1000",
492+
Fqbn: "arduino:samd:mkr1000",
493493
SketchPath: filepath.Join(currDir, "hello"),
494494
Verbose: true,
495495
})
@@ -824,7 +824,7 @@ func callDebugger(debugStreamingOpenClient dbg.Debug_DebugClient, instance *rpc.
824824
err := debugStreamingOpenClient.Send(&dbg.DebugReq{
825825
DebugReq: &dbg.DebugConfigReq{
826826
Instance: &dbg.Instance{Id: instance.GetId()},
827-
Fqbn: "arduino-pippo:samd:mkr1000",
827+
Fqbn: "arduino:samd:mkr1000",
828828
SketchPath: filepath.Join(currDir, "hello"),
829829
Port: "none",
830830
}})

0 commit comments

Comments
 (0)