refactor: move gidevice to hrp pkg

This commit is contained in:
debugtalk
2022-10-23 22:59:34 +08:00
parent 896f39c3f2
commit 91626bcdd4
85 changed files with 10476 additions and 65 deletions
+27
View File
@@ -0,0 +1,27 @@
package gidevice
import "github.com/httprunner/httprunner/v4/hrp/pkg/gidevice/pkg/libimobiledevice"
var _ SimulateLocation = (*simulateLocation)(nil)
func newSimulateLocation(client *libimobiledevice.SimulateLocationClient) *simulateLocation {
return &simulateLocation{
client: client,
}
}
type simulateLocation struct {
client *libimobiledevice.SimulateLocationClient
}
func (s *simulateLocation) Update(longitude float64, latitude float64, coordinateSystem ...CoordinateSystem) (err error) {
if len(coordinateSystem) == 0 {
coordinateSystem = []CoordinateSystem{CoordinateSystemWGS84}
}
pkt := s.client.NewLocationPacket(longitude, latitude, coordinateSystem[0])
return s.client.SendPacket(pkt)
}
func (s *simulateLocation) Recover() (err error) {
return s.client.Recover()
}