hlk_sw16

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: MIT Imports: 5 Imported by: 2

README

HLK-SW16

Build Status

Description:

Package hlk-sw16 created to help manage 16x relay switches electronic module.

Install package:
go get -u github.com/vitaly-kashtalyan/hlk-sw16

You can also manually git clone the repository to:

$GOPATH/src/github.com/vitaly-kashtalyan/hlk-sw16
Usage:
package main

import "github.com/vitaly-kashtalyan/hlk-sw16"

func main() {
	hlk := hlk_sw16.New("192.168.16.254", "8080")
	if hlk.Err == nil {
	    //
		_ = hlk.StatusRelays()
		msg, _ := hlk.ReadMessage()
		fmt.Println("Message: ", msg)
		_ = hlk.Close()
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Conn net.Conn
	Err  error
}

func New

func New(host string, port string) (c *Connection)

func (*Connection) Close

func (c *Connection) Close() (err error)

func (*Connection) ReadMessage

func (c *Connection) ReadMessage() (msg []byte, err error)

func (*Connection) RelayOff

func (c *Connection) RelayOff(id int) (err error)

func (*Connection) RelayOn

func (c *Connection) RelayOn(id int) (err error)

func (*Connection) StatusRelays

func (c *Connection) StatusRelays() (err error)

func (*Connection) SwitchAllOff

func (c *Connection) SwitchAllOff() (err error)

func (*Connection) SwitchAllOn

func (c *Connection) SwitchAllOn() (err error)

func (*Connection) WriteMessage

func (c *Connection) WriteMessage(msg string) (err error)

Jump to

Keyboard shortcuts

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