We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
According to the documentation, we can send request command to the charger station using the simplified API: https://github.com/lorenzodonini/ocpp-go?tab=readme-ov-file#sending-requests
how to run the command outside the SetNewChargePointHandler , because when trying to send command like the example
`func TestSendCommand(t *testing.T) { cb := func(request *core.ResetConfirmation, e error) { if e != nil { log.Printf("operation failed: %v", e) log.Printf("status: %v", request.GetFeatureName()) } else { log.Printf("status: %v", request.GetFeatureName()) // ... your own custom logic } }
err := utils.CentralSystem.Reset("2", cb, core.ResetTypeSoft) if err != nil { log.Println("error") println(err.Error()) } fmt.Println("ok")
}`
get the panic error: `--- FAIL: TestSendCommand (0.00s) panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x88 pc=0x665568]
goroutine 19 [running]: testing.tRunner.func1.2({0x69eae0, 0x9180b0}) /usr/local/go/src/testing/testing.go:1545 +0x238 testing.tRunner.func1() /usr/local/go/src/testing/testing.go:1548 +0x397 panic({0x69eae0?, 0x9180b0?})`
Thanks Before
The text was updated successfully, but these errors were encountered:
No branches or pull requests
According to the documentation, we can send request command to the charger station using the simplified API: https://github.com/lorenzodonini/ocpp-go?tab=readme-ov-file#sending-requests
how to run the command outside the SetNewChargePointHandler , because when trying to send command like the example
`func TestSendCommand(t *testing.T) {
cb := func(request *core.ResetConfirmation, e error) {
if e != nil {
log.Printf("operation failed: %v", e)
log.Printf("status: %v", request.GetFeatureName())
} else {
log.Printf("status: %v", request.GetFeatureName())
// ... your own custom logic
}
}
}`
get the panic error:
`--- FAIL: TestSendCommand (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x88 pc=0x665568]
goroutine 19 [running]:
testing.tRunner.func1.2({0x69eae0, 0x9180b0})
/usr/local/go/src/testing/testing.go:1545 +0x238
testing.tRunner.func1()
/usr/local/go/src/testing/testing.go:1548 +0x397
panic({0x69eae0?, 0x9180b0?})`
Thanks Before
The text was updated successfully, but these errors were encountered: