)g/ dZddlmZddlmZmZmZddlTddlTddl TGdde Z Gdde Z Gd d e ZGd d e ZGd de ZGddeZGddeZGddeZGddeZdddddddddd d!d" ZGd#d$eZGd%d&e ZGd'd(eZdddddddddd d!d" ZGd)d*e ZGd+d,eZGd-d.eZd/S)0z DF_PHONEBOOK, DF_MULTIMEDIA, DF_MCS as specified in 3GPP TS 31.102 V16.6.0 Needs to be a separate python module to avoid cyclic imports )Optional)StructInt16ubInt32ub)*creZdZfdZededeeeffdZdZdZ dZ dZ ggfd Z xZ S) EF_UServiceTablec Ttjd|||||d|||_dS)N)fidsfidnamedescsize)super__init__table selfr r r rrrkwargs __class__s E/home/jenkins/workspace/simtester-sanitize/pySim/ts_31_102_telecom.pyrzEF_UServiceTable.__init__&s9WSt$TWWPVWWW servicereturnc(|dz }|dz}|dz}||fS)Nr)ri byte_offset bit_offsets r_bit_byte_offset_for_servicez-EF_UServiceTable._bit_byte_offset_for_service*s( aKd U Z((rci}tdt|D]X}||}tddD]=}|dz|zdz}d|d|zzrdndi||<||jvr|j|||d<>Y|S)Nrrr activatedTF description)rangelenr)rin_binretrbytebitno service_nrs r _decode_binzEF_UServiceTable._decode_bin1sq#f++&& L LA!9Dq! L LUU]Q. e)s<<>> ( (CSJ(8(U(U)) %[*g%%%a-')**<<>> 4 4CSJ(8(U(U)) %[*s|K(D00     3 3     rc|j\}}g}|D]%}||dr||&|S)Nr$)lchanread_binary_decr0append)rcmd service_data_swactive_servicesss rget_active_servicesz$EF_UServiceTable.get_active_servicesTsf!i7799s""$$ * *AA{+ *&&q)))rc d}||}|jj} t|D]}||vrdnd}|d||fz||D]}||} |j|d} d} n(#t$r} t| } d} Yd} ~ nd} ~ wwxYw| |kr<|dz }| r| d |z| d |d | d  |j|n#|j|wxYw|S) zKCheck consistency between services of this file and files present/activatedractiveinactivezChecking service No %u (%s)NTFrz. ERROR: File %s is selectable but should not!z ERROR: File z is not selectable (z ) but should!) rBparentfiles_by_servicesortedr0poutputshould_exist_for_servicesr: select_file SwMatchErrorstrperror) rr= num_problemsr@rGrA active_strf should_existswexistses rust_service_checkz"EF_UServiceTable.ust_service_check]s 22377;7 (,113344 i i)*o)=)=XX:  9Q OKLLL)!,iiA#$#>#>#O#OL' --a000!!%'''' VV!&'--$) !iJJ'WZ['[\\\\JJJabababdfdfdf'ghhhi i( I ! !$ ' ' ' 'CI ! !$ ' ' ' 's7A$D1 B)(D1) C3C D1 CAD11E cD|j\}}t|}|D]b}t|\}}|t |kr||z } || dz||xxd|zzcc<c|D]c}t|\}}|t |kr||z } || dz||xxd|zzcc<dt|}|j|dS)N00r) r: read_binaryh2br r"r'extendb2h update_binary) rr=activate deactivater>r?rnbytenbitmissings r ust_updatezEF_UServiceTable.ust_update|sNI1133 c<((  / /G*GGPPKE4s<((((,.##GdN333    AI .    ! 0 0G*GGPPKE4s<((((,.##GdN333    Q$Y< /    <((   -----r)__name__ __module__ __qualname__r staticmethodr1Tupler"r-r8rBrVrc __classcell__rs@rr r %s)c)eCHo)))\)   ,>(*b........rr c eZdZdfd ZxZS)EF_PBR4F30EF.PBRPhone Book Referencec Btj|f||d|dSN)r rrrrr r rrrs rrzEF_PBR.__init__/=4d==f=====r)rmrnrordrerfrrirjs@rrlrls=>>>>>>>>>>rrlc<eZdZedez Zdfd ZxZS)EF_PSC synce_counter4F22EF.PSC"Phone Book Synchronization Counterc Btj|f||d|dSrqrrrss rrzEF_PSC.__init__rtr)ryrzr{)rdrerfrr _constructrrirjs@rrwrwsQ/00J>>>>>>>>>>rrwc<eZdZedez Zdfd ZxZS)EF_CCchange_counter4F23EF.CCChange Counterc Btj|f||d|dSrqrrrss rrzEF_CC.__init__rtr)rrrrdrerfrrr}rrirjs@rrrsR(011J>>>>>>>>>>rrc<eZdZedez Zdfd ZxZS)EF_PUID previous_uid4F24EF.PUIDPrevious Unique Identiferc Btj|f||d|dSrqrrrss rrzEF_PUID.__init__rtr)rrrrrjs@rrrsQw.//J>>>>>>>>>>rrc eZdZdfd ZxZS) DF_PHONEBOOK5F3A DF.PHONEBOOK Phonebookc tjd|||d|ttt t g}||dSN)r r rr)rrrlrwrr add_filesrr r rrfilesrs rrzDF_PHONEBOOK.__init__sfASt$AA&AAA HH HH GG II  ur)rrrrurjs@rrrs=          rrc eZdZdfd ZxZS)EF_MML4F47EF.MMLMultimedia Messages Listc Btj|f||d|dSrqrrrss rrzEF_MML.__init__rtr)rrrrurjs@rrr=>>>>>>>>>>rrc eZdZdfd ZxZS)EF_MMDF4F48EF.MMDFMultimedia Messages Data Filec Btj|f||d|dSrqrrrss rrzEF_MMDF.__init__rtr)rrrrurjs@rrrrrrc eZdZdfd ZxZS) DF_MULTIMEDIA5F3B DF.MULTIMEDIA Multimediac tjd|||d|ttg}||dSr)rrrrrrs rrzDF_MULTIMEDIA.__init__sXASt$AA&AAA HH II ur)rrrrurjs@rrr=rrzMCPTT UE configuration datazMCPTT User profile datazMCS Group configuration dataz MCPTT Service configuration dataz!MCS UE initial configuration datazMCData UE configuration datazMCData user profile dataz!MCData service configuration datazMCVideo UE configuration datazMCVideo user profile dataz"MCVideo service configuration data) rr ceZdZGddedZGddedZGdd ed ZGd d ed ZGddedZGddedZ GddedZ GddedZ GddedZ GddedZ Gd d!ed"ZGd#d$eeeeeee e e e e eg %Zd+fd* ZxZS), EF_MCS_CONFIGceZdZdS)&EF_MCS_CONFIG.McpttUeConfigurationDataNrdrerfrrrMcpttUeConfigurationDatar rrtagceZdZdS)"EF_MCS_CONFIG.McpttUserProfileDataNrrrrMcpttUserProfileDatarrrrceZdZdS)'EF_MCS_CONFIG.McsGroupConfigurationDataNrrrrMcsGroupConfigurationDatarrrrceZdZdS)+EF_MCS_CONFIG.McpttServiceConfigurationDataNrrrrMcpttServiceConfigurationDatarrrrceZdZdS)+EF_MCS_CONFIG.McsUeInitialConfigurationDataNrrrrMcsUeInitialConfigurationDatarrrrceZdZdS)'EF_MCS_CONFIG.McdataUeConfigurationDataNrrrrMcdataUeConfigurationDatarrrrceZdZdS)#EF_MCS_CONFIG.McdataUserProfileDataNrrrrMcdataUserProfileDatarrrrceZdZdS),EF_MCS_CONFIG.McdataServiceConfigurationDataNrrrrMcdataServiceConfigurationDatarrrrceZdZdS)(EF_MCS_CONFIG.McvideoUeConfigurationDataNrrrrMcvideoUeConfigurationDatarrrrceZdZdS)$EF_MCS_CONFIG.McvideoUserProfileDataNrrrrMcvideoUserProfileDatarrrrceZdZdS)-EF_MCS_CONFIG.McvideoServiceConfigurationDataNrrrrMcvideoServiceConfigurationDatarrrrceZdZdS)%EF_MCS_CONFIG.McsConfigDataCollectionNrrrrMcsConfigDataCollectionrs rrnested4F02r EF.MCS_CONFIGMCS configuration datac ftjd||||d|tj|_dSN)r r r rr)rrrr_tlvrr r r rrrs rrzEF_MCS_CONFIG.__init__9LSt$TLLVLLL!9 r)rrrr)rdrerf BER_TLV_IErrrrrrrrrrrTLV_IE_Collectionrrrirjs@rrrs     :4         zt         JD                           JD                           ZT                  *$         "3=U"68Q"?A^";=R"@B\"8:Y =[    ::::::::::rrc,eZdZdddddeffd ZxZS)EF_MST4F01rzEF.MSTzMCS Service Tablerrc Vt||||||dSN)r r r rrrrrrs rrzEF_MST.__init__/ St$TTYZZZZZr)rdrerf EF_MST_maprrirjs@rrrW!8BU\a![[[[[[[[[[rrc eZdZdfd ZxZS)DF_MCS5F3DDF.MCSMission Critical Servicesc tjd|||d|ttg}||dSr)rrrrrrs rrzDF_MCS.__init__XASt$AA&AAA HH OO ur)rrrrurjs@rrrrrrc,eZdZdddddeffd ZxZS)EF_VSTrrzEF.VSTzV2X Service Tablerc Vt||||||dSrrrrs rrzEF_VST.__init__!rr)rdrerf EF_VST_maprrirjs@rrr rrrcbeZdZGddedZGddeegZd fd ZxZS) EF_V2X_CONFIGceZdZdS)"EF_V2X_CONFIG.V2xConfigurationDataNrrrrV2xConfigurationDatar 'rrr rrceZdZdS)%EF_V2X_CONFIG.V2xConfigDataCollectionNrrrrV2xConfigDataCollectionr)rrrrrr EF.V2X_CONFIGV2X configuration datac ftjd||||d|tj|_dSr)rrr rrrs rrzEF_V2X_CONFIG.__init__+rr)rrrr) rdrerfrr rrrrirjs@rr r &s     zt         "3=Qr$s_,,+++++..........j.j.j.j.j.}j.j.j.Z>>>>>Z>>>>>>>>]>>>>>>>>M>>> >>>>>m>>>     6   >>>>>X>>> >>>>>h>>>F% %)*%!*&#,    : : : : :H : : :F[[[[[ [[[ V% %)*%!*&#,   [[[[[ [[[ :::::H:::Vr