lwm2m

package
v0.62.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AES-128-CCM
	TLS_ECDHE_ECDSA_WITH_AES_128_CCM   dtls.CipherSuiteID = 0xc0ac //nolint:revive,stylecheck
	TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 dtls.CipherSuiteID = 0xc0ae //nolint:revive,stylecheck

	// AES-128-GCM-SHA256
	TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 dtls.CipherSuiteID = 0xc02b //nolint:revive,stylecheck
	TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256   dtls.CipherSuiteID = 0xc02f //nolint:revive,stylecheck

	TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 dtls.CipherSuiteID = 0xc02c //nolint:revive,stylecheck
	TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384   dtls.CipherSuiteID = 0xc030 //nolint:revive,stylecheck
	// AES-256-CBC-SHA
	TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA dtls.CipherSuiteID = 0xc00a //nolint:revive,stylecheck
	TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA   dtls.CipherSuiteID = 0xc014 //nolint:revive,stylecheck

	TLS_PSK_WITH_AES_128_CCM        dtls.CipherSuiteID = 0xc0a4 //nolint:revive,stylecheck
	TLS_PSK_WITH_AES_128_CCM_8      dtls.CipherSuiteID = 0xc0a8 //nolint:revive,stylecheck
	TLS_PSK_WITH_AES_256_CCM_8      dtls.CipherSuiteID = 0xc0a9 //nolint:revive,stylecheck
	TLS_PSK_WITH_AES_128_GCM_SHA256 dtls.CipherSuiteID = 0x00a8 //nolint:revive,stylecheck
	TLS_PSK_WITH_AES_128_CBC_SHA256 dtls.CipherSuiteID = 0x00ae //nolint:revive,stylecheck

	TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 dtls.CipherSuiteID = 0xC037 //nolint:revive,stylecheck
)

Reference: https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4 https://github.com/pion/dtls/blob/98a05d681d3affae2d055a70d3273cbb35425b5a/cipher_suite.go#L25-L45

View Source
const (
	LwM2MServerRegisterURI = "/rd"
	LwM2MServerHandlerURI  = "/rd/{deviceId}"
)

Variables

This section is empty.

Functions

func CipherSuiteStringToCode

func CipherSuiteStringToCode(cipherSuitesStr v1alpha1.CipherSuite) (dtls.CipherSuiteID, error)

func CipherSuiteStringsToCodes

func CipherSuiteStringsToCodes(cipherSuiteStrs []v1alpha1.CipherSuite) ([]dtls.CipherSuiteID, error)

Types

type RegisterQuery

type RegisterQuery struct {
	EndpointName string `json:"ep"`
	LwM2MVersion string `json:"lwm2m"`
	Lifetime     string `json:"lt"`
	BindingMode  string `json:"bnd"`
	SMSNumber    string `json:"sms"`
	ObjectLinks  string `json:"b"`
}

type Server

type Server struct {
	Conn mux.Conn
	// contains filtered or unexported fields
}

func NewServer

func NewServer(settings v1alpha1.LwM2MSetting) (*Server, error)

func (*Server) Execute

func (s *Server) Execute(objectId string, args string) error

func (*Server) Observe

func (s *Server) Observe(objectId string, callback func(newData interface{})) error

func (*Server) OnRegister

func (s *Server) OnRegister(fn func() error)

func (*Server) Read

func (s *Server) Read(objectId string) (string, error)

Read reads the object value from the server objectId: the object id to read example: "/3442/0/120"

func (*Server) Run

func (s *Server) Run() error

func (*Server) Write

func (s *Server) Write(objectId string, newValue string) error

Write writes the object value to the server objectId: the object id to write example: "/3442/0/120" newValue: the new value to write

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL