🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-08-07 22:56:51 | PHP 8.2.32
📂
/ (Root)
/
usr
/
lib
/
python3.6
/
site-packages
/
serial
/
tools
/
__pycache__
📍 /usr/lib/python3.6/site-packages/serial/tools/__pycache__
🔄 Refresh
✏️
Editing: list_ports_osx.cpython-36.pyc
Read Only
3 M�]W�# � @ s. d dl Z d dlZ d dlmZ e jje jjd��Ze jje jjd��Z e j jed�Ze j je d�Z d Ze j ej_e j e j e j gej_e j ej_e j e j e j gej_e j e j e j e jgej_e j ej_e j e j e j gej_e j ej_e j e j gej_e j ej_e j e j gej_e j ej_e j gej_e j e je jge j_e j e j_e j e jge j_e je j_e j e je j ge j_e j e j_e j ge j_de j_dZ dZ!d Z"d Z#dd� Z$d d� Z%dd� Zdd� Z&dd� Z'dd� Z(G dd� de)�Z*dd� Z+dd� Z,dd� Z-e.dk�r*x,e/e-� �D ]\Z0Z1Z2e3d j4e0e1e2�� �qW dS )!� N)�list_ports_commonZIOKitZCoreFoundation�kIOMasterPortDefault�kCFAllocatorDefault� � � � c C sX t jt|jd�t�}tj| |td�}d}|rTt j|d�}|dk rJ|jd�}t j |� |S )z� Search the given device for the specified string property @param device_type Type of Device @param property String to search for @return Python string containing the value, or None if not found. � mac_romanr N) �cf�CFStringCreateWithCStringr �encode�kCFStringEncodingMacRoman�iokit�IORegistryEntryCreateCFProperty�CFStringGetCStringPtr�decode� CFRelease)�device_type�property�key�CFContainer�output� r �$/usr/lib/python3.6/list_ports_osx.py�get_string_propertyO s r c C sr t jt|jd�t�}tj| |td�}|rn|tkr:tj � }n|t krJtj� }t j||tj |�� t j|� |jS dS )a Search the given device for the specified string property @param device_type Device to search @param property String to search for @param cf_number_type CFType number @return Python string containing the value, or None if not found. r r N)r r r r r r r �kCFNumberSInt32Type�ctypes�c_uint32�kCFNumberSInt16TypeZc_uint16�CFNumberGetValue�byrefr �value)r r Zcf_number_typer r Znumberr r r �get_int_propertyk s$ r"