min match by mcc mnc

#include <stdio.h>
#include <string.h>


static char match8[][24] = {"72406", "72410", "72411", "72423", "72402",
                            "72403", "72404", "72408", "72431", "72424",
                            "72416", "72432", "72433", "72434", "72439",
                            "73002", "73009", "73001", "73010", "73003",
                            "73008", "73004", "73005", "73007" };
static char match7[][8] = { "722310", "722341", "72234", "72207", "21407",
                           "71606", "71610", "71617" };


int getMatchCountByMccMnc() {
    int matchCount = 2;
    char *pMccMnc =(char *)malloc(40);
    memset(pMccMnc, 0, sizeof(char) * 40);
    property_get("gsm.sim.operator.numeric", pMccMnc,"0");


    int i = 0;
    while( i < sizeof(match7)/sizeof(match7[0])) {
        if(strcmp(pMccMnc, match7[i]) == 0) {
            printf("mcc mnc  %s  is 7 bit match!\n", match7[i]);
            matchCount = 7;
            goto exit;
        }
        i++;
    }


    i = 0;
    while( i < sizeof(match8)/sizeof(match8[0])) {
        if(strcmp(pMccMnc, match8[i]) == 0) {
            printf("mcc mnc  %s  is 8 bit match!\n", match8[i]);
            matchCount = 8;
            goto exit;
        }
        i++;
    }


    printf("No mcc mnc match, use default 7 bit\n");
exit:
    free(pMccMnc);
    return matchCount;
}


int main() {
    getMatchCountByMccMnc();
    return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值