如何获取基站信息LAC和CI
答案:1 悬赏:40
解决时间 2021-03-26 09:40
- 提问者网友:临风不自傲
- 2021-03-26 00:15
如何获取基站信息LAC和CI
最佳答案
- 二级知识专家网友:你哪知我潦倒为你
- 2021-03-26 01:12
#include “CoreTelephony.h”
#include
#include
#include
CFMachPortRef port;
struct CTServerConnection *sc=NULL;
struct CellInfo cellinfo;
int b;
int t1;
void callback()
{
printf(“Callback called\n”);
}
void cellconnect()
{
int t1;
sc=_CTServerConnectionCreate(kCFAllocatorDefault, callback, NULL);
port=CFMachPortCreateWithPort(kCFAllocatorDefault, _CTServerConnectionGetPort(sc), NULL, NULL, NULL);
_CTServerConnectionCellMonitorStart(&t1,sc);
printf(“Connected\n”);
}
void getCellInfo()
{
int cellcount;
_CTServerConnectionCellMonitorGetCellCount(&t1,sc,&cellcount);
printf(“Cell count: %x\n”,cellcount);
printf(“Size = %x\n”, sizeof(struct CellInfo));
unsigned char *a=malloc(sizeof(struct CellInfo));
for(b=0;b
{
//OMG the toolchain is broken, &cellinfo doesn’t work
_CTServerConnectionCellMonitorGetCellInfo(&t1,sc,b,a); memcpy(&cellinfo,a,sizeof(struct CellInfo));
//OMG the toolchain is more broken, these printfs don’t work on one line
printf(“Cell Site: %d, MNC: %d, “,b,cellinfo.servingmnc);
printf(“Location: %d, Cell ID: %d, Station: %d, “,cellinfo.location, cellinfo.cellid, cellinfo.station);
printf(“Freq: %d, RxLevel: %d, “, cellinfo.freq, cellinfo.rxlevel);
printf(“C1: %d, C2: %d\n”, cellinfo.c1, cellinfo.c2);
}
if(a) free(a);
}
int main()
{
printf(“iPhone Cell Stumbler\n”);
cellconnect();
int cellcount;
while(1)
{
getCellInfo();
sleep(1);
}
return 0;
}
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯