get carrier name and signal strength return wrong value in iphone

后端 未结 2 1660
别跟我提以往
别跟我提以往 2020-12-18 16:32

i curious why i get wrong value to get carrier name and signal strength. Here the code.

CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] in         


        
2条回答
  •  一个人的身影
    2020-12-18 16:38

    About the carrier: Running your code on the simulator gives me nil while running on a device correctly says 2011-11-24 10:49:05.182 testapp[12579:707] Carrier Name: Vodafone.de, so the code is absolutely correct (running on iOS 5.0.1 using Xcode 4.2). Maybe your carrier didn't fill out some field correctly? In any case I would consider testing on another device or with another SIM card.

    Concerning signal strength: As CTGetSignalStrength seems to be a rather undocumented API the values may be arbitrarily defined by Apple (and redefined as well). In any case this seems to be a RSSI value (received signal strength indication) which is more or less a positive number where 1 is the worst signal strength and upper is better. As such there is no predefined (documented and thus stable) available mapping to dBm values, a mapping would probably have to be created experimentally.

提交回复
热议问题