Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterCollarServer(s *grpc.Server, srv CollarServer)
- type CollarClient
- type CollarRequest
- func (*CollarRequest) Descriptor() ([]byte, []int)
- func (m *CollarRequest) GetDurationMs() int32
- func (m *CollarRequest) GetIntensity() int32
- func (m *CollarRequest) GetType() CollarRequest_CommandType
- func (*CollarRequest) ProtoMessage()
- func (m *CollarRequest) Reset()
- func (m *CollarRequest) String() string
- func (m *CollarRequest) XXX_DiscardUnknown()
- func (m *CollarRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CollarRequest) XXX_Merge(src proto.Message)
- func (m *CollarRequest) XXX_Size() int
- func (m *CollarRequest) XXX_Unmarshal(b []byte) error
- type CollarRequest_CommandType
- type CollarResponse
- func (*CollarResponse) Descriptor() ([]byte, []int)
- func (*CollarResponse) ProtoMessage()
- func (m *CollarResponse) Reset()
- func (m *CollarResponse) String() string
- func (m *CollarResponse) XXX_DiscardUnknown()
- func (m *CollarResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CollarResponse) XXX_Merge(src proto.Message)
- func (m *CollarResponse) XXX_Size() int
- func (m *CollarResponse) XXX_Unmarshal(b []byte) error
- type CollarServer
- type Sd400
Constants ¶
View Source
const ( // Command start/end sequences. Specified in "binary". // '0' represents 4ms, unmodulated // '1' represents 4ms, 5kHz modulation // '2' represents 2ms, 5kHz modulation // // Momentary command format: // [CMD_START] [PREAMBLE] [REMOTE ID] [CMD TYPE] [CMD DATA] [MOMENTARY_CMD_END] // // Continuous command format: // [CMD_START] // Repeated N times: [PREAMBLE] [REMOTE ID] [CMD TYPE] [CMD DATA] [CONTINUOUS_CMD_BREAK] // [CONTINUOUS_CMD_END] CMD_START = "11111" PREAMBLE = "0001" MOMENTARY_CMD_END = "10" CONTINUOUS_CMD_BREAK = "102" CONTINUOUS_CMD_END = "1111111111" // Command data sequences. // These are all specified in hex. REMOTE1 = "6695" REMOTE2 = "999a" CMD_NICK = "6a" CMD_CONTINUOUS = "66" )
Variables ¶
View Source
var CollarRequest_CommandType_name = map[int32]string{
0: "UNKNOWN",
1: "NICK",
2: "SHOCK",
3: "BEEP",
}
View Source
var CollarRequest_CommandType_value = map[string]int32{
"UNKNOWN": 0,
"NICK": 1,
"SHOCK": 2,
"BEEP": 3,
}
Functions ¶
func RegisterCollarServer ¶
func RegisterCollarServer(s *grpc.Server, srv CollarServer)
Types ¶
type CollarClient ¶
type CollarClient interface {
SendCommand(ctx context.Context, in *CollarRequest, opts ...grpc.CallOption) (*CollarResponse, error)
}
CollarClient is the client API for Collar service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCollarClient ¶
func NewCollarClient(cc *grpc.ClientConn) CollarClient
type CollarRequest ¶
type CollarRequest struct { Type CollarRequest_CommandType `protobuf:"varint,1,opt,name=type,proto3,enum=shockcollar.CollarRequest_CommandType" json:"type,omitempty"` // Command duration in milliseconds. Ignored for the NICK command. DurationMs int32 `protobuf:"varint,2,opt,name=duration_ms,json=durationMs,proto3" json:"duration_ms,omitempty"` // Intensity for NICK and SHOCK commands. Ranges from 0 to 7 inclusive. Intensity int32 `protobuf:"varint,3,opt,name=intensity,proto3" json:"intensity,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CollarRequest) Descriptor ¶
func (*CollarRequest) Descriptor() ([]byte, []int)
func (*CollarRequest) GetDurationMs ¶
func (m *CollarRequest) GetDurationMs() int32
func (*CollarRequest) GetIntensity ¶
func (m *CollarRequest) GetIntensity() int32
func (*CollarRequest) GetType ¶
func (m *CollarRequest) GetType() CollarRequest_CommandType
func (*CollarRequest) ProtoMessage ¶
func (*CollarRequest) ProtoMessage()
func (*CollarRequest) Reset ¶
func (m *CollarRequest) Reset()
func (*CollarRequest) String ¶
func (m *CollarRequest) String() string
func (*CollarRequest) XXX_DiscardUnknown ¶
func (m *CollarRequest) XXX_DiscardUnknown()
func (*CollarRequest) XXX_Marshal ¶
func (m *CollarRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CollarRequest) XXX_Merge ¶
func (m *CollarRequest) XXX_Merge(src proto.Message)
func (*CollarRequest) XXX_Size ¶
func (m *CollarRequest) XXX_Size() int
func (*CollarRequest) XXX_Unmarshal ¶
func (m *CollarRequest) XXX_Unmarshal(b []byte) error
type CollarRequest_CommandType ¶
type CollarRequest_CommandType int32
const ( CollarRequest_UNKNOWN CollarRequest_CommandType = 0 CollarRequest_NICK CollarRequest_CommandType = 1 CollarRequest_SHOCK CollarRequest_CommandType = 2 CollarRequest_BEEP CollarRequest_CommandType = 3 )
func (CollarRequest_CommandType) EnumDescriptor ¶
func (CollarRequest_CommandType) EnumDescriptor() ([]byte, []int)
func (CollarRequest_CommandType) String ¶
func (x CollarRequest_CommandType) String() string
type CollarResponse ¶
type CollarResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CollarResponse) Descriptor ¶
func (*CollarResponse) Descriptor() ([]byte, []int)
func (*CollarResponse) ProtoMessage ¶
func (*CollarResponse) ProtoMessage()
func (*CollarResponse) Reset ¶
func (m *CollarResponse) Reset()
func (*CollarResponse) String ¶
func (m *CollarResponse) String() string
func (*CollarResponse) XXX_DiscardUnknown ¶
func (m *CollarResponse) XXX_DiscardUnknown()
func (*CollarResponse) XXX_Marshal ¶
func (m *CollarResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CollarResponse) XXX_Merge ¶
func (m *CollarResponse) XXX_Merge(src proto.Message)
func (*CollarResponse) XXX_Size ¶
func (m *CollarResponse) XXX_Size() int
func (*CollarResponse) XXX_Unmarshal ¶
func (m *CollarResponse) XXX_Unmarshal(b []byte) error
type CollarServer ¶
type CollarServer interface {
SendCommand(context.Context, *CollarRequest) (*CollarResponse, error)
}
CollarServer is the server API for Collar service.
type Sd400 ¶
type Sd400 struct {
// contains filtered or unexported fields
}
func (*Sd400) SendCommand ¶
func (s *Sd400) SendCommand(ctx context.Context, request *CollarRequest) (*CollarResponse, error)
Click to show internal directories.
Click to hide internal directories.