%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/hplip/base/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/hplip/base/__pycache__/LedmWifi.cpython-312.pyc

�

=	fVy��0�ddlZddlZddlZddlZddl�ddl�ddlmZm	Z	ddl
mZejdej�ZdZdZd	Zd
ZdZdZd
ZdZdZdZd�Zd�Zd�Zd#d�Zd$d�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d%d�Z%d&d�Z&d&d�Z'd&d�Z(d �Z)d'd!�Z*d'd"�Z+y)(�N)�*�)�device�utils)�
to_bytes_utf8zHTTP/\d.\d\s(\d+)������i��z/IoMgmt/Adapters/a�<?xml version="1.0" encoding="UTF-8" ?><io:Adapter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:io="http://www.hp.com/schemas/imaging/con/ledm/iomgmt/2008/11/30" xmlns:dd="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/" xmlns:wifi="http://www.hp.com/schemas/imaging/con/wifi/2009/06/26">  <io:HardwareConfig> <dd:Power>%s</dd:Power> </io:HardwareConfig> </io:Adapter>a#<?xml version="1.0" encoding="UTF-8"?><io:Adapters xmlns:io="http://www.hp.com/schemas/imaging/con/ledm/iomgmt/2008/11/30" xmlns:dd="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/"><io:Adapter><io:HardwareConfig><dd:Power>%s</dd:Power></io:HardwareConfig></io:Adapter></io:Adapters>a�<io:Profile xmlns:io="http://www.hp.com/schemas/imaging/con/ledm/iomgmt/2008/11/30" xmlns:dd="http://www.hp.com/schemas/imaging/con/dictionaries/1.0/" xmlns:wifi="http://www.hp.com/schemas/imaging/con/wifi/2009/06/26" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hp.com/schemas/imaging/con/ledm/iomgmt/2008/11/30 ../../schemas/IoMgmt.xsd http://www.hp.com/schemas/imaging/con/dictionaries/1.0/ ../../schemas/dd/DataDictionaryMasterLEDM.xsd"><io:AdapterProfile><io:WifiProfile><wifi:SSID>%s</wifi:SSID><wifi:CommunicationMode>%s</wifi:CommunicationMode><wifi:EncryptionType>%s</wifi:EncryptionType><wifi:AuthenticationMode>%s</wifi:AuthenticationMode></io:WifiProfile></io:AdapterProfile></io:Profile>z�<io:KeyInfo><io:WpaPassPhraseInfo><wifi:RsnEncryption>AESOrTKIP</wifi:RsnEncryption><wifi:RsnAuthorization>autoWPA</wifi:RsnAuthorization><wifi:PassPhrase>%s</wifi:PassPhrase></io:WpaPassPhraseInfo></io:KeyInfo>c�@�tj�}d}|j�dk(r�|j�|j	�dk(rJ|j�	|j
d||�r	|j
d||�r�|j�y	|j|j||�|j�y	|j|j||�|j�y#t$rtjd�Y��wxYw#|j�wxYw#t$rtjd�Y��wxYw#|j�wxYw#t$rtjd�Y��wxYw#|j�wxYw)Nr�����"Unable to read Marvell_EWS Channel�Unable to read EWS_LEDM Channel�Unable to read LEDM Channel)�io�BytesIO�openLEDM�	closeLEDM�openEWS_LEDM�openMarvell_EWS�readMarvell_EWS�Error�log�error�closeMarvell_EWS�readLEDMAllData�readEWS_LEDM�
closeEWS_LEDM�readLEDM)�dev�response�timeouts   �!/usr/share/hplip/base/LedmWifi.py�flushThePortr%6sW���z�z�|�H��G�
�|�|�~����
�
�������#����!�
'��)�)�$��'�B���)�)�$��'�B�
�$�$�&�
$��#�#�C�$4�$4�h��H��!�!�#�	�������h��@�
�M�M�O��#�
@��	�	�>�?�
@���$�$�&���
=��	�	�;�<�
=���!�!�#���	5��I�I�3�4�	5��
�M�M�O�sl�'C5�D.�E'�5D�D�D�D�D+�.E�E�E�E�E$�'F�F�F�F�Fc��iidtf\}}}}d}t|�|tkrC|dz
}tdt	t�dz
}t||dd�\}}|tk(rn
|tkr�C|tk7rtjd|z�|St	�|d<t	|�dk7rBd}|D];}d|d|z<d|d	|z<	|d
|d|z<	|d
|d|z<	|d|d|z<|dz}�=|S#t$r*}	tjd|	z�d|d|z<Yd}	~	�Od}	~	wwxYw#t$r*}	tjd|	z�d|d|z<Yd}	~	�yd}	~	wwxYw#t$r*}	tjd|	z�d|d|z<Yd}	~	��d}	~	wwxYw)Nrrz<io:Adaptersz<io:Adapter>�$Request Failed With Response Code %d�adaptorlistlength�zadaptorpresence-%dzadaptorstate-%dz;io:adapter-map:resourcenode-map:resourcelink-dd:resourceurizadaptorid-%d�Missing response key: %sz$io:adapter-io:hardwareconfig-dd:namezadaptorname-%dz:io:adapter-io:hardwareconfig-dd:deviceconnectivityporttype�adaptortype-%d)�
HTTP_ERRORr%�MAX_RETRIES�LEDM_WIFI_BASE_URI�len�readXmlTagDataFromURI�HTTP_OKrr�KeyError�debug)
r!�ret�params�elementCount�code�	max_tries�URI�
paramsList�a�es
          r$�getAdaptorListr=Ss���"$�R��*�"4� �C��|�D��I����
�k�
!��A�
�	� ��3�'9�#:�1�#<�=��/��C���W��
�4��7�?���k�
!��w���	�	�8��=�>��
�"�:��C���
�:��!���A�$�
��02��(�1�,�-�-/��%��)�*�/�.4�5r�.s�C���*�+�3�06�7]�0^�C�(�1�,�-�3�06�7s�0t�C�(�1�,�-�
�a�C��'
�(�J�� �/��I�I�8�1�<�=�,.�C���*�+��/��
 �3��I�I�8�1�<�=�02�C�(�1�,�-��3��
 �3��I�I�8�1�<�=�02�C�(�1�,�-��3�sH�C,�D"�E�,	D�5 D�D�"	E�+ E�E�	F�! F�Fc
��g}t|�}	|d}t|�D]n}	|d|z}|j�dvs�gd�}g}|D]4}	|dj	|dt|�g�}	|j
|	��6|j
|��p|S#t$rd}Y��wxYw#t$rd}Y��wxYw#t$r
|dk(rd	}	nd
}	Y�_wxYw)Nr(rr+r))�wifiembedded�
wifiaccessory)�	adaptorid�adaptorname�adaptorstate�adaptorpresence�-rAr
�Unknown)r=r2�range�lower�join�str�append)
r!�rValr4�num_adaptors�n�namer5�r�p�xs
          r$�getWifiAdaptorIDrS|s��
�D�
��
�C���.�/���<�
 ���	��'�!�+�,�D��:�:�<�<�<�T�F��A��	
��&��B�G�G�Q��S��V�$4�5�6�A������	
�
�K�K��N�)�,�K��3�������	��D�	�� �&��K�'���%���	&�s4�B�B#�
 B4�B �B �#B1�0B1�4C
�	C
c
��d}d}|D]�}|d}|d}iddtf\}}}}	t|z}t|z}t|||d�|d<|dtk(sH|dt
k(s<tjd|d�d|�d	|�d
��t|z}t|||d�|d<|dtk(s.|dt
k(s"tjd|d�d|�d	|�����tjd|�d	|���|||d|d
fcSy)Nr
r)rr�<�errorreturnz2Wifi Adapter turn ON request Failed. ResponseCode=z AdaptorId=z
 AdaptorName=z. Trying another interfacez3Wifi Adapter turn ON request is Success. AdaptorId=r�)r
r)r)r))
r,r.�adapterPowerXml_payload1�writeXmlDataToURIr1�HTTP_NOCONTENTrr3�adapterPowerXml_payload2r)
r!�adapterList�power_state�
adaptor_id�adaptorNamer;r4�powerXmlr9r7s
          r$�setAdaptorPowerra�sM���J��K�
�5���a�D�z��q�T�{�!�"�R�
�2��s�8�C��
�+�
-�s�*�[�9�x�-�c�#�h�r�B�s�=���-� �G�+�s�=�/A�^�/S�

�)�)�DG�HU�DV�Wa�bm�n�o�-��<�(�0��S��"�E�#�m�
��-� �G�+�s�=�/A�^�/S�

�)�)�il�mz�i{�}G�HS�T�U�

�)�)�]g�hs�t�
u��[�!�A�$��!��4�
4�%5�(�c�X�i}|�
t|zdz}nt|zdz|z}	t||ddd�\}}}|tk(r�	||d<|tk7rtjd|z�|S|���|dk(r�	t
jt|d	�jd
��jd
�}|std�|d<n||d<	t
jt|d
�jd
��jd
�|d<|d|d<|d|d<|d|d<|d|d<|d|d<|St|�D]�}			t
jt|d|	z�jd
��jd
�}|std�|d|	z<n||d|	z<	t
jt|d|	z�jd
��jd
�|d|	z<|d|	z|d|	z<|d |	z|d!|	z<|d"|	z|d#|	z<|d$|	z|d%|	z<|d&|	z|d'|	z<	d(|d)<d*|d+<��|S#|d
|d<Y��CxYw#t$r#}tjd|z�Yd}~|Sd}~wwxYw#t$r|d|	z}Y��
tj $r}
|d|	z}Yd}
~
��-d}
~
wwxYw#|d|	z|d|	z<Y��xYw#t$r"}tjd|z�Yd}~��d}~wwxYw#t$r#}tjd|z�Yd}~���d}~wwxYw),Nz
/WifiNetworks�/WifiNetworks/SSID=�<io:WifiNetworks�<io:WifiNetwork>��numberofscanentriesr'rz(io:wifinetworks-io:wifinetwork-wifi:ssid�utf-8z	(unknown)zssid-0z)io:wifinetworks-io:wifinetwork-wifi:bssidzbssid-0z+io:wifinetworks-io:wifinetwork-wifi:channelz	channel-0z5io:wifinetworks-io:wifinetwork-wifi:communicationmodezcommunicationmode-0�5io:wifinetworks-io:wifinetwork-io:signalinfo-wifi:dbmzdbm-0z2io:wifinetworks-io:wifinetwork-wifi:encryptiontypezencryptiontype-0�@io:wifinetworks-io:wifinetwork-io:signalinfo-wifi:signalstrengthzsignalstrength-0r*z+io:wifinetworks-io:wifinetwork-wifi:ssid-%dzssid-%dz,io:wifinetworks-io:wifinetwork-wifi:bssid-%dzbssid-%dz.io:wifinetworks-io:wifinetwork-wifi:channel-%dz
channel-%dz8io:wifinetworks-io:wifinetwork-wifi:communicationmode-%dzcommunicationmode-%dz8io:wifinetworks-io:wifinetwork-io:signalinfo-wifi:dbm-%dzdbm-%dz5io:wifinetworks-io:wifinetwork-wifi:encryptiontype-%dzencryptiontype-%dzCio:wifinetworks-io:wifinetwork-io:signalinfo-wifi:signalstrength-%dzsignalstrength-%d��signalstrengthmaxr�signalstrengthmin)r.�readXmlDataFromURI�
HTTP_ACCEPTEDr1rr�binascii�	unhexlifyrJ�encode�decode�
to_unicoder2r3rG�	TypeErrorr)r!�adapterName�ssidr4r9r5r7r6r<r;�errs           r$�performScanrz�sE��	�C��|� �;�.��@�� �;�.�1F�F�t�K��
�#5�c�#�>P�Rd�eg�#h� ��t�L��=� ���!-�C����w���	�	�8��=�>��
�
���1��
:��)�)�#�f�5_�.`�*a�*h�*h�ip�*q�r�y�y�{B�C���$.�{�$;�C��M�$(�C��M�Y�%-�%7�%7��F�Cn�<o�8p�8w�8w�x�9A�&B�&I�&I�JQ�&R�C�	�N�$*�*W�#X��K� �-3�4k�-l��)�*�%�&]�^��G��*0�1e�*f��&�'�*0�1s�*t��&�'�F�J�?�<�(�
>��>�Y�'�1�1�#�f�=j�mn�=n�6o�2p�2w�2w�x�3A� B� I� I�JQ� R�� �-7��-D��I��M�*�-1��I��M�*�i�.6�.@�.@��V�Lz�}~�L~�E�BA�BH�BH�IP�BQ�/R�/Y�/Y�Za�/b��J��N�+�-3�3c�fg�3g�,h�C��q�(�)�6<�=w�z{�={�6|�C�.��2�3�(.�/i�lm�/m�(n�C��1��%�39�:q�tu�:u�3v�C�+�a�/�0�39�:�CD�;D�4E�C�+�a�/�0�>�/0�C�+�,�/0�C�+�,�9
>�>�J��UY�%+�,W�%X�C�	�N���
:��	�	�4�q�8�9�9�B�J��E
:��%�Y�%�&S�VW�&W�X��#�>�>�Y�%�&S�VW�&W�X���Y��i�.4�5c�fg�5g�.h��J��N�+�� �>��I�I�8�1�<�=�=��>��
 �>��I�I�8�1�<�=�=��>�s��1AI�AH?�	(I�AI>�K�"AJ:�*AK�1
K=�?
I�	I�	I;�I6�6I;�>J7�K�J7�$J2�,K�2J7�7K�:K�
K�	K:�K5�5K:�=	L)�L$�$L)c�v�d\}}}}}}}d}	t|zdz}
itd}
}}d}|tkr+|dz
}t||
dd�\}}}
|tk(rn
|tkr�+|tk7r:d}d}
|tkr-|dz
}t||
dd	�\}}}
|tk(rd
}	n
|tkr�-|tk7r!t
j
d|z�|||||||fS|	dk(rd|��|tk(r�	|d}|d
}|d}d|dvrd}n>d}|
dk(r7|d}|d}t|
�D]}|d|zdk7s�|d|z}|d|z}nn;|�9|tk(r0		|d}	|d}	|d}	|d}d|j�vrd}nd}t
jd!|�d"|�d#|�d$|�d%|�d&|�d'|���|||||||fS#t$r+}t
j
dt|�z�Yd}~�bd}~wwxYw#|d}Y��xYw#|d}Y��xYw#|d}Y��xYw#|d }Y��xYw#t$r+}t
j
dt|�z�Yd}~��d}~wwxYw)(N)�0.0.0.0rFrFr|r|r|r|�oldz
/Protocolsrrz<io:Protocolz/DevMgmt/IOConfigDyn.xmlz<iocfgdyn2:IOConfigDynz<dd3:IOAdaptorConfig�newr'zTio:protocols-io:protocol-io:addresses-io:ipv4addresses-io:ipv4address-dd:ipv4addresszSio:protocols-io:protocol-io:addresses-io:ipv4addresses-io:ipv4address-dd:subnetmaskzWio:protocols-io:protocol-io:addresses-io:ipv4addresses-io:ipv4address-dd:defaultgateway�DHCPzUio:protocols-io:protocol-io:addresses-io:ipv4addresses-io:ipv4address-dd:configmethod�dhcp�autoipz.io:protocols-io:protocol-dd:dnsserveripaddressz7io:protocols-io:protocol-dd:secondarydnsserveripaddressz1io:protocols-io:protocol-dd:dnsserveripaddress-%dz::z:io:protocols-io:protocol-dd:secondarydnsserveripaddress-%dr*zpiocfgdyn2:ioconfigdyn-dd3:ioadaptorconfig-dd3:networkadaptorconfig-dd3:ipversionconfig-dd3:ipconfig-dd:ipaddresszriocfgdyn2:ioconfigdyn-dd3:ioadaptorconfig-dd3:networkadaptorconfig-dd3:ipversionconfig-dd3:ipconfig-dd:ipaddress-0zqiocfgdyn2:ioconfigdyn-dd3:ioadaptorconfig-dd3:networkadaptorconfig-dd3:ipversionconfig-dd3:ipconfig-dd:subnetmaskzsiocfgdyn2:ioconfigdyn-dd3:ioadaptorconfig-dd3:networkadaptorconfig-dd3:ipversionconfig-dd3:ipconfig-dd:subnetmask-0zuiocfgdyn2:ioconfigdyn-dd3:ioadaptorconfig-dd3:networkadaptorconfig-dd3:ipversionconfig-dd3:ipconfig-dd:defaultgatewayzwiocfgdyn2:ioconfigdyn-dd3:ioadaptorconfig-dd3:networkadaptorconfig-dd3:ipversionconfig-dd3:ipconfig-dd:defaultgateway-0zuiocfgdyn2:ioconfigdyn-dd3:ioadaptorconfig-dd3:networkadaptorconfig-dd3:ipversionconfig-dd3:ipconfig-dd:ipconfigmethodzwiocfgdyn2:ioconfigdyn-dd3:ioadaptorconfig-dd3:networkadaptorconfig-dd3:ipversionconfig-dd3:ipconfig-dd:ipconfigmethod-0zip=z, hostname=z, addressmode=z
, subnetmask=z
, gateway=z	, pridns=z
, sec_dns=)r.r,r-ror1rrrGr2rJrHr3)r!rw�ip�hostname�addressmode�
subnetmask�gateway�pridns�sec_dns�protocolr9r5r7r6r8r;r<s                 r$�getIPConfigurationr�sQ��S�D�B��+�z�7�F�G��H�
�{�
*�\�
9�C�!�*�Q��4�F��I�
�k�
!��A�
�	�#5�c�#�n�n�#]� ��t�L��7�?��	�k�
!��w���	�(���+�%���M�I�'9�#�c�BZ�\r�'s�$�F�4���w�� ����+�%��w���	�	�8�$�>�?��8�[�*�g�v�w�N�N��5����$�'�/�
?��r�s��#�$y�z�
� �!z�{���V�${�|�|�"(�K�"*�K�#�a�'�!'�(X�!Y��"(�)b�"c��!&�|�!4�&�A�%�&Y�[\�&\�]�`d�d�)/�0c�ef�0f�)g��*0�1m�op�1p�*q�� %�	&����$�'�/�'
?�V��!S�T�B�
_�!'�)\�"]�J�
`�$�&]�^�G�
d�"(�*a�#b�K��[�.�.�0�0�"(�K�"*�K��I�I�fh�jr�t�BL�NU�W]�_f�g�h�
�x��j�'�6�7�J�J��]�
?��	�	�4�s�1�v�=�>�>��
?��V��!U�V�B��
_�!'�)^�"_�J��
`�$�&_�`�G��
d�"(�*c�#d�K���
?��	�	�4�s�1�v�=�>�>��
?�s�AF�F�<G�G �G,�G8�H�	G�&!G�G�G�H� G)�'H�,G5�3H�8H�?H�	H8�
!H3�3H8c�*�d\}}}}}}iittdf\}}	}
}}t|zdz}
d}d}|tkrF|dz
}t||
dd�\}}
}t||dd�\}	}}|
tk(r
|tk(rn
|tkr�F|
tk7r,|tk7r#t
j
dtz�|||||fS|�!|	�	|d	}|d
}|d}|d}|d
}|	d}||||||fS#t$r+}t
jdt|�z�Yd}~�7d}~wwxYw)N)r)r)r)r)r)r)r�/Profiles/Active�/IoMgmt/IoConfig.xmlr�<io:Profile�<io:IoConfigr'z8io:profile-io:networkprofile-io:ipv4network-dd:ipaddressz9io:profile-io:networkprofile-io:ipv4network-dd:subnetmaskz=io:profile-io:networkprofile-io:ipv4network-dd:defaultgatewayzAio:profile-io:networkprofile-io:ipv4network-dd:dnsserveripaddresszJio:profile-io:networkprofile-io:ipv4network-dd:secondarydnsserveripaddressz[io:ioconfig-io:iodeviceprotocolconfig-io:ipv4domainname-dd:domainnameconfig-dd:configmethodr*)r,r.r-ror1rrr7r2r3rJ)r!rwr��subnetr��pri_dnsr��mode�params1�params2�code1�code2r6�URI1�URI2r8r<s                 r$�getwifiotherdetailsr�csl��2H�/�B����'�4�24�b�*�j�QR�2R�0�G�W�e�U�L���+�.@�@�D�!�D��I�
�k�
!��A�
�	�'9�#�d�=�R_�'`�$����'9�#�d�>�Sa�'b�$�����G���� 0���k�
!�
�w��5�G�+��	�	�8�$�>�?��6�7�G�W�4�4���w�2�		;��S�T�B��X�Y�F��]�^�G��b�c�G��j�k�G��x�y�D��v�w���$�6�6���	;��I�I�0�3�q�6�9�:�:��	;�s�8C�	D�'!D
�
Dc��d\}}}itd}}}t|zdz}d}	|	tkr+|	dz
}	t||dd�\}}}|tk(rn
|	tkr�+|tk7rt
j
d|z�|||fS|�	|d}|d}|d	}|||fS#t$r+}
t
jd
t|
�z�Yd}
~
�4d}
~
wwxYw)N)r)r)r)rr�rr�r'zBio:profile-io:adapterprofile-io:wifiprofile-wifi:communicationmodez?io:profile-io:adapterprofile-io:wifiprofile-wifi:encryptiontypez6io:profile-io:adapterprofile-io:wifiprofile-wifi:bssidr*)
r,r.r-ror1rrr2r3rJ)r!rw�algr��secretid�parmsr7r6r9r8r<s           r$�getCryptoSuiter��s���$��C��x��
�1�|�$�E�
�{�
*�-?�
?�C��I�
�k�
!��A�
�	�"4�S��]�M�"Z���d�<��7�?��	�k�
!��g�~��	�	�8�$�>�?��T�8�#�#���	;��]�^�D��Y�Z�C��U�V�H�
��x�����	;��I�I�0�3�q�6�9�:�:��	;�s�<B�	C�!B?�?Cc
�d�it}}t|zdz}|dk(r;d}	ttjt|��j
d�|||	fz}
n�|}	tjddtt��}td|tzt|dztjt|��j
d�|||	tjt|��j
d�fz}
t|||
d�}||d<|tk(s!tstjd	|dz�|S)
Nr��none�openriz</io:WifiProfile>rrUrVr')r,r.�
passPhraseXmlrq�hexlifyrrt�findr/�
keyInfoXmlrYr1rZrr)r!rwrx�communication_mode�encryption_type�keyr4r7r9�authMode�ppXml�poss            r$�	associater��s;���*��C�
�{�
*�-?�
?�C��&� ����x�/�/�
�d�0C�D�K�K�G�T�Vh�ix�zB�C�C��"��� � �!4�Q�s�=�7I�J���t��$�z�1�M�#�$�4G�G�(�JZ�JZ�[h�im�[n�Jo�Jv�Jv�w~�J�AS�Tc���!�!�-��"4�5�<�<�W�E�JG�G���S��U�2�.�D��C�
���7�?�n��	�	�8�3�}�;M�M�N��Jrbc�`�gitdf\}}}}d\}}t|zdz}d}	|	tkr,|	dz
}	t||ddd�\}}}|tk(rn
|	tkr�,|tk7rt
j
d|z�|S|�	|d}	|d
}|j||f�|S#d	}Y�!xYw#d	}Y�$xYw)Nr)r)r)z
/VsaCodes.xmlrz<io:VsaCodes�
r'z$io:vsacodes-wifi:vsacode-dd:severityr)z(io:vsacodes-wifi:vsacode-wifi:rulenumber)r,r.r-ror1r�warnrK)
r!rwr4r5r7r6�severity�ruler9r8s
          r$�getVSACodesr��s���#%�b��A�#5� �C��t�L��M�H�T�
�{�
*�_�
<�C��I�
�k�
!��A�
�	�#5�c�#�n�^�\^�#_� ��t�L��7�?��	�k�
!��w�����7��<�=��
�
��	��C�D�H�	��D�E�D�
	�
�
�D�(�#�$��J��	��H��
	��D�s�>B�B'�B$�'B-c�2�d}d}d}|tkr+|dz
}t||dd�\}}}|tk(rn
|tkr�+tk7rtj	d|z�|S�	|d}|S|S#t
$r#}tj
d|z�Yd}~|Sd}~wwxYw)	Nr)r�rrr�z9Request failed with Response code %d. HostName not found.z*io:ioconfig-io:iodeviceconfig-dd3:hostnamer*)r-ror1rr�r2r3)r!�hostNamer9r8r5r7r6r<s        r$�getHostnamer��s����H�
 �C��I�
�k�
!��A�
�	�#5�c�#�n�n�#]� ��t�L��7�?��	�k�
!��w�����L�T�Q�R���
��	6��J�K�H�
��H����	6��I�I�0�1�4�5�5����	6�s�!A*�*	B�3B�Bc��d\}}}}itd}
}	}|�t|zdz|z}n||||fS	t||ddd�\}}	}
|	tk(rtjd��3	|	tk7rtjd|	z�||||fS|�|
d	k(r	|d
}|d}||||fS#t$r"}tjd|z�Yd}~�,d}~wwxYw)
N)rlrri8���rrdrerfr�zCGot Response as HTTP_ACCEPTED, so retrying to get the actual resultr'rrjrkr*)	r,r.rorpr�infor1rr2)
r!rwrxr^�ss_max�ss_min�ss_val�ss_dbmr5r7r6r9r<s
             r$�getSignalStrengthr��s
��%2�"�F�F�F�F�!�*�Q��4�F��� �;�.�1F�F�t�K���v�v�v�-�-�
�#5�c�#�>P�Rd�eg�#h� ��t�L��=� ��H�H�Z�[����w���	�	�8��=�>��v�v�v�-�-�
���1��
:�� W�X��� b�c��
�F�F�F�*�*���
:��	�	�4�q�8�9�9��
:�s�
B�	C�&C�Cc��gt}}t|dd�}tj|�t	j
�}|j
�dk(r�|j�|j�dk(rK|j�|j|�	|jd||�r	|jd||�r�n_|j|�	|j!|j"||�n/|j'|�	|j!|j(||�|j+�j-d�}	|	���t/|	�}|t0k(�rlt3j4|	�}	|	j7|dt9|	��}
|	|
dj;�}|j=d	d
�j=dd
�j=dd
�}|j?d
�}	t3j@�}|jC|�}
djEd�tGd�|�D��}|
jI|�}|D]�}|jK�}|j=d	d
�j=dd
�j=dd
�}t3jL�jOtQ|��}|jS|���	||fStj]d|z�||fS#t$r)|j�tjd�Y���wxYw#t$r)|j%�tjd�Y��%wxYw#t$r)|j�tjd�Y��ZwxYw#tTjVjXjZ$r%}tj]d|z�Yd}~||fSd}~wwxYw)Nrr)r
rrrrri�
� �	�
�0c3� K�|]}|���y�w�N�)�.0�ls  r$�	<genexpr>z(readXmlTagDataFromURI.<locals>.<genexpr>6s����(d�q��(d�s�c�
�|dvS)Nz<>r�)rRs r$�<lambda>z'readXmlTagDataFromURI.<locals>.<lambda>6s
��Q�d�]�rb�XML parser failed: %sz!HTTP Responce failed with %s code)/r,�format_http_getrr�rrrrrr�writeMarvell_EWSrrrr�
writeEWS_LEDM�readLEDMDatarr�	writeLEDMr �getvaluert�get_error_coder1r�extract_xml_chunkr�r/�strip�replace�rstrip�
extendedExpat�ParserI�filter�getElementsByTagName�toString�XMLToDictParser�parseXMLrrK�xml�parsers�expat�
ExpatErrorr3)r!r9�xmlRootNode�xmlReqDataNoder#r:r7�datar"�strRespr��repstr�
parser_object�root_element�reqDataElementList�noder5r<s                  r$r0r0sF���
�t�J��3�q��$�D��H�H�T�N��z�z�|�H�
�|�|�~����
�
�������#����!�� � ��&�
@��)�)�$��'�B���)�)�$��'�B��
���d�#�
=�� � ��!1�!1�8�W�E�
	�
�
�d��	5����S�\�\�8�W�=�
���!�(�(��1�G����g�&���7�?��-�-�g�6�G��,�,�{�1�S��\�:�C��S�T�]�(�(�*�F��^�^�D��-�5�5�d�3�?�G�G��S�Q�F��]�]�3�'�F�
7� %� 3� 3� 5�
�,�2�2�6�:��!#���(d�F�;R�Tb�4c�(d�!d��%1�%F�%F�~�%V�"�.�.�D�!�]�]�_�F�#�^�^�D��5�=�=�d�3�G�O�O�PT�UX�Y�F�"�2�2�4�=�=�m�F�>S�T�F��%�%�f�-�	.��d�?��
�I�I�9�$�>�?��d�?���U�
@��$�$�&��	�	�>�?�
@���
=��!�!�#��	�	�;�<�
=���	5��M�M�O��I�I�3�4�	5��0�;�;�$�$�/�/�
7��	�	�1�A�5�6�6��d�?���	
7�sO�'K�L�M�CM=�.L�L�.M�M�.M:�9M:�='O	�$O�O	c�6�itd}}}t|dd�}tj|�t	j
�}	|j
�dk(r�|j�|j�dk(rK|j�|j|�	|jd|	|�r	|jd|	|�r�n_|j|�	|j!|j"|	|�n/|j'|�	|j!|j(|	|�|	j+�j-d�}
|
��t/|
�}|t0k(r�t3j4|
�}
|
j7|dt9|
��}|
|dj;�}|j=d	d
�j=dd
�j=dd
�}|j?d
�}|jA|�}	t3jB�jE|�}ntjOd|z�|||fS#t$r)|j�tjd�Y��@wxYw#t$r)|j%�tjd�Y��uwxYw#t$r)|j�tjd�Y���wxYw#tFjHjJjL$r"}
tjOd|
z�Yd}
~
��d}
~
wwxYw)Nrr)r
rrrrrir�r�r�r�r�r�z" HTTP Responce failed with %s code)(r,r�rr�rrrrrrr�rrrrr�r�rrr�r r�rtr�r1rr�r�r/r�r�r��countr�r�r�r�r�r�r3)r!r9r��xmlChildNoder#r5r7r6r�r"r�r�r�r<s              r$roroEs��� ��A��4�F��3�q��$�D��H�H�T�N��z�z�|�H�
�|�|�~����
�
�������#����!�� � ��&�
@��)�)�$��'�B���)�)�$��'�B��
���d�#�
=�� � ��!1�!1�8�G�D�
	�
�
�d��	5����S�\�\�8�G�<�
���!�(�(��1�G����g�&���7�?��-�-�g�6�G��,�,�{�1�S��\�:�C��S�T�]�(�(�*�F��^�^�D��-�5�5�d�3�?�G�G��S�Q�F��]�]�3�'�F�!�<�<��5�L�
7��.�.�0�9�9�&�A��
�I�I�:�4�?�@��$�|�#�#��I�
@��$�$�&��	�	�>�?�
@���
=��!�!�#��	�	�;�<�
=���	5��M�M�O��I�I�3�4�	5��"�;�;�$�$�/�/�
7��	�	�1�A�5�6�6��
7�sN�'H0�I%�J�/#K�0.I"�!I"�%.J�J�.K�K�'L�6L�Lc��t}t|t|�|�}tj�}|j�dk(r�|j
�dk(rK|j�|j|�	|jd||�r	|jd||�r�n_|j|�	|j|j ||�n/|j%|�	|j|j&||�|j+�j-d�}|�t/|�}|S#t$r(|j�tjd�Y�^wxYw#t$r(|j#�tjd�Y��wxYw#t$r(|j)�tjd�Y��wxYw)Nr
i�rrrri)r,�format_http_putr/rrrrrr�rrrrrr�r�rrr�r rr�rtr�)r!r9r�r#r7r�r"r�s        r$rYrY{s����D��3�s�3�x��,�D��z�z�|�H�
�|�|�~��������#����!�� � ��&�
@��(�(��x��A���(�(��x��A��
���d�#�
=�� � ��!1�!1�8�W�E�	�
�
�d��	5����S�\�\�8�G�=����!�(�(��1�G����g�&���K��/�
@��$�$�&��	�	�>�?�
@���
=��!�!�#��	�	�;�<�
=���	5��M�M�O��I�I�3�4�	5�s6�9'D/�4E#�$F�/.E �E �#.F�F�.G�Gc��|stStj|�}|�tS	t|j	d��}|S#t
tf$r
t}Y|SwxYw)Nr)r,�http_result_pat�match�int�group�
ValueErrorrv)r4r�r7s   r$r�r��sb���z�!��!�!�#�&�E��}�Z�'���5�;�;�q�>�"���K��
�	�"�����K��s�A�A�Ac�0�d}tjd�S)N�	localhostz{GET $requst HTTP/1.1
Host: $host
User-Agent: hplip/3.0
Content-Type: $content_type
Content-Length: $ledmlen

$xmldata�r�cat��requst�ledmlen�xmldata�content_type�hosts     r$r�r������D��I�I��

�
rbc�0�d}tjd�S)Nr�z{PUT $requst HTTP/1.1
Host: $host
User-Agent: hplip/3.0
Content-Type: $content_type
Content-Length: $ledmlen

$xmldatar�r�s     r$r�r��rrb)�onr�)r)rU)ztext/xml; charset=utf-8),�timerrq�xml.parsers.expatr��string�gr)rr�sixextr�re�compile�Ir�r1rprZr,r-r.r[rXr�r�r%r=rSrarzr�r�r�r�r�r�r�r0rorYr�r�r�r�rbr$�<module>rs���.�	������!��*�*�5�r�t�t�<��

���
���
�
���(��h��E��y�
�g�
��:&�R�B�2H�T]K�F7�> �6�*�>�.+�@9�z3$�l$�N�	
�	
rb

Zerion Mini Shell 1.0