+
    :i  c                   s   a  R t0 t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	 ^ RI
Ht ^RIHtHtHt ]P                   ! ]4      tRtRtRtR	tR
t ! R R]	4      tR tR tR t]! 4       t] ^ k R tR# )i    N)Set)OtpConnection)	LOG_LEVEL)	USAGE_OTP
YUBICO_VIDOtpYubiKeyDevicel   H  l   H  l   H  l   H  l   H  c                   s8   a  ] tR t^7t o R tR tR tR tRtV t	R# )HidrawConnectionc                s(    \        VR 4      V n        R# )ZwbN)openhandle)selfZpaths   &&4/usr/lib/python3.14/site-packages/ykman/hid/linux.py__init__ZHidrawConnection.__init__8   s    4&    c                s:    V P                   P                  4        R # )N)r   close)r	   s   &r
   r   ZHidrawConnection.close;   s    r   c                s    \        ^	4      p\        P                  ! V P                  \        VR4       \        VR,          4      p\        P                  \        P                  RVP                  4       4       V# )   Tr   NNzRECV: %s)	bytearrayfcntlioctlr   USB_GET_REPORTZbytesloggerlogr   TRAFFIChex)r	   bufdata   &  r
   receiveZHidrawConnection.receive>   sP    DKKd;SW~

9$$j$((*=r   c                s    \         P                  \        P                  R VP	                  4       4       \        ^ .4      pVP                  V4       \        P                  ! V P                  \        VR4       R# )zSEND: %sTN)r   r   r   r   r   r   Zextendr   r   r   USB_SET_REPORT)r	   r   r   s   && r
   sendZHidrawConnection.sendE   sK    

9$$j$((*=n

4DKKd;r   )r   N)
__name__Z
__module__Z__qualname__Z__firstlineno__r   r   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__   @r
   r   r   7   s     '< <r   r   c                 s    \        ^4      p\        P                  ! V \        VR4       \        P
                  ! RV4      # )   Tz<IHH)r   r   r   HIDIOCGRAWINFOstructunpack)devr   s   & r
   get_infor%   L   s/    
I
C	KK^S$/==%%r   c                 s    \        ^4      p\        P                  ! V \        VR4       \        P
                  ! RV4      ^ ,          pV\        V4      ,          p\        P                  ! V \        VR4       VR,          # )r    T<I:r    NN)r   r   r   HIDIOCGRDESCSIZEr"   r#   HIDIOCGRDESC)r$   r   sizer   r
   get_descriptorr*   R   s\    
A,C	KK%sD1==s#A&D9T?C	KK\3-r7Nr   c                 s   \        V 4      pR R r2V'       d   V^ ,          VR,          r^V,          ^V,          reVR V WR  rV^8X  d8   \        P                  ! RVP                  ^R4      4      ^ ,          pVe   W23# Kp  V^8X  g   Ky  \        P                  ! RVP                  ^R4      4      ^ ,          pVf   K  W23# R # )Nr   r&   s    )r*   r"   r#   Zljust)r$   r   ZusageZ
usage_pageZheadZtypr)   Zvalues   &       r
   	get_usager+   [   s    

Ct:
FCGc4KT$ZUs!8tU[[E-BCAFJ !(( !AXMM$Au(=>qAE%!(( r   c            
      s   . p \         P                   ! R 4       F  p \        VR4      ;_uu_ 4       p\        V4      w  r4pV\        8X  d4   \	        V4      \
        8X  d    V P                  \        W\        4      4       RRR4       V\        9   d   \        P                  V4       K  K  	  V #   + '       g   i     L8; i  \         d?    T\        9  d0   \        P                  RT 2RR7       \        P                  T4        K  i ; i)z/dev/hidraw*ZrbNz!Couldn't read HID descriptor for T)Zexc_info)globr   r%   r   r+   r   Zappendr   r   _failed_cacheZremoveZ	Exceptionr   ZdebugZadd)ZdevicesZhidrawZfZbustypeZvidZpids         r
   list_devicesr.   p   s    G))N+	fd##q$,QK!c*$1)BNN#3FAQ#RS $ &$$V, ' ,  N $#  	]*7x@4   !!&)	s*   CAB.>(C.B>9CAD
	D
c                sV    V ^8  d   Qh/ ^ \         9   d   \        \        ,          ;R&   # )i   r-   )__conditional_annotations__r    Zstr)Zformats   "r
   __annotate__r0      s    b   s3x c r   ) r/   r   r,   Zloggingr"   ZsysZtypingr    Zyubikit.core.otpr   Zyubikit.loggingr   Zbaser   r   r   Z	getLoggerr   r   r   r   r!   r'   r(   r   r%   r*   r+   Zsetr-   r.   r0   )r/   r   r
   <module>r1      s   8     
  * % 9 9
 
		8	$   <} <*&)$ % r   