You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Rename profile handlers
Signed-off-by: Lorenzo Donini <[email protected]>
* Update SetCoreHandler function name for charge point
Signed-off-by: Lorenzo Donini <[email protected]>
* Update ocpp 1.6 examples
Signed-off-by: Lorenzo Donini <[email protected]>
* Use alpine image for docker execution
Signed-off-by: Lorenzo Donini <[email protected]>
* Setup code coverage test in ci
Signed-off-by: Lorenzo Donini <[email protected]>
* Move ocppj tests to ocppj folder
Signed-off-by: Lorenzo Donini <[email protected]>
* Update test coverage creation
Signed-off-by: Lorenzo Donini <[email protected]>
* Cover profile packages in tests
Signed-off-by: Lorenzo Donini <[email protected]>
* Run gofmt
Signed-off-by: Lorenzo Donini <[email protected]>
* Refactor examples and include TLS support
Signed-off-by: Lorenzo Donini <[email protected]>
* Move examples to 1.6 folder
Signed-off-by: Lorenzo Donini <[email protected]>
* Add script for generating test certificates
Signed-off-by: Lorenzo Donini <[email protected]>
* Update readme usage
Signed-off-by: Lorenzo Donini <[email protected]>
* Fix dockerfile path in travis.yml
Signed-off-by: Lorenzo Donini <[email protected]>
* Update 1.6 example with central system sim
Signed-off-by: Lorenzo Donini <[email protected]>
* Use cp configMap and simulate more messages
Signed-off-by: Lorenzo Donini <[email protected]>
Copy file name to clipboardExpand all lines: .travis.yml
+12-5Lines changed: 12 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -17,19 +17,26 @@ jobs:
17
17
- stage: test
18
18
script:
19
19
- go build ./...
20
-
- go test ./...
20
+
- go get golang.org/x/tools/cmd/cover
21
+
- go get github.com/mattn/goveralls
22
+
- go test ./ws ./ocppj -v -covermode=count -coverprofile=coverage.out
23
+
- go test -v -covermode=count -coverprofile=ocpp16.out -coverpkg=github.com/lorenzodonini/ocpp-go/ocpp1.6/... github.com/lorenzodonini/ocpp-go/ocpp1.6_test
24
+
- go test -v -covermode=count -coverprofile=ocpp20.out -coverpkg=github.com/lorenzodonini/ocpp-go/ocpp2.0/... github.com/lorenzodonini/ocpp-go/ocpp2.0_test
In both cases, the request is sent asynchronously and the function returns right away.
110
121
You need to write the callback function to check for errors and handle the confirmation on your own:
111
122
```go
112
-
myCallback:=func(confirmation *ocpp16.ChangeAvailabilityConfirmation, e error) {
123
+
myCallback:=func(confirmation *core.ChangeAvailabilityConfirmation, e error) {
113
124
if e != nil {
114
125
log.Printf("operation failed: %v", e)
115
126
} else {
@@ -119,14 +130,14 @@ myCallback := func(confirmation *ocpp16.ChangeAvailabilityConfirmation, e error)
119
130
}
120
131
```
121
132
122
-
Since the initial `centralSystem.Start` call blocks forever, you may want to wrap it in a goroutine (that is, if you need to send requests to charge points form the main thread).
133
+
Since the initial `centralSystem.Start` call blocks forever, you may want to wrap it in a goroutine (that is, if you need to run other operations on the main thread).
123
134
124
135
#### Example
125
136
126
-
You can take a look at the full example inside `central_system_sim.go`.
137
+
You can take a look at the [full example](./example/1.6/cs/central_system_sim.go).
When creating a message manually, you always need to perform type assertion yourself, as the `SendRequest` and `SendRequestAsync` APIs use generic `Request` and `Confirmation` interfaces.
247
274
248
275
#### Example
249
-
You can take a look at the full example inside `charge_point_sim.go`.
276
+
You can take a look at the [full example](./example/1.6/cp/charge_point_sim.go).
250
277
To run it, simply execute:
251
278
```bash
252
-
CLIENT_ID=chargePointSim CENTRAL_SYSTEM_URL=ws://<host>:8887 go run ./example/cp/charge_point_sim.go
279
+
CLIENT_ID=chargePointSim CENTRAL_SYSTEM_URL=ws://<host>:8887 go run example/1.6/cp/*.go
253
280
```
254
281
255
-
You need to specify the hostname/IP of a running central station server, so the charge point can reach it.
282
+
You need to specify the URL of a running central station server via environment variable, so the charge point can reach it.
0 commit comments