blynk

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: LGPL-3.0 Imports: 14 Imported by: 5

README

go-blynk

Blynk library implementation for Go language


What is Blynk?

Blynk provides iOS and Android apps to control any hardware over the Internet or directly using Bluetooth. You can easily build graphic interfaces for all your projects by simply dragging and dropping widgets, right on your smartphone. Blynk is the most popular IoT platform used by design studios, makers, educators, and equipment vendors all over the world.

Blynk Banner

Download

Blynk App: Google Play | App Store

Blynk Server

Documentation

Social: Webpage / Facebook / Twitter / Kickstarter
Help Center: http://help.blynk.cc
Documentation: http://docs.blynk.cc/#blynk-firmware
Community Forum: http://community.blynk.cc
Examples Browser: http://examples.blynk.cc
Blynk for Business: http://www.blynk.io

Documentation

Index

Constants

View Source
const (
	BLYNK_SUCCESS             uint16 = 200
	BLYNK_ILLEGAL_COMMAND     uint16 = 2
	BLYNK_NOT_REGISTERED      uint16 = 3
	BLYNK_NOT_AUTHENTICATED   uint16 = 5
	BLYNK_NOT_ALLOWED         uint16 = 6
	BLYNK_NO_ACTIVE_DASHBOARD uint16 = 8
	BLYNK_INVALID_TOKEN       uint16 = 9
	BLYNK_NTF_INVALID_BODY    uint16 = 13
	BLYNK_NTF_NOT_AUTHORIZED  uint16 = 14
	BLYNK_NTF_EXCEPTION       uint16 = 15
)
View Source
const Version = "0.0.5"

Variables

This section is empty.

Functions

func GetBlynkStatus added in v0.0.4

func GetBlynkStatus(status uint16) string

Types

type Blynk

type Blynk struct {
	APIkey string

	OnReadFunc func(*BlynkRespose)
	// contains filtered or unexported fields
}

func NewBlynk

func NewBlynk(APIkey string) *Blynk

func (*Blynk) AddReaderHandler added in v0.0.5

func (g *Blynk) AddReaderHandler(pin uint, fn func(pin uint, writer io.Writer))

func (*Blynk) AddWriterHandler added in v0.0.5

func (g *Blynk) AddWriterHandler(pin uint, fn func(pin uint, reader io.Reader))

func (*Blynk) Connect

func (g *Blynk) Connect() error

func (*Blynk) DeleteReaderHandler added in v0.0.5

func (g *Blynk) DeleteReaderHandler(pin uint)

func (*Blynk) DeleteWriterHandler added in v0.0.5

func (g *Blynk) DeleteWriterHandler(pin uint)

func (*Blynk) DigitalRead

func (g *Blynk) DigitalRead(pin int) error

func (*Blynk) DigitalWrite

func (g *Blynk) DigitalWrite(pin int, value bool) error
func (g *Blynk) DisableLogo(state bool)

func (*Blynk) Disconnect

func (g *Blynk) Disconnect() error

func (*Blynk) EMail added in v0.0.4

func (g *Blynk) EMail(to string, subject string, msg string) error

func (*Blynk) Notify added in v0.0.4

func (g *Blynk) Notify(msg string) error

func (*Blynk) Processing

func (g *Blynk) Processing()

func (*Blynk) SetDebug added in v0.0.4

func (g *Blynk) SetDebug()

func (*Blynk) SetServer added in v0.0.4

func (g *Blynk) SetServer(Server string, Port int, SSL bool)

func (*Blynk) SetUseSSL added in v0.0.5

func (g *Blynk) SetUseSSL(ssl bool)

func (*Blynk) Stop

func (g *Blynk) Stop() error

func (*Blynk) Tweet added in v0.0.4

func (g *Blynk) Tweet(msg string) error

func (*Blynk) VirtualRead

func (g *Blynk) VirtualRead(pins ...int) error

func (*Blynk) VirtualWrite

func (g *Blynk) VirtualWrite(pin int, value string) error

type BlynkBody added in v0.0.4

type BlynkBody strings.Builder

func (*BlynkBody) AddBool added in v0.0.4

func (b *BlynkBody) AddBool(v bool)

func (*BlynkBody) AddBytes added in v0.0.5

func (b *BlynkBody) AddBytes(buf []byte)

func (*BlynkBody) AddInt added in v0.0.4

func (b *BlynkBody) AddInt(values ...int)

func (*BlynkBody) AddString added in v0.0.4

func (b *BlynkBody) AddString(s string)

func (*BlynkBody) Clear added in v0.0.4

func (b *BlynkBody) Clear()

func (*BlynkBody) Len added in v0.0.5

func (b *BlynkBody) Len() uint16

func (*BlynkBody) String added in v0.0.4

func (b *BlynkBody) String() string

type BlynkCommand

type BlynkCommand byte
const (
	BLYNK_CMD_RESPONSE      BlynkCommand = 0
	BLYNK_CMD_LOGIN         BlynkCommand = 2
	BLYNK_CMD_PING          BlynkCommand = 6
	BLYNK_CMD_TWEET         BlynkCommand = 12
	BLYNK_CMD_EMAIL         BlynkCommand = 13
	BLYNK_CMD_NOTIFY        BlynkCommand = 14
	BLYNK_CMD_HARDWARE_SYNC BlynkCommand = 16
	BLYNK_CMD_INTERNAL      BlynkCommand = 17
	BLYNK_CMD_HARDWARE      BlynkCommand = 20
	BLYNK_CMD_HW_LOGIN      BlynkCommand = 29
)

type BlynkHead

type BlynkHead struct {
	Command   BlynkCommand
	MessageId uint16
	Length    uint16
}

type BlynkMessage added in v0.0.5

type BlynkMessage struct {
	Head BlynkHead
	Body BlynkBody
}

func (*BlynkMessage) GetBytes added in v0.0.5

func (b *BlynkMessage) GetBytes() []byte

type BlynkRespose

type BlynkRespose struct {
	Command   BlynkCommand
	MessageId uint16
	Status    uint16
	Values    []string
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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