File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,34 @@ daemon.downloading.subscribe(download => {
70
70
71
71
```
72
72
73
+ ## Version 2
74
+
75
+ Version 2 of the arduino-create-agent aims to provide a cleaner api based on promises.
76
+ It will remain confined to a v2 property on the daemon object until it will be stable.
77
+ At the moment it only supports tool management.
78
+
79
+ ``` js
80
+ daemon .agentV2Found .subscribe (daemonV2 => {
81
+ if (! daemonV2) {
82
+ // Your Agent doesn't support v2
83
+ }
84
+ // Your Agent supports v2
85
+ });
86
+
87
+ daemon .v2 .installedTools ()
88
+ .then (tools => console .debug (tools)) // [{"name":"avrdude","version":"6.3.0-arduino9","packager":"arduino"}]
89
+
90
+ let payload = {
91
+ name: ' avrdude' ,
92
+ version: ' 6.3.0-arduino9' ,
93
+ packager: ' arduino' ,
94
+ url: ' http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino9-i686-w64-mingw32.zip' ,
95
+ checksum: ' SHA-256:f3c5cfa8d0b3b0caee81c5b35fb6acff89c342ef609bf4266734c6266a256d4f' ,
96
+ signature: ' 7628b488c7ffd21ae1ca657245751a4043c419fbab5c256a020fb53f17eb88686439f54f18e78a80b40fc2de742f79b78ed4338c959216dc8ae8279e482d2d4117eeaf34a281ce2369d1dc4356f782c0940d82610f1c892e913b637391c39e95d4d4dfe82d8dbc5350b833186a70a62c7952917481bad798a9c8b4905df91bd914fbdfd6e98ef75c8f7fb06284278da449ce05b27741d6eda156bbdb906d519ff7d7d5042379fdfc55962b3777fb9240b368552182758c297e39c72943d75d177f2dbb584b2210301250796dbe8af11f0cf06d762fe4f912294f4cdc8aff26715354cfb33010a81342fbbc438912eb424a39fc0c52a9b2bf722051a6f3b024bd'
97
+ }
98
+ daemon .v2 .installTool (payload) // Will install the tool in the system
99
+ ```
100
+
73
101
## Development and test features
74
102
Just run ` npm run dev ` and open your browser on http://localhost:8000
75
103
You can’t perform that action at this time.
0 commit comments