Documentation ¶
Index ¶
- type Radio
- func (r *Radio) AddChannel(name string, cIndex int) error
- func (r *Radio) Close()
- func (r *Radio) DeleteChannel(cIndex int) error
- func (r *Radio) FactoryRest() error
- func (r *Radio) GetChannelInfo(index int) (channelSettings *pb.Channel, err error)
- func (r *Radio) GetChannels() (channels []*pb.Channel, err error)
- func (r *Radio) GetRadioConfig() (configPackets []*pb.FromRadio_Config, ...)
- func (r *Radio) GetRadioInfo() (radioResponses []*pb.FromRadio, err error)
- func (r *Radio) Init(port string) error
- func (r *Radio) ReadResponse(timeout bool) (FromRadioPackets []*pb.FromRadio, err error)
- func (r *Radio) SendTextMessage(message string, to int64) error
- func (r *Radio) SetChannel(chIndex int, key string, value string) error
- func (r *Radio) SetChannelURL(url string) error
- func (r *Radio) SetLocation(lat float64, long float64, alt int32) error
- func (r *Radio) SetModemMode(mode string) error
- func (r *Radio) SetRadioConfig(key string, value string) error
- func (r *Radio) SetRadioOwner(name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Radio ¶
type Radio struct {
// contains filtered or unexported fields
}
Radio holds the port and serial io.ReadWriteCloser struct to maintain one serial connection
func (*Radio) AddChannel ¶
AddChannel adds a new channel to the radio
func (*Radio) Close ¶
func (r *Radio) Close()
Close closes the serial port. Added so users can defer the close after opening
func (*Radio) DeleteChannel ¶
Delete a channel from the radio
func (*Radio) FactoryRest ¶ added in v0.1.8
Send a factory reset command to the radio
func (*Radio) GetChannelInfo ¶
GetChannelInfo returns the current chanels settings for the radio
func (*Radio) GetChannels ¶ added in v0.1.8
GetChannelInfo returns the current chanels settings for the radio
func (*Radio) GetRadioConfig ¶ added in v0.1.8
func (r *Radio) GetRadioConfig() (configPackets []*pb.FromRadio_Config, modulePackets []*pb.FromRadio_ModuleConfig, err error)
GetRadioConfig returns a filtered list of raiod and module config settings
func (*Radio) GetRadioInfo ¶
GetRadioInfo retrieves information from the radio including config and adjacent Node information
func (*Radio) ReadResponse ¶ added in v0.1.3
ReadResponse reads any responses in the serial port, convert them to a FromRadio protobuf and return
func (*Radio) SendTextMessage ¶
SendTextMessage sends a free form text message to other radios
func (*Radio) SetChannel ¶
SetChannel sets a channel value
func (*Radio) SetChannelURL ¶
SetChannelURL sets the channel for the radio. The incoming channel should match the meshtastic URL format of a URL ending with /#{base_64_encoded_radio_params}
func (*Radio) SetLocation ¶
SetLocation sets a fixed location for the radio
func (*Radio) SetModemMode ¶
SetModemMode sets the channel modem setting to be fast or slow
func (*Radio) SetRadioConfig ¶ added in v0.1.8
SetRadioConfig allows an freeform setting of values in the RadioConfig_UserPreferences struct
func (*Radio) SetRadioOwner ¶
SetRadioOwner sets the owner of the radio visible on the public mesh