How to use the pymtp.models.LIBMTP_DeviceEntry function in PyMTP

To help you get started, we’ve selected a few PyMTP examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emdete / python-mtp / pymtp / models.py View on Github external
data = property(_get_data, _set_data)

# ---------
# Beginning LIBMTP_RawDevice and MTPRawDevice
# ---------
class LIBMTP_RawDevice(ctypes.Structure):
	"""
		LIBMTP_RawDevice

		The ctypes tructure for LIBMTP_raw_device_struct
	"""
	def __repr__(self):
		return self.devnum

LIBMTP_RawDevice._fields_ = [
	("device_entry", LIBMTP_DeviceEntry),
	("bus_location", ctypes.c_uint32),
	("devnum", ctypes.c_uint8),
	]

LIBMTP_RawDevice_p = ctypes.POINTER(LIBMTP_RawDevice)

class MTPRawDevice(BaseModel):
	"""
		MTPRawDevice

		An object representing a raw MTP device entry
	"""
	@property
	def device_id(self):
		"""
			A somewhat unique identifier for the device based on the bus
github emdete / python-mtp / pymtp / models.py View on Github external
# ---------
# Begin LIBMTP_DeviceEntry and MTPDeviceEntry
# ---------

class LIBMTP_DeviceEntry(ctypes.Structure):
	"""
		LibMTP_DeviceEntry

		Contains the CTypes structure for LIBMTP_device_entry_struct
	"""

	def __repr__(self):
		return "%s %s" % (self.vendor_id, self.product_id)

LIBMTP_DeviceEntry._fields_ = [
	("vendor", ctypes.c_char_p),
	("vendor_id", ctypes.c_uint16),
	("product", ctypes.c_char_p),
	("product_id", ctypes.c_uint16),
	("device_flags", ctypes.c_uint32),
	]

class MTPDeviceEntry(BaseModel):
	"""
		MTPDeviceEntry

		An object representing a MTP device entry.
	"""

	@property
	def vendor(self):