Example #1
0
int
setCountryCode_5G_qtn(const char *cc)
{
	int ret;
	char value[20] = {0};

	if( cc==NULL || !isValidCountryCode(cc) )
		return 0;

	if (!rpc_qtn_ready()) {
		fprintf(stderr, "ATE command error\n");
		return -1;
	}
	ret = qcsapi_bootcfg_update_parameter("ccode_5g", cc);
	if (ret < 0) {
		fprintf(stderr, "ATE command error\n");
		return -1;
	}
	ret = qcsapi_bootcfg_get_parameter("ccode_5g", value, sizeof(value));
	if (ret < 0) {
		fprintf(stderr, "ATE command error\n");
		return -1;
	}

	sprintf(cmd, "asuscfe1:ccode=%s", cc);
	eval("nvram", "set", cmd );
	puts(nvram_safe_get("1:ccode"));

	return 1;
}
Example #2
0
int
setCountryCode_2G(const char *cc)
{
	if( cc==NULL || !isValidCountryCode(cc) )
		return 0;

        eval("killall", "wsc");
        memset(cmd, 0, 32);
        sprintf(cmd, "asuscferegulation_domain=%s", cc);
        eval("nvram", "set", cmd );
        puts(nvram_safe_get("regulation_domain"));
        return 1;
}