Documentation
¶
Overview ¶
Package ocpptest provides a fake OCPP 1.6 Central System for tests of the simulated charger in client mode.
Index ¶
- func WaitFor(t testing.TB, what string, timeout time.Duration, ok func() bool)
- type CSMS
- func (f *CSMS) Actions() []string
- func (f *CSMS) Auths() []string
- func (f *CSMS) Call(action string, payload interface{})
- func (f *CSMS) Connections() int
- func (f *CSMS) Paths() []string
- func (f *CSMS) Payloads(action string) []json.RawMessage
- func (f *CSMS) Sent(action string) int
- func (f *CSMS) SetClosed(closed bool)
- func (f *CSMS) SetHeartbeatInterval(s int)
- func (f *CSMS) URL(userinfo string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CSMS ¶
type CSMS struct {
// contains filtered or unexported fields
}
CSMS accepts every BootNotification, gives every StartTransaction transaction id 42, answers every other CALL with an empty result, and records what the charge point sent.
func (*CSMS) Connections ¶
Connections counts the charge point's connections so far.
func (*CSMS) Payloads ¶
func (f *CSMS) Payloads(action string) []json.RawMessage
Payloads lists the payloads of one action's CALLs, in order.
func (*CSMS) SetClosed ¶
SetClosed makes the Central System refuse connections, as one that is down.
func (*CSMS) SetHeartbeatInterval ¶
SetHeartbeatInterval sets the interval the BootNotification answer gives.