Documentation ¶
Index ¶
Constants ¶
View Source
const (
BroadcastAddress = "224.0.23.0:3610"
)
Variables ¶
View Source
var ( ErrAlreadyStarted = errors.New("a controller is already started") ErrNotQueryMessage = errors.New("not a query message") ErrUnsupportedMessage = errors.New("unsupported message") )
View Source
var ( ErrUnsupportedFrame = errors.New("unsupported frame") ErrElementsMismatch = errors.New("the number of elements is mismatched") ErrTooManyProperties = errors.New("too many properties") ErrWrongLength = errors.New("wrong length") )
View Source
var ( ErrUnexpectedEpc = errors.New("unexpected epc") ErrPropertyCountMismatched = errors.New("the number of properties is mismatched") )
View Source
var ( ServiceTypeNames = map[ServiceType]string{ ServiceTypeSetI: "SetI", ServiceTypeSetC: "SetC", ServiceTypeGet: "Get", ServiceTypeInfReq: "InfReq", ServiceTypeSetGet: "SetGet", ServiceTypeSetReq: "SetReq", ServiceTypeGetRes: "GetRes", ServiceTypeInf: "Inf", ServiceTypeInfC: "InfC", ServiceTypeInfCRes: "InfCRes", ServiceTypeSetGetRes: "SetGetRes", ServiceTypeSetISna: "SetISna", ServiceTypeSetCSna: "SetCSna", ServiceTypeGetSna: "GetSna", ServiceTypeInfSna: "InfSna", ServiceTypeSetGetSna: "SetGetSna", } )
Functions ¶
func GetPropertyMap ¶
Types ¶
type Controller ¶
func NewController ¶
func NewController() Controller
func (*Controller) Close ¶
func (c *Controller) Close() error
func (*Controller) CreateFrame ¶
func (c *Controller) CreateFrame() Frame
func (*Controller) QueryBuilder ¶
func (c *Controller) QueryBuilder() *QueryBuilder
func (*Controller) Start ¶
func (c *Controller) Start() error
func (*Controller) Stop ¶
func (c *Controller) Stop() error
type Frame ¶
type Frame struct { Ehd1 byte Ehd2 byte Tid uint16 Edata SpecifiedMessage }
func DeserializeFrame ¶
type QueryBuilder ¶
func (QueryBuilder) Query ¶
func (q QueryBuilder) Query(f Frame) ([]QueryResponse, error)
func (*QueryBuilder) SetTimeout ¶
func (q *QueryBuilder) SetTimeout(duration time.Duration) *QueryBuilder
type QueryResponse ¶
type Serializable ¶
type Serializable interface {
Serialize() []byte
}
type ServiceType ¶
type ServiceType byte
const ( ServiceTypeSetI ServiceType = 0x60 ServiceTypeSetC ServiceType = 0x61 ServiceTypeGet ServiceType = 0x62 ServiceTypeInfReq ServiceType = 0x63 ServiceTypeSetGet ServiceType = 0x6e ServiceTypeSetReq ServiceType = 0x71 ServiceTypeGetRes ServiceType = 0x72 ServiceTypeInf ServiceType = 0x73 ServiceTypeInfC ServiceType = 0x74 ServiceTypeInfCRes ServiceType = 0x7a ServiceTypeSetGetRes ServiceType = 0x7e ServiceTypeSetISna ServiceType = 0x50 ServiceTypeSetCSna ServiceType = 0x51 ServiceTypeGetSna ServiceType = 0x52 ServiceTypeInfSna ServiceType = 0x53 ServiceTypeSetGetSna ServiceType = 0x5e )
func (ServiceType) String ¶
func (t ServiceType) String() string
type SpecifiedMessage ¶
type SpecifiedMessage struct { Seoj uint32 Deoj uint32 Esv ServiceType Properties []Property }
func DeserializeSpecifiedMessage ¶
func DeserializeSpecifiedMessage(data []byte) (SpecifiedMessage, error)
func (SpecifiedMessage) Serialize ¶
func (m SpecifiedMessage) Serialize() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.