Categorygithub.com/ChargePi/ocmf-go
modulepackage
0.2.1
Repository: https://github.com/chargepi/ocmf-go.git
Documentation: pkg.go.dev

# README

OCMF-go

OCMF-go is an implementation of the Open Charge Metering Format (OCMF) in Go. It provides a simple library for generating and parsing OCMF messages. The provided message builder generates OCMF-compatible messages and signs the data with the provided private key, desired algorithm and encoding, so you don't have to.

Installation

go get github.com/ChargePi/ocmf-go

Usage

package main

import (
	"fmt"

	ocmf_go "github.com/ChargePi/ocmf-go"
	"github.com/lorenzodonini/ocpp-go/ocpp1.6/types"
)

func main() {
	// Generate a new message builder
	builder := ocmf_go.NewBuilder()

	// Set the signature algorithm
	builder.SetSignatureAlgorithm(ocmf_go.SignatureAlgorithmECDSAsecp256r1Sha256)

	// Set the signature encoding
	builder.SetSignatureEncoding(ocmf_go.SignatureEncodingBase64)

	// ... set the desired fields
	message, err := builder.Build()
	if err != nil {
		fmt.Println(err)
	}

	// Create a MeterValue message with the generated message as value 
	meterValueExample := types.MeterValue{
		SampledValue: []types.SampledValue{
			{
				Value:  message,
				Format: types.ValueFormatSignedData,
			},
		},
	}

	// Send the message via OCPP 1.5/1.6.
}

Contributing

Contributions are welcome! Please check out the contributing guide for more information.

License

OCMF-go is licensed under the MIT License.

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author