Skip to content

Commit

Permalink
docs: add docs to device manager
Browse files Browse the repository at this point in the history
  • Loading branch information
NSEcho committed Jan 24, 2024
2 parents d6a7447 + 6e325be commit ef5b483
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frida/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (d *deviceManager) RemoteDevice() (*Device, error) {
}

// DeviceByID will return device with id passed or an error if it can't find any.
// Note: the caller must call EnumerateDevices() to get devices that are of type usb
func (d *deviceManager) DeviceByID(id string) (*Device, error) {
idC := C.CString(id)
defer C.free(unsafe.Pointer(idC))
Expand All @@ -97,6 +98,7 @@ func (d *deviceManager) DeviceByID(id string) (*Device, error) {
}

// DeviceByType will return device or an error by device type specified.
// Note: the caller must call EnumerateDevices() to get devices that are of type usb
func (d *deviceManager) DeviceByType(devType DeviceType) (*Device, error) {
var err *C.GError
device := C.frida_device_manager_get_device_by_type_sync(d.manager,
Expand All @@ -111,6 +113,7 @@ func (d *deviceManager) DeviceByType(devType DeviceType) (*Device, error) {
}

// FindDeviceByID will try to find the device by id specified
// Note: the caller must call EnumerateDevices() to get devices that are of type usb
func (d *deviceManager) FindDeviceByID(id string) (*Device, error) {
devID := C.CString(id)
defer C.free(unsafe.Pointer(devID))
Expand All @@ -131,6 +134,7 @@ func (d *deviceManager) FindDeviceByID(id string) (*Device, error) {
}

// FindDeviceByType will try to find the device by device type specified
// Note: the caller must call EnumerateDevices() to get devices that are of type usb
func (d *deviceManager) FindDeviceByType(devType DeviceType) (*Device, error) {
timeout := C.gint(defaultDeviceTimeout)

Expand Down

0 comments on commit ef5b483

Please sign in to comment.