forked from suapapa/go_eddystone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constant.go
38 lines (30 loc) · 816 Bytes
/
constant.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2015, Homin Lee <homin.lee@suapapa.net>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package eddystone
import "errors"
// Eddystone Service UUID
const SvcUUID = 0xFEAA
// Eddystone Service UUID in Little Endian format
var SvcUUIDBytes = []byte{0xAA, 0xFE}
// ErrInvalidFrame can be returned from Make*Frame()
var ErrInvalidFrame = errors.New("invalid frame")
// FrameType for Eddystone frames
type frameType byte
func (ft frameType) String() string {
switch ft {
case ftUID:
return "Eddystone-UID"
case ftURL:
return "Eddystone-URL"
case ftTLM:
return "Eddystone-TLM"
}
return "Invaild Frame"
}
// Eddystone frame types
const (
ftUID frameType = 0x00
ftURL = 0x10
ftTLM = 0x20
)