MCPcopy Create free account
hub / github.com/drosoCode/atvremote / Connect

Method Connect

pkg/v2/command/command.go:140–158  ·  view source on GitHub ↗

Connect to the android tv device

()

Source from the content-addressed store, hash-verified

138
139// Connect to the android tv device
140func (c *Command) Connect() error {
141 config := &tls.Config{Certificates: []tls.Certificate{*c.Certificates}, InsecureSkipVerify: true}
142
143 conn, err := tls.Dial("tcp", c.Address+":"+strconv.Itoa(c.Port), config)
144 if err != nil {
145 return errors.New("command - connexion: " + err.Error())
146 }
147 c.Connection = conn
148
149 state := conn.ConnectionState()
150 for !state.HandshakeComplete {
151 }
152
153 go c.readLoop()
154
155 c.sendConfiguration()
156
157 return nil
158}
159
160// handle message from the android tv device
161func (c *Command) handleData(raw []byte) {

Callers

nothing calls this directly

Calls 2

readLoopMethod · 0.95
sendConfigurationMethod · 0.95

Tested by

no test coverage detected