
    'hH                    p   S SK Jr  SSKJrJr  S SKJr  S SKrS SKr " S S\R                  5      r
 " S S	\R                  5      r " S
 S\R                  5      r " S S\R                  5      r " S S\R                  5      r\ " S S5      5       r\ " S S5      5       r\ " S S5      5       r\ " S S5      5       r      S0S jr    S1S jrS2S jr          S3S jr    S4S jr        S5S jr S6         S7S jjr S6         S8S jjr      S9S  jr    S:S! jr        S;S" jr    S<S# jr      S=S$ jr    S>S% jr     S?S& jr!\" S'5      \ " S( S)5      5       5       r"\" S*5      \ " S+ S,5      5       5       r#\" S-5      \ " S. S/5      5       5       r$g)@    )annotations   )event_classT_JSON_DICT)	dataclassNc                  :    \ rS rSrSrSrSrSrS r\	S 5       r
Srg	)
CentralState   z*
Indicates the various states of Central.
absentzpowered-offz
powered-onc                    U R                   $ Nvalueselfs    ڄ/var/www/home/psychics-availability/venv/lib/python3.13/site-packages/selenium/webdriver/common/devtools/v139/bluetooth_emulation.pyto_jsonCentralState.to_json       zz    c                    U " U5      $ r    clsjsons     r   	from_jsonCentralState.from_json       4yr   r   N)__name__
__module____qualname____firstlineno____doc__ABSENTPOWERED_OFF
POWERED_ONr   classmethodr   __static_attributes__r   r   r   r	   r	      s1     FKJ  r   r	   c                  6    \ rS rSrSrSrSrS r\S 5       r	Sr
g)	GATTOperationType   z,
Indicates the various types of GATT event.

connection	discoveryc                    U R                   $ r   r   r   s    r   r   GATTOperationType.to_json$   r   r   c                    U " U5      $ r   r   r   s     r   r   GATTOperationType.from_json'   r   r   r   N)r   r    r!   r"   r#   
CONNECTION	DISCOVERYr   r'   r   r(   r   r   r   r*   r*      s,     JI  r   r*   c                  :    \ rS rSrSrSrSrSrS r\	S 5       r
Srg	)
CharacteristicWriteType,   z6
Indicates the various types of characteristic write.
zwrite-default-deprecatedzwrite-with-responsezwrite-without-responsec                    U R                   $ r   r   r   s    r   r   CharacteristicWriteType.to_json4   r   r   c                    U " U5      $ r   r   r   s     r   r   !CharacteristicWriteType.from_json7   r   r   r   N)r   r    r!   r"   r#   WRITE_DEFAULT_DEPRECATEDWRITE_WITH_RESPONSEWRITE_WITHOUT_RESPONSEr   r'   r   r(   r   r   r   r5   r5   ,   s4      :/5  r   r5   c                  >    \ rS rSrSrSrSrSrSrS r	\
S 5       rS	rg
)CharacteristicOperationType<   z:
Indicates the various types of characteristic operation.
readwritezsubscribe-to-notificationszunsubscribe-from-notificationsc                    U R                   $ r   r   r   s    r   r   #CharacteristicOperationType.to_jsonE   r   r   c                    U " U5      $ r   r   r   s     r   r   %CharacteristicOperationType.from_jsonH   r   r   r   N)r   r    r!   r"   r#   READWRITESUBSCRIBE_TO_NOTIFICATIONSUNSUBSCRIBE_FROM_NOTIFICATIONSr   r'   r   r(   r   r   r   r?   r?   <   s8     DE!=%E"  r   r?   c                  6    \ rS rSrSrSrSrS r\S 5       r	Sr
g)	DescriptorOperationTypeM   z6
Indicates the various types of descriptor operation.
rA   rB   c                    U R                   $ r   r   r   s    r   r   DescriptorOperationType.to_jsonT   r   r   c                    U " U5      $ r   r   r   s     r   r   !DescriptorOperationType.from_jsonW   r   r   r   N)r   r    r!   r"   r#   rG   rH   r   r'   r   r(   r   r   r   rL   rL   M   s,     DE  r   rL   c                  D    \ rS rSr% SrS\S'   S\S'   S r\S 5       rS	r	g
)ManufacturerData\   z
Stores the manufacturer data
intkeystrdatac                V    [        5       nU R                  US'   U R                  US'   U$ )NrV   rX   )dictrV   rX   r   r   s     r   r   ManufacturerData.to_jsoni   s(    vhhUyyVr   c                @    U " [        US   5      [        US   5      S9$ )NrV   rX   )rV   rX   )rU   rW   r   s     r   r   ManufacturerData.from_jsono   s'    DK T&\"
 	
r   r   N
r   r    r!   r"   r#   __annotations__r   r'   r   r(   r   r   r   rS   rS   \   s.     
H I 
 
r   rS   c                  v    \ rS rSr% SrSrS\S'   SrS\S'   SrS\S	'   Sr	S\S
'   Sr
S\S'   S r\S 5       rSrg)
ScanRecordw   zN
Stores the byte data of the advertisement packet sent by a Bluetooth device.
Ntyping.Optional[str]namez!typing.Optional[typing.List[str]]uuidsztyping.Optional[int]
appearancetx_powerz.typing.Optional[typing.List[ManufacturerData]]manufacturer_datac                   [        5       nU R                  b  U R                  US'   U R                  b  U R                   Vs/ s H  o"PM     snUS'   U R                  b  U R                  US'   U R                  b  U R                  US'   U R
                  b-  U R
                   Vs/ s H  o"R                  5       PM     snUS'   U$ s  snf s  snf )Nre   rf   rg   txPowermanufacturerData)rZ   re   rf   rg   rh   ri   r   )r   r   is      r   r   ScanRecord.to_json   s    v99 99DL::!(,

3
1Q
3DM??&!%D==$"mmDO!!-=A=S=S'T=S		=S'TD#$ 4 (Us   C&Cc                N   U " SU;   a  [        US   5      OS SU;   a  US    Vs/ s H  n[        U5      PM     snOS SU;   a  [        US   5      OS SU;   a  [        US   5      OS SU;   a+  US    Vs/ s H  n[        R                  U5      PM     snS9$ S S9$ s  snf s  snf )Nre   rf   rg   rk   rl   )re   rf   rg   rh   ri   )rW   rU   rS   r   )r   r   rm   s      r   r   ScanRecord.from_json   s    &,nT&\"$5<_4=1=a3q6=1$2>$2Fs4-.D-6$->Si)Dcuy}c}dK]F^_F^/99!<F^_
 	

 DH
 	
1 `s   B
5B"r   )r   r    r!   r"   r#   re   r`   rf   rg   rh   ri   r   r'   r   r(   r   r   r   rb   rb   w   sb     "&D
%/3E,3 (,J$+ &*H") IMEL 
 
r   rb   c                  N    \ rS rSr% SrS\S'   S\S'   S\S'   S	 r\S
 5       rSr	g)	ScanEntry   zQ
Stores the advertisement packet information that is sent by a Bluetooth device.
rW   device_addressrU   rssirb   scan_recordc                    [        5       nU R                  US'   U R                  US'   U R                  R	                  5       US'   U$ )NdeviceAddressru   
scanRecord)rZ   rt   ru   rv   r   r[   s     r   r   ScanEntry.to_json   sD    v $ 3 3_yyV!--557\r   c                n    U " [        US   5      [        US   5      [        R                  US   5      S9$ )Nrx   ru   ry   )rt   ru   rv   )rW   rU   rb   r   r   s     r   r   ScanEntry.from_json   s;    tO45T&\"",,T,-?@
 	
r   r   Nr_   r   r   r   rr   rr      s3     
I 
 
r   rr   c                      \ rS rSr% SrSrS\S'   SrS\S'   SrS\S'   Sr	S\S'   Sr
S\S	'   SrS\S
'   SrS\S'   SrS\S'   S r\S 5       rSrg)CharacteristicProperties   z
Describes the properties of a characteristic. This follows Bluetooth Core
Specification BT 4.2 Vol 3 Part G 3.3.1. Characteristic Properties.
Nztyping.Optional[bool]	broadcastrA   write_without_responserB   notifyindicateauthenticated_signed_writesextended_propertiesc                   [        5       nU R                  b  U R                  US'   U R                  b  U R                  US'   U R                  b  U R                  US'   U R                  b  U R                  US'   U R
                  b  U R
                  US'   U R                  b  U R                  US'   U R                  b  U R                  US'   U R                  b  U R                  US'   U$ )	Nr   rA   writeWithoutResponserB   r   r   authenticatedSignedWritesextendedProperties)	rZ   r   rA   r   rB   r   r   r   r   r[   s     r   r    CharacteristicProperties.to_json   s    v>>% $D99 99DL&&2+/+F+FD'(::! JJDM;;"![[DN==$#}}D++7040P0PD,-##/)-)A)AD%&r   c                `   U " SU;   a  [        US   5      OS SU;   a  [        US   5      OS SU;   a  [        US   5      OS SU;   a  [        US   5      OS SU;   a  [        US   5      OS SU;   a  [        US   5      OS SU;   a  [        US   5      OS SU;   a  [        US   5      S	9$ S S	9$ )
Nr   rA   r   rB   r   r   r   r   )r   rA   r   rB   r   r   r   r   )boolr   s     r   r   "CharacteristicProperties.from_json   s    1<1Dd4,-$'-~d6l#4I_cgIg4-C(D#Emq)0D$tG}%d+3t+;4X'/9T/AT$z*+tSnrvSvT2M-N(O  }ADX\`D`T*>%? @	
 		
 gk	
 		
r   r   )r   r    r!   r"   r#   r   r`   rA   r   rB   r   r   r   r   r   r'   r   r(   r   r   r   r~   r~      s}     (,I$+"&D
&4818#'E '$(F!(&*H#*9=!6=15.5( 

 

r   r~   c              #  `   #    [        5       nU R                  5       US'   XS'   SUS.nUv ng7f)z
Enable the BluetoothEmulation domain.

:param state: State of the simulated central.
:param le_supported: If the simulated central supports low-energy.
stateleSupportedzBluetoothEmulation.enablemethodparamsNrZ   r   )r   le_supportedr   cmd_dictr   s        r   enabler      s;      &FmmoF7O(=-H >Ds   ,.c              #  X   #    [        5       nU R                  5       US'   SUS.nUv ng7f)zX
Set the state of the simulated central.

:param state: State of the simulated central.
r   z+BluetoothEmulation.setSimulatedCentralStater   Nr   )r   r   r   r   s       r   set_simulated_central_stater   
  s3      &FmmoF7O?H >D   (*c               #     #    SS0n U v ng7f)z(
Disable the BluetoothEmulation domain.
r   zBluetoothEmulation.disableNr   )r   r   s     r   disabler     s     
 	.H >Ds   
c              #     #    [        5       nXS'   XS'   U Vs/ s H  oUR                  5       PM     snUS'   U Vs/ s H  oUPM     snUS'   SUS.nUv ngs  snf s  snf 7f)z
Simulates a peripheral with ``address``, ``name`` and ``knownServiceUuids``
that has already been connected to the system.

:param address:
:param name:
:param manufacturer_data:
:param known_service_uuids:
addressre   rl   knownServiceUuidsz1BluetoothEmulation.simulatePreconnectedPeripheralr   Nr   )r   re   ri   known_service_uuidsr   rm   r   r   s           r    simulate_preconnected_peripheralr   %  sx      &F96N7H!I7H!))+7H!IF.A"B.A1.A"BFEH >D "J"Bs   A!A
A!AA!c              #  X   #    [        5       nU R                  5       US'   SUS.nUv ng7f)zh
Simulates an advertisement packet described in ``entry`` being received by
the central.

:param entry:
entryz(BluetoothEmulation.simulateAdvertisementr   Nr   )r   r   r   r   s       r   simulate_advertisementr   @  s3      &FmmoF7O<H >Dr   c              #  h   #    [        5       nXS'   UR                  5       US'   X#S'   SUS.nUv ng7f)a  
Simulates the response code from the peripheral with ``address`` for a
GATT operation of ``type``. The ``code`` value follows the HCI Error Codes from
Bluetooth Core Specification Vol 2 Part D 1.3 List Of Error Codes.

:param address:
:param type_:
:param code:
r   typecodez0BluetoothEmulation.simulateGATTOperationResponser   Nr   )r   type_r   r   r   r   s         r    simulate_gatt_operation_responser   R  sB      &F9]]_F6N6NDH >Ds   02c              #  v   #    [        5       nXS'   UR                  5       US'   X$S'   Ub  X4S'   SUS.nUv ng7f)a  
Simulates the response from the characteristic with ``characteristicId`` for a
characteristic operation of ``type``. The ``code`` value follows the Error
Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response.
The ``data`` is expected to exist when simulating a successful read operation
response.

:param characteristic_id:
:param type_:
:param code:
:param data: *(Optional)*
characteristicIdr   r   NrX   z:BluetoothEmulation.simulateCharacteristicOperationResponser   r   )characteristic_idr   r   rX   r   r   r   s          r   *simulate_characteristic_operation_responser   k  sP     $ &F!2]]_F6N6NvNH >D   79c              #  v   #    [        5       nXS'   UR                  5       US'   X$S'   Ub  X4S'   SUS.nUv ng7f)a  
Simulates the response from the descriptor with ``descriptorId`` for a
descriptor operation of ``type``. The ``code`` value follows the Error
Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response.
The ``data`` is expected to exist when simulating a successful read operation
response.

:param descriptor_id:
:param type_:
:param code:
:param data: *(Optional)*
descriptorIdr   r   NrX   z6BluetoothEmulation.simulateDescriptorOperationResponser   r   )descriptor_idr   r   rX   r   r   r   s          r   &simulate_descriptor_operation_responser     sO     $ &F*>]]_F6N6NvJH >Dr   c              #  \   #    [        5       nXS'   XS'   SUS.nUv n[        US   5      $ 7f)z
Adds a service with ``serviceUuid`` to the peripheral with ``address``.

:param address:
:param service_uuid:
:returns: An identifier that uniquely represents this service.
r   serviceUuidzBluetoothEmulation.addServicer   	serviceIdrZ   rW   )r   service_uuidr   r   r   s        r   add_servicer     sD      &F9(=1H >DtK !!   *,c              #  :   #    [        5       nXS'   SUS.nUv ng7f)zc
Removes the service respresented by ``serviceId`` from the simulated central.

:param service_id:
r   z BluetoothEmulation.removeServicer   NrZ   )
service_idr   r   r   s       r   remove_servicer     s,      &F$;4H >D   c              #     #    [        5       nXS'   XS'   UR                  5       US'   SUS.nUv n[        US   5      $ 7f)z
Adds a characteristic with ``characteristicUuid`` and ``properties`` to the
service represented by ``serviceId``.

:param service_id:
:param characteristic_uuid:
:param properties:
:returns: An identifier that uniquely represents this characteristic.
r   characteristicUuid
propertiesz$BluetoothEmulation.addCharacteristicr   r   )rZ   r   rW   )r   characteristic_uuidr   r   r   r   s         r   add_characteristicr     sY      &F$;#6 %--/F<8H >Dt&'((s   =?c              #  :   #    [        5       nXS'   SUS.nUv ng7f)zx
Removes the characteristic respresented by ``characteristicId`` from the
simulated central.

:param characteristic_id:
r   z'BluetoothEmulation.removeCharacteristicr   Nr   )r   r   r   r   s       r   remove_characteristicr     s-      &F!2;H >Dr   c              #  \   #    [        5       nXS'   XS'   SUS.nUv n[        US   5      $ 7f)z
Adds a descriptor with ``descriptorUuid`` to the characteristic respresented
by ``characteristicId``.

:param characteristic_id:
:param descriptor_uuid:
:returns: An identifier that uniquely represents this descriptor.
r   descriptorUuidz BluetoothEmulation.addDescriptorr   r   r   )r   descriptor_uuidr   r   r   s        r   add_descriptorr     sF      &F!2.4H >DtN#$$r   c              #  :   #    [        5       nXS'   SUS.nUv ng7f)za
Removes the descriptor with ``descriptorId`` from the simulated central.

:param descriptor_id:
r   z#BluetoothEmulation.removeDescriptorr   Nr   )r   r   r   r   s       r   remove_descriptorr     s,      &F*>7H >Dr   c              #  :   #    [        5       nXS'   SUS.nUv ng7f)zW
Simulates a GATT disconnection from the peripheral with ``address``.

:param address:
r   z,BluetoothEmulation.simulateGATTDisconnectionr   Nr   )r   r   r   r   s       r   simulate_gatt_disconnectionr   $  s,      &F9@H >Dr   z(BluetoothEmulation.gattOperationReceivedc                  B    \ rS rSr% SrS\S'   S\S'   \S
S j5       rSrg	)GattOperationReceivedi5  zZ
Event for when a GATT operation of ``type`` to the peripheral with ``address``
happened.
rW   r   r*   r   c                T    U " [        US   5      [        R                  US   5      S9$ )Nr   r   )r   r   )rW   r*   r   r   s     r   r   GattOperationReceived.from_json?  s-    Y(#--d6l;
 	
r   r   N)r   r   returnr   	r   r    r!   r"   r#   r`   r'   r   r(   r   r   r   r   r   5  s&     L
 
r   r   z2BluetoothEmulation.characteristicOperationReceivedc                  V    \ rS rSr% SrS\S'   S\S'   S\S'   S	\S
'   \SS j5       rSrg)CharacteristicOperationReceivediG  z
Event for when a characteristic operation of ``type`` to the characteristic
respresented by ``characteristicId`` happened. ``data`` and ``writeType`` is
expected to exist when ``type`` is write.
rW   r   r?   r   rd   rX   z(typing.Optional[CharacteristicWriteType]
write_typec           	         U " [        US   5      [        R                  US   5      SU;   a  [        US   5      OS SU;   a  [        R                  US   5      S9$ S S9$ )Nr   r   rX   	writeType)r   r   rX   r   )rW   r?   r   r5   r   s     r   r   )CharacteristicOperationReceived.from_jsonT  sp    !$'9":;-77VE&,nT&\"$OZ^bOb.88k9JK	
 	
 im	
 	
r   r   N)r   r   r   r   r   r   r   r   r   r   G  s3    
 &&
88
 
r   r   z.BluetoothEmulation.descriptorOperationReceivedc                  L    \ rS rSr% SrS\S'   S\S'   S\S'   \SS	 j5       rS
rg)DescriptorOperationReceivedi^  z
Event for when a descriptor operation of ``type`` to the descriptor
respresented by ``descriptorId`` happened. ``data`` is expected to exist when
``type`` is write.
rW   r   rL   r   rd   rX   c                    U " [        US   5      [        R                  US   5      SU;   a  [        US   5      S9$ S S9$ )Nr   r   rX   )r   r   rX   )rW   rL   r   r   s     r   r   %DescriptorOperationReceived.from_jsonj  sO    d>23)33DLA&,nT&\"
 	
 ;?
 	
r   r   N)r   r   r   r   r   r   r   r   r   r   ^  s-    
 ""

 
r   r   )r   r	   r   r   r   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])r   r	   r   r   )r   r   )
r   rW   re   rW   ri   ztyping.List[ManufacturerData]r   ztyping.List[str]r   r   )r   rr   r   r   )r   rW   r   r*   r   rU   r   r   r   )
r   rW   r   r?   r   rU   rX   rd   r   r   )
r   rW   r   rL   r   rU   rX   rd   r   r   )r   rW   r   rW   r   /typing.Generator[T_JSON_DICT, T_JSON_DICT, str])r   rW   r   r   )r   rW   r   rW   r   r~   r   r   )r   rW   r   r   )r   rW   r   rW   r   r   )r   rW   r   r   )r   rW   r   r   )%
__future__r   utilr   r   dataclassesr   enumtypingEnumr	   r*   r5   r?   rL   rS   rb   rr   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r      s   # * !  499  		 dii  $)) "dii  
 
 
4 (
 (
 (
V 
 
 
4 4
 4
 4
n 
8(	7" 9 .	
 
86	7$   
8	: &*	*  #	
 
8F &*	&  #	
 
8>""" 
7",	7")) ) -) 
7	)4	7$%%% 
7%.	7"	7" 78

 
  9
  AB

 
  C
* =>

 
  ?
r   