linebeacon

package module
v0.0.0-...-986aa52 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: MIT Imports: 5 Imported by: 0

README

LINE Simple Beacon in Go

LINE Simple Beacon is a specification for beacon hardware for LINE Bot developers.

Spec in English from Line

Install in MacOSX (WIP)

go install github.com/kkdai/line-beacon-go/tools/macosx

How to use it


import lineBeacon "github.com/kkdai/line-beacon-go"

hwID := []byte{0x01, 0x02, ...}
msgData := []byte{0x01, 0x02, ...}

totalFrameData := lineBeacon.CreateLineSimpleBeaconAdvertisingPDU(hwID, msgData)
fmt.Println("Your Line Beacon frame raw data:", totalFrameData)

Tools

WIP

Inspire by Line Simple Beacon

Repo

Disclaimer

This is WIP libray and I still don't get realone line-beacon on hand, but it fullfil the testing case in Line Simple Beacon

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ADTYPE_FLAGS                        byte = 0x01
	ADTYPE_SERVICE_DATA                 byte = 0x16
	ADTYPE_COMPLETE_16_BIT_SERVICE_UUID byte = 0x03

	UUID16LE_FOR_LINECORP []byte = []byte{0x6f, 0xfe}
)

Functions

func CreateLineSimpleBeaconAdvertisingPDU

func CreateLineSimpleBeaconAdvertisingPDU(hwid, msgData []byte) []byte

Types

type LineBeacon

type LineBeacon struct {
	// contains filtered or unexported fields
}

func (*LineBeacon) AddField

func (l *LineBeacon) AddField(header byte, data []byte) *LineBeacon

type LineBeaconGATT

type LineBeaconGATT struct {
	//Output frame data for line beacon
	OutFrame []byte

	//Tx power is the received power at 0 meters, in dBm, and the value ranges from -100 dBm to +20 dBm to a resolution of 1 dBm.
	//
	//Note to developers:
	// The best way to determine the precise value to put into this field is to measure the actual output of
	// your beacon from 1 meter away and then add 41dBm to that. 41dBm is the signal loss that occurs over 1 meter.
	PowerLevel int
}

func NewLineBeacon

func NewLineBeacon(hwid []byte, data []byte) *LineBeaconGATT

func (*LineBeaconGATT) Advertise

func (lb *LineBeaconGATT) Advertise()

Start to Advertise your beacon, it is block API.

Directories

Path Synopsis
tools
macosx command

Jump to

Keyboard shortcuts

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