forked from electricbubble/gidevice
-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
testmanagerd.go
50 lines (40 loc) · 1.39 KB
/
testmanagerd.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package giDevice
import (
"github.com/SonicCloudOrg/sonic-gidevice/pkg/libimobiledevice"
)
var _ Testmanagerd = (*testmanagerd)(nil)
func newTestmanagerd(client *libimobiledevice.TestmanagerdClient, iOSVersion []int) *testmanagerd {
return &testmanagerd{
client: client,
iOSVersion: iOSVersion,
}
}
type testmanagerd struct {
client *libimobiledevice.TestmanagerdClient
iOSVersion []int
}
func (t *testmanagerd) notifyOfPublishedCapabilities() (err error) {
_, err = t.client.Connection()
return
}
func (t *testmanagerd) requestChannel(channel string) (id uint32, err error) {
return t.client.MakeChannel(channel)
}
func (t *testmanagerd) newXCTestManagerDaemon() (xcTestManager XCTestManagerDaemon, err error) {
var channelCode uint32
if channelCode, err = t.requestChannel("dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface"); err != nil {
return nil, err
}
xcTestManager = newXcTestManagerDaemon(t, channelCode)
return
}
func (t *testmanagerd) invoke(selector string, args *libimobiledevice.AuxBuffer, channelCode uint32, expectsReply bool) (
result *libimobiledevice.DTXMessageResult, err error) {
return t.client.Invoke(selector, args, channelCode, expectsReply)
}
func (t *testmanagerd) registerCallback(obj string, cb func(m libimobiledevice.DTXMessageResult)) {
t.client.RegisterCallback(obj, cb)
}
func (t *testmanagerd) close() {
t.client.Close()
}