Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterTuneServiceServer(s grpc.ServiceRegistrar, srv TuneServiceServer)
- type PlayTuneRequest
- func (*PlayTuneRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PlayTuneRequest) GetTuneDescription() *TuneDescription
- func (*PlayTuneRequest) ProtoMessage()
- func (x *PlayTuneRequest) ProtoReflect() protoreflect.Message
- func (x *PlayTuneRequest) Reset()
- func (x *PlayTuneRequest) String() string
- type PlayTuneResponse
- type ServiceImpl
- type SongElement
- func (SongElement) Descriptor() protoreflect.EnumDescriptor
- func (x SongElement) Enum() *SongElement
- func (SongElement) EnumDescriptor() ([]byte, []int)deprecated
- func (x SongElement) Number() protoreflect.EnumNumber
- func (x SongElement) String() string
- func (SongElement) Type() protoreflect.EnumType
- type TuneDescription
- func (*TuneDescription) Descriptor() ([]byte, []int)deprecated
- func (x *TuneDescription) GetSongElements() []SongElement
- func (x *TuneDescription) GetTempo() int32
- func (*TuneDescription) ProtoMessage()
- func (x *TuneDescription) ProtoReflect() protoreflect.Message
- func (x *TuneDescription) Reset()
- func (x *TuneDescription) String() string
- type TuneResult
- func (*TuneResult) Descriptor() ([]byte, []int)deprecated
- func (x *TuneResult) GetResult() TuneResult_Result
- func (x *TuneResult) GetResultStr() string
- func (*TuneResult) ProtoMessage()
- func (x *TuneResult) ProtoReflect() protoreflect.Message
- func (x *TuneResult) Reset()
- func (x *TuneResult) String() string
- type TuneResult_Result
- func (TuneResult_Result) Descriptor() protoreflect.EnumDescriptor
- func (x TuneResult_Result) Enum() *TuneResult_Result
- func (TuneResult_Result) EnumDescriptor() ([]byte, []int)deprecated
- func (x TuneResult_Result) Number() protoreflect.EnumNumber
- func (x TuneResult_Result) String() string
- func (TuneResult_Result) Type() protoreflect.EnumType
- type TuneServiceClient
- type TuneServiceServer
- type UnimplementedTuneServiceServer
- type UnsafeTuneServiceServer
Constants ¶
const (
TuneService_PlayTune_FullMethodName = "/mavsdk.rpc.tune.TuneService/PlayTune"
)
Variables ¶
var ( SongElement_name = map[int32]string{ 0: "SONG_ELEMENT_STYLE_LEGATO", 1: "SONG_ELEMENT_STYLE_NORMAL", 2: "SONG_ELEMENT_STYLE_STACCATO", 3: "SONG_ELEMENT_DURATION_1", 4: "SONG_ELEMENT_DURATION_2", 5: "SONG_ELEMENT_DURATION_4", 6: "SONG_ELEMENT_DURATION_8", 7: "SONG_ELEMENT_DURATION_16", 8: "SONG_ELEMENT_DURATION_32", 9: "SONG_ELEMENT_NOTE_A", 10: "SONG_ELEMENT_NOTE_B", 11: "SONG_ELEMENT_NOTE_C", 12: "SONG_ELEMENT_NOTE_D", 13: "SONG_ELEMENT_NOTE_E", 14: "SONG_ELEMENT_NOTE_F", 15: "SONG_ELEMENT_NOTE_G", 16: "SONG_ELEMENT_NOTE_PAUSE", 17: "SONG_ELEMENT_SHARP", 18: "SONG_ELEMENT_FLAT", 19: "SONG_ELEMENT_OCTAVE_UP", 20: "SONG_ELEMENT_OCTAVE_DOWN", } SongElement_value = map[string]int32{ "SONG_ELEMENT_STYLE_LEGATO": 0, "SONG_ELEMENT_STYLE_NORMAL": 1, "SONG_ELEMENT_STYLE_STACCATO": 2, "SONG_ELEMENT_DURATION_1": 3, "SONG_ELEMENT_DURATION_2": 4, "SONG_ELEMENT_DURATION_4": 5, "SONG_ELEMENT_DURATION_8": 6, "SONG_ELEMENT_DURATION_16": 7, "SONG_ELEMENT_DURATION_32": 8, "SONG_ELEMENT_NOTE_A": 9, "SONG_ELEMENT_NOTE_B": 10, "SONG_ELEMENT_NOTE_C": 11, "SONG_ELEMENT_NOTE_D": 12, "SONG_ELEMENT_NOTE_E": 13, "SONG_ELEMENT_NOTE_F": 14, "SONG_ELEMENT_NOTE_G": 15, "SONG_ELEMENT_NOTE_PAUSE": 16, "SONG_ELEMENT_SHARP": 17, "SONG_ELEMENT_FLAT": 18, "SONG_ELEMENT_OCTAVE_UP": 19, "SONG_ELEMENT_OCTAVE_DOWN": 20, } )
Enum value maps for SongElement.
var ( TuneResult_Result_name = map[int32]string{ 0: "RESULT_UNKNOWN", 1: "RESULT_SUCCESS", 2: "RESULT_INVALID_TEMPO", 3: "RESULT_TUNE_TOO_LONG", 4: "RESULT_ERROR", 5: "RESULT_NO_SYSTEM", } TuneResult_Result_value = map[string]int32{ "RESULT_UNKNOWN": 0, "RESULT_SUCCESS": 1, "RESULT_INVALID_TEMPO": 2, "RESULT_TUNE_TOO_LONG": 3, "RESULT_ERROR": 4, "RESULT_NO_SYSTEM": 5, } )
Enum value maps for TuneResult_Result.
var File_tune_proto protoreflect.FileDescriptor
var TuneService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "mavsdk.rpc.tune.TuneService", HandlerType: (*TuneServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "PlayTune", Handler: _TuneService_PlayTune_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "tune.proto", }
TuneService_ServiceDesc is the grpc.ServiceDesc for TuneService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTuneServiceServer ¶
func RegisterTuneServiceServer(s grpc.ServiceRegistrar, srv TuneServiceServer)
Types ¶
type PlayTuneRequest ¶
type PlayTuneRequest struct { TuneDescription *TuneDescription `protobuf:"bytes,1,opt,name=tune_description,json=tuneDescription,proto3" json:"tune_description,omitempty"` // The tune to be played // contains filtered or unexported fields }
func (*PlayTuneRequest) Descriptor
deprecated
func (*PlayTuneRequest) Descriptor() ([]byte, []int)
Deprecated: Use PlayTuneRequest.ProtoReflect.Descriptor instead.
func (*PlayTuneRequest) GetTuneDescription ¶
func (x *PlayTuneRequest) GetTuneDescription() *TuneDescription
func (*PlayTuneRequest) ProtoMessage ¶
func (*PlayTuneRequest) ProtoMessage()
func (*PlayTuneRequest) ProtoReflect ¶
func (x *PlayTuneRequest) ProtoReflect() protoreflect.Message
func (*PlayTuneRequest) Reset ¶
func (x *PlayTuneRequest) Reset()
func (*PlayTuneRequest) String ¶
func (x *PlayTuneRequest) String() string
type PlayTuneResponse ¶
type PlayTuneResponse struct { TuneResult *TuneResult `protobuf:"bytes,1,opt,name=tune_result,json=tuneResult,proto3" json:"tune_result,omitempty"` // contains filtered or unexported fields }
func (*PlayTuneResponse) Descriptor
deprecated
func (*PlayTuneResponse) Descriptor() ([]byte, []int)
Deprecated: Use PlayTuneResponse.ProtoReflect.Descriptor instead.
func (*PlayTuneResponse) GetTuneResult ¶
func (x *PlayTuneResponse) GetTuneResult() *TuneResult
func (*PlayTuneResponse) ProtoMessage ¶
func (*PlayTuneResponse) ProtoMessage()
func (*PlayTuneResponse) ProtoReflect ¶
func (x *PlayTuneResponse) ProtoReflect() protoreflect.Message
func (*PlayTuneResponse) Reset ¶
func (x *PlayTuneResponse) Reset()
func (*PlayTuneResponse) String ¶
func (x *PlayTuneResponse) String() string
type ServiceImpl ¶
type ServiceImpl struct {
Client TuneServiceClient
}
func (*ServiceImpl) PlayTune ¶
func (s *ServiceImpl) PlayTune(ctx context.Context, tuneDescription *TuneDescription) (*PlayTuneResponse, error)
type SongElement ¶
type SongElement int32
An element of the tune
const ( SongElement_SONG_ELEMENT_STYLE_LEGATO SongElement = 0 // After this element, start playing legato SongElement_SONG_ELEMENT_STYLE_NORMAL SongElement = 1 // After this element, start playing normal SongElement_SONG_ELEMENT_STYLE_STACCATO SongElement = 2 // After this element, start playing staccato SongElement_SONG_ELEMENT_DURATION_1 SongElement = 3 // After this element, set the note duration to 1 SongElement_SONG_ELEMENT_DURATION_2 SongElement = 4 // After this element, set the note duration to 2 SongElement_SONG_ELEMENT_DURATION_4 SongElement = 5 // After this element, set the note duration to 4 SongElement_SONG_ELEMENT_DURATION_8 SongElement = 6 // After this element, set the note duration to 8 SongElement_SONG_ELEMENT_DURATION_16 SongElement = 7 // After this element, set the note duration to 16 SongElement_SONG_ELEMENT_DURATION_32 SongElement = 8 // After this element, set the note duration to 32 SongElement_SONG_ELEMENT_NOTE_A SongElement = 9 // Play note A SongElement_SONG_ELEMENT_NOTE_B SongElement = 10 // Play note B SongElement_SONG_ELEMENT_NOTE_C SongElement = 11 // Play note C SongElement_SONG_ELEMENT_NOTE_D SongElement = 12 // Play note D SongElement_SONG_ELEMENT_NOTE_E SongElement = 13 // Play note E SongElement_SONG_ELEMENT_NOTE_F SongElement = 14 // Play note F SongElement_SONG_ELEMENT_NOTE_G SongElement = 15 // Play note G SongElement_SONG_ELEMENT_NOTE_PAUSE SongElement = 16 // Play a rest SongElement_SONG_ELEMENT_SHARP SongElement = 17 // After this element, sharp the note (half a step up) SongElement_SONG_ELEMENT_FLAT SongElement = 18 // After this element, flat the note (half a step down) SongElement_SONG_ELEMENT_OCTAVE_UP SongElement = 19 // After this element, shift the note 1 octave up SongElement_SONG_ELEMENT_OCTAVE_DOWN SongElement = 20 // After this element, shift the note 1 octave down )
func (SongElement) Descriptor ¶
func (SongElement) Descriptor() protoreflect.EnumDescriptor
func (SongElement) Enum ¶
func (x SongElement) Enum() *SongElement
func (SongElement) EnumDescriptor
deprecated
func (SongElement) EnumDescriptor() ([]byte, []int)
Deprecated: Use SongElement.Descriptor instead.
func (SongElement) Number ¶
func (x SongElement) Number() protoreflect.EnumNumber
func (SongElement) String ¶
func (x SongElement) String() string
func (SongElement) Type ¶
func (SongElement) Type() protoreflect.EnumType
type TuneDescription ¶
type TuneDescription struct { SongElements []SongElement `` // The list of song elements (notes, pauses, ...) to be played /* 138-byte string literal not displayed */ Tempo int32 `protobuf:"varint,2,opt,name=tempo,proto3" json:"tempo,omitempty"` // The tempo of the song (range: 32 - 255) // contains filtered or unexported fields }
Tune description, containing song elements and tempo.
func (*TuneDescription) Descriptor
deprecated
func (*TuneDescription) Descriptor() ([]byte, []int)
Deprecated: Use TuneDescription.ProtoReflect.Descriptor instead.
func (*TuneDescription) GetSongElements ¶
func (x *TuneDescription) GetSongElements() []SongElement
func (*TuneDescription) GetTempo ¶
func (x *TuneDescription) GetTempo() int32
func (*TuneDescription) ProtoMessage ¶
func (*TuneDescription) ProtoMessage()
func (*TuneDescription) ProtoReflect ¶
func (x *TuneDescription) ProtoReflect() protoreflect.Message
func (*TuneDescription) Reset ¶
func (x *TuneDescription) Reset()
func (*TuneDescription) String ¶
func (x *TuneDescription) String() string
type TuneResult ¶
type TuneResult struct { Result TuneResult_Result `protobuf:"varint,1,opt,name=result,proto3,enum=mavsdk.rpc.tune.TuneResult_Result" json:"result,omitempty"` // Result enum value ResultStr string `protobuf:"bytes,2,opt,name=result_str,json=resultStr,proto3" json:"result_str,omitempty"` // Human-readable English string describing the result // contains filtered or unexported fields }
func (*TuneResult) Descriptor
deprecated
func (*TuneResult) Descriptor() ([]byte, []int)
Deprecated: Use TuneResult.ProtoReflect.Descriptor instead.
func (*TuneResult) GetResult ¶
func (x *TuneResult) GetResult() TuneResult_Result
func (*TuneResult) GetResultStr ¶
func (x *TuneResult) GetResultStr() string
func (*TuneResult) ProtoMessage ¶
func (*TuneResult) ProtoMessage()
func (*TuneResult) ProtoReflect ¶
func (x *TuneResult) ProtoReflect() protoreflect.Message
func (*TuneResult) Reset ¶
func (x *TuneResult) Reset()
func (*TuneResult) String ¶
func (x *TuneResult) String() string
type TuneResult_Result ¶
type TuneResult_Result int32
Possible results returned for tune requests.
const ( TuneResult_RESULT_UNKNOWN TuneResult_Result = 0 // Unknown result TuneResult_RESULT_SUCCESS TuneResult_Result = 1 // Request succeeded TuneResult_RESULT_INVALID_TEMPO TuneResult_Result = 2 // Invalid tempo (range: 32 - 255) TuneResult_RESULT_TUNE_TOO_LONG TuneResult_Result = 3 // Invalid tune: encoded string must be at most 247 chars TuneResult_RESULT_ERROR TuneResult_Result = 4 // Failed to send the request TuneResult_RESULT_NO_SYSTEM TuneResult_Result = 5 // No system connected )
func (TuneResult_Result) Descriptor ¶
func (TuneResult_Result) Descriptor() protoreflect.EnumDescriptor
func (TuneResult_Result) Enum ¶
func (x TuneResult_Result) Enum() *TuneResult_Result
func (TuneResult_Result) EnumDescriptor
deprecated
func (TuneResult_Result) EnumDescriptor() ([]byte, []int)
Deprecated: Use TuneResult_Result.Descriptor instead.
func (TuneResult_Result) Number ¶
func (x TuneResult_Result) Number() protoreflect.EnumNumber
func (TuneResult_Result) String ¶
func (x TuneResult_Result) String() string
func (TuneResult_Result) Type ¶
func (TuneResult_Result) Type() protoreflect.EnumType
type TuneServiceClient ¶
type TuneServiceClient interface { // Send a tune to be played by the system. PlayTune(ctx context.Context, in *PlayTuneRequest, opts ...grpc.CallOption) (*PlayTuneResponse, error) }
TuneServiceClient is the client API for TuneService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
Enable creating and sending a tune to be played on the system.
func NewTuneServiceClient ¶
func NewTuneServiceClient(cc grpc.ClientConnInterface) TuneServiceClient
type TuneServiceServer ¶
type TuneServiceServer interface { // Send a tune to be played by the system. PlayTune(context.Context, *PlayTuneRequest) (*PlayTuneResponse, error) // contains filtered or unexported methods }
TuneServiceServer is the server API for TuneService service. All implementations must embed UnimplementedTuneServiceServer for forward compatibility.
Enable creating and sending a tune to be played on the system.
type UnimplementedTuneServiceServer ¶
type UnimplementedTuneServiceServer struct{}
UnimplementedTuneServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedTuneServiceServer) PlayTune ¶
func (UnimplementedTuneServiceServer) PlayTune(context.Context, *PlayTuneRequest) (*PlayTuneResponse, error)
type UnsafeTuneServiceServer ¶
type UnsafeTuneServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTuneServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TuneServiceServer will result in compilation errors.