ipr = IPRoute() r.execute('UtaMsSmsInit') r.execute('UtaMsCbsInit') r.execute('UtaMsNetOpen') r.execute('UtaMsCallCsInit') r.execute('UtaMsCallPsInitialize') r.execute('UtaMsSsInit') r.execute('UtaMsSimOpenReq') rpc.do_fcc_unlock(r) # disable aeroplane mode if had been FCC-locked. first and second args are probably don't-cares rpc.UtaModeSet(r, 1) r.execute('UtaMsCallPsAttachApnConfigReq', rpc.pack_UtaMsCallPsAttachApnConfigReq(cfg.apn), is_async=True) attach = r.execute('UtaMsNetAttachReq', rpc.pack_UtaMsNetAttachReq(), is_async=True) _, status = rpc.unpack('nn', attach['body']) if status == 0xffffffff: logging.info("Attach failed - waiting to see if we just weren't ready") while not r.attach_allowed: r.pump() attach = r.execute('UtaMsNetAttachReq', rpc.pack_UtaMsNetAttachReq(),
def test_pack_UtaMsCallPsAttachApnConfigReq(): expected = \ '0201005582010102040000010402040000000300000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000020400000000554102' \ '0400000042020400000001000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000055410204000000410204000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '000000000000000000000000000000000000000000000000000000005581FA02' \ '04000000FA020400000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '00000000000201005581FA0204000000FC020400000002000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000002020000020400000000020400' \ '0000000204000000000204000000000204000000000204000000000204000000' \ '0002040000000002040000000002040000000002040000000002040000000002' \ '0400000000020400000000020400000000020400000000020400000000020400' \ '0000000204000000000204000000000204000000005514020400000014020400' \ '0000000000000000000000000000000000000000000000020400000000556502' \ '0400000068020400000003000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000055820101020400000104020400' \ '0000030000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000002040000000055410204000000420204000000010000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000554102' \ '0400000041020400000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000005581FA0204000000FA0204000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000201005581FA0204000000' \ 'FC02040000000200000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000202000002040000000002040000000002040000000002040000000002' \ '0400000000020400000000020400000000020400000000020400000000020400' \ '0000000204000000000204000000000204000000000204000000000204000000' \ '0002040000000002040000000002040000000002040000000002040000000002' \ '0400000000551402040000001402040000000000000000000000000000000000' \ '0000000000000002040000000055650204000000680204000000030000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000005582010102040000010402040000000300000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000020400000000554102' \ '0400000042020400000001000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000055410204000000410204000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '000000000000000000000000000000000000000000000000000000005581FA02' \ '04000000FA020400000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '00000000000201005581FA0204000000FC020400000002000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000002020000020400000000020400' \ '0000000204000000000204000000000204000000010204000000000204000000' \ '0002040000000002040000000002040000000002040000000002040000000002' \ '0400000001020400000000020400000000020400000404020400000001020400' \ '0000000204000000010204000000000204000000005514020400000014020400' \ '0000000000000000000000000000000000000000000000020400000003556502' \ '040000006802040000000374656C737472612E696E7465726E65740000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000055820101020400000104020400' \ '0000030000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000002040000000055410204000000420204000000010000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000554102' \ '0400000041020400000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000005581FA0204000000FA0204000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000201005581FA0204000000' \ 'FC02040000000200000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000202000002040000000002040000000002040000000002040000000002' \ '0400000001020400000000020400000000020400000000020400000000020400' \ '0000000204000000000204000000000204000000010204000000000204000000' \ '0002040000040402040000000102040000000002040000000102040000000002' \ '0400000000551402040000001402040000000000000000000000000000000000' \ '00000000000000020400000003556502040000006702040000000274656C7374' \ '72612E696E7465726E6574000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000000000000000000000000000000000000000000000000000000000000000' \ '0000020103020400000000' assert rpc.pack_UtaMsCallPsAttachApnConfigReq( "telstra.internet") == binascii.unhexlify(expected)