Hello peeps...........let me start
i posted numerous queries in q and a sectionnly 1 member helped me .....till his knowledge lasted
i pm'ed devs....they dint reply
i posted in other threads too............but still no answer
goole too didnt help much
so i was deperate to create this.....hope u understand
QUERIES
1)I unpacked the normalboot.img and got the ramdisk files and the zImage...........are the changes to be made in the ramdisk files?also,i am not able to un-cpio the image(i suppose they have initrampfs?)
2)i want to use codesoucery toolchain...i downloaded it and added its path ,no success...
then i added path to the makefiles....still fail
3)i am not able to repo android source............i get error "syntax error" even though everything is okay........i get this error whe i do "repo init"....i am not able to sync anything at all!
4)which files in the kernel deal with overclock,and etc etc?
@sagaraut:he didnt mention clearly,if u want i could pm u
@Devs:I want to overclock the kernel.....
First of all ,there's no board.sholes.c file in /arch/arm/mach-omap 2
then,in omap3-opp.h file,there are no speed settings.......just reference to some other file(which doesnt even exist!)
however,there's a voltage.c file,in which there is this
/*
* Default voltage controller settings.
*/
static struct omap_volt_vc_data vc_config = {
.clksetup = 0xff,
.voltsetup_time1 = 0xfff,
.voltsetup_time2 = 0xfff,
.voltoffset = 0xff,
.voltsetup2 = 0xff,
.vdd0_on = 1200000, /* 1.2v */
.vdd0_onlp = 1000000, /* 1.0v */
.vdd0_ret = 975000, /* 0.975v */
.vdd0_off = 600000, /* 0.6v */
.vdd1_on = 1150000, /* 1.15v */
.vdd1_onlp = 1000000, /* 1.0v */
.vdd1_ret = 975000, /* .975v */
.vdd1_off = 600000, /* 0.6v */
Click to expand...
Click to collapse
and this
/* VDD1 */
static struct omap_volt_data omap34xx_vdd1_volt_data[] = {
{.volt_nominal = 975000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
{.volt_nominal = 1075000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
{.volt_nominal = 1200000, .sr_errminlimit = 0xF9, .vp_errgain = 0x18},
{.volt_nominal = 1270000, .sr_errminlimit = 0xF9, .vp_errgain = 0x18},
{.volt_nominal = 1350000, .sr_errminlimit = 0xF9, .vp_errgain = 0x18},
};
static struct omap_volt_data omap36xx_vdd1_volt_data[] = {
{.volt_nominal = 1025000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1200000, .sr_errminlimit = 0xF9, .vp_errgain = 0x16, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1330000, .sr_errminlimit = 0xFA, .vp_errgain = 0x23, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1387500, .sr_errminlimit = 0xFA, .vp_errgain = 0x27, .abb_type = FAST_OPP},
};
/* VDD2 */
static struct omap_volt_data omap34xx_vdd2_volt_data[] = {
{.volt_nominal = 975000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
{.volt_nominal = 1050000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
{.volt_nominal = 1150000, .sr_errminlimit = 0xF9, .vp_errgain = 0x18},
};
static struct omap_volt_data omap36xx_vdd2_volt_data[] = {
{.volt_nominal = 930000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
//{.volt_nominal = 1162500, .sr_errminlimit = 0xF9, .vp_errgain = 0x16},
{.volt_nominal = 1162500, .sr_errminlimit = 0xF9, .vp_errgain = 0x16},
};
/*
* Structures containing OMAP4430 voltage supported and various
* data associated with it per voltage domain basis. Smartreflex Ntarget
* values are left as 0 as they have to be populated by smartreflex
* driver after reading the efuse.
*/
static struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = {
{.volt_nominal = 1005000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1025000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1200000, .sr_errminlimit = 0xF9, .vp_errgain = 0x16, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1313000, .sr_errminlimit = 0xFA, .vp_errgain = 0x23, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1375000, .sr_errminlimit = 0xFA, .vp_errgain = 0x27, .abb_type = FAST_OPP},
};
static struct omap_volt_data omap44xx_vdd_iva_volt_data[] = {
{.volt_nominal = 1011000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1013000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1188000, .sr_errminlimit = 0xF9, .vp_errgain = 0x16, .abb_type = NOMINAL_OPP},
#ifdef CONFIG_OMAP_ABB_DEFAULT_IVA_FBB
{.volt_nominal = 1300000, .sr_errminlimit = 0xFA, .vp_errgain = 0x23, .abb_type = FAST_OPP},
#else
{.volt_nominal = 1300000, .sr_errminlimit = 0xFA, .vp_errgain = 0x23, .abb_type = NOMINAL_OPP},
#endif
};
static struct omap_volt_data omap44xx_vdd_core_volt_data[] = {
{.volt_nominal = 1005000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
{.volt_nominal = 1025000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
{.volt_nominal = 1200000, .sr_errminlimit = 0xF9, .vp_errgain = 0x16},
};
/* OMAP 3430 MPU Core VDD dependency table */
static struct omap_vdd_dep_volt omap34xx_vdd1_vdd2_data[] = {
{.main_vdd_volt = 975000, .dep_vdd_volt = 1050000},
{.main_vdd_volt = 1075000, .dep_vdd_volt = 1050000},
{.main_vdd_volt = 1200000, .dep_vdd_volt = 1150000},
{.main_vdd_volt = 1270000, .dep_vdd_volt = 1150000},
{.main_vdd_volt = 1350000, .dep_vdd_volt = 1150000},
{.main_vdd_volt = 0, .dep_vdd_volt = 0},
};
static struct omap_vdd_dep_info omap34xx_vdd1_dep_info[] = {
{
.name = "core",
.dep_table = omap34xx_vdd1_vdd2_data,
},
};
/* OMAP 4430 MPU Core VDD dependency table */
static struct omap_vdd_dep_volt omap44xx_vddmpu_vddcore_data[] = {
{.main_vdd_volt = 1005000, .dep_vdd_volt = 1025000},
{.main_vdd_volt = 1025000, .dep_vdd_volt = 1025000},
{.main_vdd_volt = 1200000, .dep_vdd_volt = 1200000},
{.main_vdd_volt = 1313000, .dep_vdd_volt = 1200000},
{.main_vdd_volt = 1375000, .dep_vdd_volt = 1200000},
{.main_vdd_volt = 0, .dep_vdd_volt = 0},
};
static struct omap_vdd_dep_volt omap44xx_vddiva_vddcore_data[] = {
{.main_vdd_volt = 1011000, .dep_vdd_volt = 1025000},
{.main_vdd_volt = 1013000, .dep_vdd_volt = 1025000},
{.main_vdd_volt = 1188000, .dep_vdd_volt = 1200000},
{.main_vdd_volt = 1300000, .dep_vdd_volt = 1200000},
{.main_vdd_volt = 0, .dep_vdd_volt = 0},
};
Click to expand...
Click to collapse
Any help?
I anyone has the answer,kindly reply...
Regards
A Complete n00b..................
i think skin is expert in this area. He will definitely help u.
i pmed him a week ago but he didnt reply........nevertheless will try again...........
ok i will also pm him for u.
vishal24387 said:
ok i will also pm him for u.
Click to expand...
Click to collapse
dont...i already got answer from him!
It'd be great if u post the respective answers in the first post itself
@sagaraut:he didnt mention clearly,if u want i could pm u
@Devs:I want to overclock the kernel.....
First of all ,there's no board.sholes.c file in /arch/arm/mach-omap 2
then,in omap3-opp.h file,there are no speed settings.......just reference to some other file(which doesnt even exist!)
however,there's a voltage.c file,in which there is this
/*
* Default voltage controller settings.
*/
static struct omap_volt_vc_data vc_config = {
.clksetup = 0xff,
.voltsetup_time1 = 0xfff,
.voltsetup_time2 = 0xfff,
.voltoffset = 0xff,
.voltsetup2 = 0xff,
.vdd0_on = 1200000, /* 1.2v */
.vdd0_onlp = 1000000, /* 1.0v */
.vdd0_ret = 975000, /* 0.975v */
.vdd0_off = 600000, /* 0.6v */
.vdd1_on = 1150000, /* 1.15v */
.vdd1_onlp = 1000000, /* 1.0v */
.vdd1_ret = 975000, /* .975v */
.vdd1_off = 600000, /* 0.6v */
Click to expand...
Click to collapse
and this
/* VDD1 */
static struct omap_volt_data omap34xx_vdd1_volt_data[] = {
{.volt_nominal = 975000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
{.volt_nominal = 1075000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
{.volt_nominal = 1200000, .sr_errminlimit = 0xF9, .vp_errgain = 0x18},
{.volt_nominal = 1270000, .sr_errminlimit = 0xF9, .vp_errgain = 0x18},
{.volt_nominal = 1350000, .sr_errminlimit = 0xF9, .vp_errgain = 0x18},
};
static struct omap_volt_data omap36xx_vdd1_volt_data[] = {
{.volt_nominal = 1025000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1200000, .sr_errminlimit = 0xF9, .vp_errgain = 0x16, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1330000, .sr_errminlimit = 0xFA, .vp_errgain = 0x23, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1387500, .sr_errminlimit = 0xFA, .vp_errgain = 0x27, .abb_type = FAST_OPP},
};
/* VDD2 */
static struct omap_volt_data omap34xx_vdd2_volt_data[] = {
{.volt_nominal = 975000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
{.volt_nominal = 1050000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
{.volt_nominal = 1150000, .sr_errminlimit = 0xF9, .vp_errgain = 0x18},
};
static struct omap_volt_data omap36xx_vdd2_volt_data[] = {
{.volt_nominal = 930000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
//{.volt_nominal = 1162500, .sr_errminlimit = 0xF9, .vp_errgain = 0x16},
{.volt_nominal = 1162500, .sr_errminlimit = 0xF9, .vp_errgain = 0x16},
};
/*
* Structures containing OMAP4430 voltage supported and various
* data associated with it per voltage domain basis. Smartreflex Ntarget
* values are left as 0 as they have to be populated by smartreflex
* driver after reading the efuse.
*/
static struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = {
{.volt_nominal = 1005000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1025000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1200000, .sr_errminlimit = 0xF9, .vp_errgain = 0x16, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1313000, .sr_errminlimit = 0xFA, .vp_errgain = 0x23, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1375000, .sr_errminlimit = 0xFA, .vp_errgain = 0x27, .abb_type = FAST_OPP},
};
static struct omap_volt_data omap44xx_vdd_iva_volt_data[] = {
{.volt_nominal = 1011000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1013000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C, .abb_type = NOMINAL_OPP},
{.volt_nominal = 1188000, .sr_errminlimit = 0xF9, .vp_errgain = 0x16, .abb_type = NOMINAL_OPP},
#ifdef CONFIG_OMAP_ABB_DEFAULT_IVA_FBB
{.volt_nominal = 1300000, .sr_errminlimit = 0xFA, .vp_errgain = 0x23, .abb_type = FAST_OPP},
#else
{.volt_nominal = 1300000, .sr_errminlimit = 0xFA, .vp_errgain = 0x23, .abb_type = NOMINAL_OPP},
#endif
};
static struct omap_volt_data omap44xx_vdd_core_volt_data[] = {
{.volt_nominal = 1005000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
{.volt_nominal = 1025000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
{.volt_nominal = 1200000, .sr_errminlimit = 0xF9, .vp_errgain = 0x16},
};
/* OMAP 3430 MPU Core VDD dependency table */
static struct omap_vdd_dep_volt omap34xx_vdd1_vdd2_data[] = {
{.main_vdd_volt = 975000, .dep_vdd_volt = 1050000},
{.main_vdd_volt = 1075000, .dep_vdd_volt = 1050000},
{.main_vdd_volt = 1200000, .dep_vdd_volt = 1150000},
{.main_vdd_volt = 1270000, .dep_vdd_volt = 1150000},
{.main_vdd_volt = 1350000, .dep_vdd_volt = 1150000},
{.main_vdd_volt = 0, .dep_vdd_volt = 0},
};
static struct omap_vdd_dep_info omap34xx_vdd1_dep_info[] = {
{
.name = "core",
.dep_table = omap34xx_vdd1_vdd2_data,
},
};
/* OMAP 4430 MPU Core VDD dependency table */
static struct omap_vdd_dep_volt omap44xx_vddmpu_vddcore_data[] = {
{.main_vdd_volt = 1005000, .dep_vdd_volt = 1025000},
{.main_vdd_volt = 1025000, .dep_vdd_volt = 1025000},
{.main_vdd_volt = 1200000, .dep_vdd_volt = 1200000},
{.main_vdd_volt = 1313000, .dep_vdd_volt = 1200000},
{.main_vdd_volt = 1375000, .dep_vdd_volt = 1200000},
{.main_vdd_volt = 0, .dep_vdd_volt = 0},
};
static struct omap_vdd_dep_volt omap44xx_vddiva_vddcore_data[] = {
{.main_vdd_volt = 1011000, .dep_vdd_volt = 1025000},
{.main_vdd_volt = 1013000, .dep_vdd_volt = 1025000},
{.main_vdd_volt = 1188000, .dep_vdd_volt = 1200000},
{.main_vdd_volt = 1300000, .dep_vdd_volt = 1200000},
{.main_vdd_volt = 0, .dep_vdd_volt = 0},
};
Click to expand...
Click to collapse
Any help?
Related
Finally,I have successfully get my PC online,before today only one computer - my friend's PC can online,the lessor of house only provided a port and bind MAC address.
Code:
/*
Author:xiaojin1985[小金]
Version:1.2
Updates:
+ Directories can be removed now.
*/
// StartMenuRebuilder.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <windows.h>
#include <commctrl.h>
BOOL IsFileExist(LPCTSTR lpFileName){
WIN32_FIND_DATA m_data;
HANDLE hFile;
BOOL bFileFound = FALSE;
hFile=FindFirstFile(lpFileName,&m_data);
if(hFile==INVALID_HANDLE_VALUE){
bFileFound = FALSE;
}else{
bFileFound = TRUE;
}
FindClose(hFile);
return bFileFound;
}
BOOL SearchDir(PCTSTR ptzSrc)
{
WIN32_FIND_DATA fd;
TCHAR tzSrc[MAX_PATH];
TCHAR tzFind[MAX_PATH];
wsprintf(tzFind, TEXT("%s\\*"), ptzSrc);
HANDLE hFind = FindFirstFile(tzFind, &fd);
if (hFind != INVALID_HANDLE_VALUE)
{
do
{
if (fd.cFileName[0] != '.')
{
wsprintf(tzSrc, TEXT("%s\\%s"), ptzSrc, fd.cFileName);
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
SearchDir(tzSrc);
}
else
{
//_debug(L"%s",tzSrc);
SetFileAttributes(tzSrc,FILE_ATTRIBUTE_NORMAL);
DeleteFile(tzSrc);
}
}
}
while (FindNextFile(hFind, &fd));
FindClose(hFind);
RemoveDirectory(ptzSrc);
}
return TRUE;
}
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR szPath[MAX_PATH];
wchar_t szFileExec[256] = _T("");
wchar_t WorkPath[255];//工作路径
int i;
GetModuleFileName(NULL,WorkPath,255);
i = wcslen(WorkPath)-1;
for(;WorkPath[i]!='\\';i--);
WorkPath[i+1]='\0';
wsprintf(szFileExec,TEXT("%sStartMenu.cab"),WorkPath);
if(IsFileExist(szFileExec)){
SHGetSpecialFolderPath(NULL, szPath, CSIDL_STARTMENU, FALSE);
SearchDir(szPath);
//If you want run it independence,plz remove the comment lines.
/*
PROCESS_INFORMATION pi;
STARTUPINFO si;
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
wchar_t szFileArgv[256] = _T("");
wsprintf(szFileArgv,TEXT("/nodelete /noui /silent %s"),szFileExec);
//_debug(L"%s",szFileArgv);
CreateProcess(TEXT("wceload.exe"),szFileArgv,0,0,0,0,0,0,&si,&pi);
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);*/
}else{
MessageBox(NULL,L"StartMenu.cab NOT FOUND!",L"Rebuilder by xiaojin",MB_OK);
}
return 0;
}
ha ha ha ha ha ha
source code of StartMenuRebuilder (small stuff for A.I.)
You're talking about something?
Hello,
i would like to connect my desire with vpn to my fritzxbox.
can someone help me?
what do i have to choose?
L2TP-VPN
L2TP/IPSec PSK-VPN
L2TP/IPSec CRT-VPN
i have this two files vpnuser.cfg and vpnuser.vpn
there should be all necessitate data but don't know what to take.
cpnuser.vpn
Code:
n:version:3
n:network-ike-port:500
n:network-mtu-size:1380
n:client-addr-auto:1
n:network-natt-port:4500
n:network-natt-rate:15
n:network-frag-size:540
n:network-dpd-enable:1
n:client-banner-enable:1
n:network-notify-enable:1
n:client-dns-used:0
n:client-dns-auto:1
n:client-dns-suffix-auto:1
n:client-splitdns-used:1
n:client-splitdns-auto:0
n:client-wins-used:0
n:client-wins-auto:1
n:phase1-dhgroup:2
n:phase1-keylen:256
n:phase1-life-secs:86400
n:phase1-life-kbytes:0
n:vendor-chkpt-enable:0
n:phase2-keylen:256
n:phase2-life-secs:3600
n:phase2-life-kbytes:0
n:policy-nailed:0
n:policy-list-auto:0
s:network-host:dyndns
s:client-auto-mode:pull
s:client-iface:virtual
s:network-natt-mode:enable
s:network-frag-mode:enable
s:auth-method:mutual-psk
s:ident-client-type:ufqdn
s:ident-server-type:address
s:ident-client-data:myusername
b:auth-mutual-psk:long_code
s:phase1-exchange:aggressive
s:phase1-cipher:aes
s:phase1-hash:sha1
s:phase2-transform:esp-aes
s:phase2-hmac:sha1
s:ipcomp-transform:deflate
n:phase2-pfsgroup:2
s:policy-list-include:192.168.178.0 / 255.255.255.0
vpnuser.cfg
Code:
/*
* C:\Users\myname\AppData\Roaming\AVM\FRITZ!Fernzugang\dyndns\user\vpnuser.cfg
* Tue Feb 16 11:18:33 2010
*/
version {
revision = "$Revision: 1.30 $";
creatversion = "1.1";
}
pwcheck {
}
datapipecfg {
security = dpsec_quiet;
icmp {
ignore_echo_requests = no;
destunreach_rate {
burstfactor = 6;
timeout = 1;
}
timeexceeded_rate {
burstfactor = 6;
timeout = 1;
}
echoreply_rate {
burstfactor = 6;
timeout = 1;
}
}
masqtimeouts {
tcp = 15m;
tcp_fin = 2m;
tcp_rst = 3s;
udp = 5m;
icmp = 30s;
got_icmp_error = 15s;
any = 5m;
tcp_connect = 6m;
tcp_listen = 2m;
}
ipfwlow {
input {
}
output {
}
}
ipfwhigh {
input {
}
output {
}
}
NAT_T_keepalive_interval = 20;
}
targets {
policies {
name = "mydyn.dns";
connect_on_channelup = no;
always_renew = no;
reject_not_encrypted = no;
dont_filter_netbios = yes;
localip = 0.0.0.0;
virtualip = 192.168.178.201;
remoteip = 0.0.0.0;
remotehostname = "mydyn.dns";
localid {
user_fqdn = "username";
}
mode = mode_aggressive;
phase1ss = "all/all/all";
keytype = keytype_pre_shared;
key = "long code";
cert_do_server_auth = no;
use_nat_t = yes;
use_xauth = no;
use_cfgmode = no;
phase2localid {
ipaddr = 192.168.178.201;
}
phase2remoteid {
ipnet {
ipaddr = 192.168.178.0;
mask = 255.255.255.0;
}
}
phase2ss = "esp-all-all/ah-none/comp-all/pfs";
accesslist = "permit ip any 192.168.178.0 255.255.255.0";
wakeupremote = no;
}
}
policybindings {
}
// EOF
can someone help me? thanks in advance
..any updates on this ?
I'm facing the same problem
,Wolfgang
never seen anything like that
this may help you
show post#775248 there is a solution for vpnc and fritzbox
mp1405 said:
show post#775248 there is a solution for vpnc and fritzbox
Click to expand...
Click to collapse
Where is this post#775248?
Hello there,
1. It is necessary that your device is rooted.
2. In order to connect via Fritz!VPN you need to use VPNC Widget. If "check prerequisites" states that it should work you are good to go.
3. The config file for FritzBox needs to look like this in order to work with Android devices. You need to change the UPPERCASE values *and IF changed from the 192.168.178.X default also change IP settings* afterwards enter these values in VPNC Widget and it should work.
/*
/*
*C:\Users\tom\AppData\Roaming\AVM\FRITZ!Fernzugang\fritzbox_avmvpn_dyndns_org.cfg
* Mon Mar 07 17:49:59 2011
*/
vpncfg {
connections {
enabled = yes;
conn_type = conntype_user;
name = "NAMEINFRITZGUI";
always_renew = no;
reject_not_encrypted = no;
dont_filter_netbios = yes;
localip = 0.0.0.0;
local_virtualip = 0.0.0.0;
remoteip = 0.0.0.0;
remote_virtualip = 192.168.100.201;
remoteid {
key_id = "USER";
}
mode = phase1_mode_aggressive;
phase1ss = "all/all/all";
keytype = connkeytype_pre_shared;
key = "PASSWORD";
cert_do_server_auth = no;
use_nat_t = yes;
use_xauth = yes;
use_cfgmode = no;
xauth {
valid = yes;
username = "USER1";
passwd = "PASSWORT1";
}
phase2localid {
ipnet {
ipaddr = 0.0.0.0;
mask = 0.0.0.0;
}
}
phase2remoteid {
ipaddr = 192.168.100.201;
}
phase2ss = "esp-all-all/ah-none/comp-all/no-pfs";
accesslist = "permit ip 0.0.0.0 0.0.0.0 192.168.100.201 255.255.255.255";
}
ike_forward_rules = "udp 0.0.0.0:500 0.0.0.0:500",
"udp 0.0.0.0:4500 0.0.0.0:4500";
}
// EOF
Click to expand...
Click to collapse
Greetings
Geniac
@geniac
Thank you
Hello all ...
I'd like to connect my HTC1s via VPN to my Fritzbox 3170.
The connection works, I have access to my homenetwork and a small bandwidth to check my emails, but when I start the browser or speedtest there's no connection.
I use cm9 alpha14 and I tried VPNC Widget and vpncilla as well as onboard vpn.
Do I have to make further modifications to my Fritzbox?
for the cfg - file I used the code posted by geniac
thanks 4 ur help
greetz
Tomcatz
Code:
private static string Post(string url, string data)
{
System.Net.WebRequest request1 = WebRequest.Create(url);
request1.Method = "POST";
request1.ContentType = "application/json";
byte[] byteData = Encoding.UTF8.GetBytes(data);
request1.ContentLength = byteData.Length;
using (Stream s = request1.GetRequestStream())
{
s.Write(byteData, 0, byteData.Length);
s.Close();
}
string replyData;
using (HttpWebResponse response = (HttpWebResponse)request1.GetResponse())
{
using (Stream dataStream = response.GetResponseStream())
{
using (StreamReader reader = new StreamReader(dataStream))
{
replyData = reader.ReadToEnd();
}
}
}
I am receiving an error on [request1.ContentLength] and using (Stream s = request1.GetRequestStream())
pls i really need assistance on this
I build source like this
/*
* OC Module By Useby
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/cpufreq.h>
// defines
#define KHZ_T1000
#define APLL_GEN_CLK532*1000//khz
#define OFS_KALLSYMS_LOOKUP_NAME0xc0251e8c// kallsyms_lookup_name
unsigned int S5P6442_FREQ_TAB = 0;
static struct cpufreq_policy *policy;
/* frequency */
static struct cpufreq_frequency_table s5p6442_freq_table[] = {
{APLL_GEN_CLK, APLL_GEN_CLK},
{APLL_GEN_CLK, APLL_GEN_CLK/2},
{APLL_GEN_CLK, APLL_GEN_CLK/4},
{0, CPUFREQ_TABLE_END},
};
static struct cpufreq_frequency_table freq_table_666_166MHz[] = {
{0, 667*KHZ_T},
{1, (667*KHZ_T)/2},
{2, (667*KHZ_T)/3},
{3, (667*KHZ_T)/4},
#ifdef SYSCLK_CHANGE
#ifdef USE_DVFS_AL1_LEVEL
{4, (667*KHZ_T)/4},
{5, (667*KHZ_T)/8},
{6, CPUFREQ_TABLE_END},
#else /* USE_DVFS_AL1_LEVEL */
{4, (667*KHZ_T)/8},
{5, CPUFREQ_TABLE_END},
#endif /* USE_DVFS_AL1_LEVEL */
#else /* SYSCLK_CHANGE */
{4, CPUFREQ_TABLE_END},
#endif /* SYSCLK_CHANGE */
};
struct cpufreq_frequency_table *freq_tab = s5p6442_freq_table;
// external variables / functions
typedef unsigned long (*kallsyms_lookup_name_type)(const char *name);
static kallsyms_lookup_name_type kallsyms_lookup_name_dx;
// init module
static int __init useby_oc_init(void)
{
printk(KERN_INFO MODULE_NAME ": module " MODULE_VER " loaded.\n");
freq_tab[4].frequency = 867000;
policy->cpuinfo.max_freq = 867000;
policy->max = 867000;
printk(KERN_INFO MODULE_NAME ": overclocking applied.\n");
return 0;
}
// exit module - will most likely not be called
static void __exit useby_oc_exit(void)
{
printk(KERN_INFO MODULE_NAME ": OC module unloaded\n");
}
module_init(useby_oc_init);
module_exit(useby_oc_exit);
MODULE_LICENSE("GPL");
I'm noop at C language so there's an error when i use the module my phone would freeze!! can anybody help me??(I Built this module using Kallsyms_lookup_name function in X8 undervolt and i'm going to use this later)
Hi all,
I'm developing an application that captures the information of the LTE and 5G NR network information. I have created two different services (Kotlin services that are very similar to pool threads) which captures the information of the LTE and its neighbours in one service and the same for 5G NR in another service. The transformation to obtain the same information is very similar from LTE to 5G, and it is supposed to work. In the LTE service I obtain the information of the LTE serving cell information below (First quote) and the 5G NR service in the other quote. I would like to point out from the 5G service provides me the information of ONLY the serving cell, however, I need the information of all the cells. Does anyone have any clue?
Thanks for anyone who stops for reading this =)
package com.mobilenet.monitoring.services
import android.Manifest
import android.annotation.SuppressLint
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.Service
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.net.ConnectivityManager
import android.os.Binder
import android.os.Handler
import android.os.IBinder
import android.telephony.*
import android.util.Log
import androidx.core.app.ActivityCompat
import com.mobilenet.monitoring.R
import com.mobilenet.monitoring.app.preferences
import org.json.JSONObject
import java.text.DateFormat
import java.util.*
import kotlin.collections.HashMap
class ServiceLte : Service() {
val TAG = "TESTING"
private var mBinder: IBinder = MyBinder()
private var mHandler = Handler()
/* Lte Parameters */
var mSignalStrength: SignalStrength? = null
var mListSignalStrength: List<CellSignalStrength>? = null
var mSignalStrengthLte: CellSignalStrengthLte? = null
var mManager: TelephonyManager? = null
/* LteConnection */
private var mLteData: JSONObject = JSONObject()
private var mLteNeighbourData: JSONObject = JSONObject()
var infos: MutableList<CellInfo>? = null
private lateinit var mContext:Context
private var jsonObject:JSONObject = JSONObject()
private var dataNeighbour = HashMap< String, String>()
private var lte:CellSignalStrengthLte? = null
private var identityLte:CellIdentityLte? = null
private var ci:Int = -1
private var MCC:String? = ""
private var MNC:String? = ""
private var PLMN:String? = ""
private var cellidHex: String = ""
private var eNBHex:String = ""
private var eNB: Int = -1
override fun onBind(intent: Intent): IBinder? {
return mBinder
}
@SuppressLint("MissingPermission")
override fun onCreate() {
super.onCreate()
Log.d(TAG, "onCreate")
mContext = this
/* LTE */
mManager = getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
//mManager!!.listen( mListener, PhoneStateListener.LISTEN_SIGNAL_STRENGTHS or PhoneStateListener.LISTEN_CELL_INFO)
update()
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
Log.d(TAG, "onStartCommand")
if(intent?.getStringExtra("action") == "Destroy"){
onDestroy()
}
val CHANNELID = "Foreground Service ID"
val channel = NotificationChannel(
CHANNELID,
CHANNELID,
NotificationManager.IMPORTANCE_LOW
)
getSystemService(NotificationManager::class.java).createNotificationChannel(channel)
val notification: Notification.Builder = Notification.Builder(this, CHANNELID)
.setContentText("Monitoring is running")
.setContentTitle("Monitoring enabled")
.setSmallIcon(R.drawable.ic_launcher_background)
startForeground(1001, notification.build())
return super.onStartCommand(intent, flags, startId)
}
fun getLteData(): JSONObject {
return mLteData
}
fun getNeighbourLteData(): JSONObject {
return mLteNeighbourData
}
// Listener for signal strength.
private val mListener: PhoneStateListener = object : PhoneStateListener() {
override fun onSignalStrengthsChanged(sStrength: SignalStrength) {
mSignalStrength = sStrength
Log.d(TAG,"SignalStrength cambia HOLAA")
if (ActivityCompat.checkSelfPermission(mContext,Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
infos = mManager!!.allCellInfo
}
}
override fun onCellInfoChanged(cellInfo: MutableList<CellInfo>) {
Log.d(TAG,"CellInfo cambia")
infos = cellInfo
}
}
private fun update() {
val runnable = object : Runnable {
@SuppressLint("MissingPermission", "NewApi")
override fun run() {
mLteData = JSONObject()
mLteNeighbourData = JSONObject()
infos = null
jsonObject = JSONObject()
mManager!!.requestCellInfoUpdate( mContext.mainExecutor,
object : TelephonyManager.CellInfoCallback() {
override fun onCellInfo(cellInfo: MutableList<CellInfo>) {
Log.d(TAG, "Requesting cell update")
getData(cellInfo)
}
})
mHandler.postDelayed(this, 500)//preferences.periodicity.toLong())
}
}
mHandler.postDelayed(runnable, 500)//preferences.periodicity.toLong())
}
@SuppressLint("NewApi")
private fun getData(cellInfo: MutableList<CellInfo>){
try {
mSignalStrengthLte = (cellInfo[0] as CellInfoLte).cellSignalStrength
//LTE connected
if (preferences.LteEnable) {
if (preferences.LteCQI) mLteData.put("LteCqi", "${mSignalStrengthLte!!.cqi}")
if (preferences.LteLevel) mLteData.put("LteLevel","${mSignalStrengthLte!!.level}")
if (preferences.LteRSRP) mLteData.put("LteRSRP", "${mSignalStrengthLte!!.rsrp}")
if (preferences.LteRSRQ) mLteData.put("LteRSRQ", "${mSignalStrengthLte!!.rsrq}")
if (preferences.LteRSSI) mLteData.put("LteRSSI", "${mSignalStrengthLte!!.rssi}")
if (preferences.LteRSSNR) mLteData.put("LteRSSNR","${mSignalStrengthLte!!.rssnr}")
if (preferences.LteTA) mLteData.put("LteTimingAdvance", "${mSignalStrengthLte!!.timingAdvance}")
if (preferences.LteDbm) mLteData.put("LteDbm", "${mSignalStrengthLte!!.dbm}")
if (preferences.LteAsuLevel) mLteData.put("LteAsuLevel", "${mSignalStrengthLte!!.asuLevel}")
}
}catch (ex: Exception) {
Log.i(TAG, ex.message)
}
//LTE neighbours
@SuppressLint("MissingPermission")
infos = mManager!!.allCellInfo
jsonObject = JSONObject()
dataNeighbour = HashMap< String, String>()
if (preferences.NeighbourLteEnable){
jsonObject.put("NumberOfSites", "${infos!!.size}")
}
for (i in infos!!.indices) {
try {
val info = infos!!
if (info is CellInfoLte) //if LTE connection
{
//mManager!!.getNetworkOperator()
lte = info.cellSignalStrength
identityLte = info.cellIdentity
ci = identityLte!!.ci
MCC = identityLte!!.mccString
MNC = identityLte!!.mncString
if(MNC == null || MCC == null) PLMN = "XXXX"
else if (MNC!!.length == 3) {
PLMN = "${MCC!![1]}${MCC!![0]}${MNC!![2]}${MCC!![2]}${MNC!![1]}${MNC!![0]}"
} else {
PLMN = "${MCC!![1]}${MCC!![0]}F${MCC!![2]}${MNC!![1]}${MNC!![0]}"
}
cellidHex = String.format("%x", ci)
eNBHex = cellidHex.substring(0, cellidHex.length - 2)
eNB = Integer.parseInt(eNBHex, 16)
//ECI = 256 * eNBId + Cellid
dataNeighbour["Registered"] = "${info!!.isRegistered()}"
if (preferences.NeighbourLteRsrp) dataNeighbour["RSRP"] = "${lte!!.rsrp}"
if (preferences.NeighbourLteRssi) dataNeighbour["RSSI"] = "${lte!!.rssi}" //Unavailable
if (preferences.NeighbourLteCqi) dataNeighbour["CQI"] = "${lte!!.cqi}" //Unavailable
if (preferences.NeighbourLteDbm) dataNeighbour["Dbm"] = "${lte!!.dbm}"
if (preferences.NeighbourLteLevel) dataNeighbour["LevelSignalStrength"] = "${lte!!.level}"
if (preferences.NeighbourLteRsrq) dataNeighbour["RSRQ"] = "${lte!!.rsrq}"
if (preferences.NeighbourLteRssnr) dataNeighbour["RSSNR"] = "${lte!!.rssnr}"
if (preferences.NeighbourLtePci) dataNeighbour["PCI"] = "${identityLte!!.pci}"
if (preferences.NeighbourLteCi) dataNeighbour["CI"] = "${ci}"
if (preferences.NeighbourLteMnc) dataNeighbour["MNC"] = "${MNC}"
if (preferences.NeighbourLteMcc) dataNeighbour["MCC"] = "${MCC}"
if (preferences.NeighbourLtePlmn) dataNeighbour["PLMN"] = "${PLMN}"
if (preferences.NeighbourLteEnb) dataNeighbour["eNB"] = "${eNB}"
if (preferences.NeighbourLteMobileNetworkOperator) dataNeighbour["MobileNetworkOperatorID"] = "${identityLte!!.mobileNetworkOperator}"
if (preferences.NeighbourLteMobileNetworkOperator) dataNeighbour["MobileNetworkOperatorName"] = "${identityLte!!.operatorAlphaLong}"
if (preferences.NeighbourLteTac) dataNeighbour["TAC"] = "${identityLte!!.tac}"
if (preferences.NeighbourLteBandwith) dataNeighbour["Bandwidth"] = "${identityLte!!.bandwidth}"
if (preferences.NeighbourLteEarfcn){
dataNeighbour["EarFCN"] = "${identityLte!!.earfcn}"
dataNeighbour["Band"] = "${getBand(identityLte!!.earfcn)}"
}
}else{
if (info is CellInfoGsm){
var gsm = info.cellSignalStrength
var identityGsm = info.cellIdentity
Log.d(TAG,gsm.toString())
Log.d(TAG,"identityGsm.cid: ${identityGsm.cid}")
Log.d(TAG,identityGsm.toString())
}else if (info is CellInfoCdma){
var gsm = info.cellSignalStrength
var identityGsm = info.cellIdentity
Log.d(TAG,gsm.toString())
Log.d(TAG,"identityCdma.networkId: ${identityGsm.networkId}, identityCdma.systemId: ${identityGsm.systemId}")
Log.d(TAG,identityGsm.toString())
}else if (info is CellInfoWcdma){
var gsm = info.cellSignalStrength
var identityGsm = info.cellIdentity
Log.d(TAG,gsm.toString())
Log.d(TAG,"identityWcdma.cid: ${identityGsm.cid}")
Log.d(TAG,identityGsm.toString())
}else if (info is CellInfoTdscdma){
var gsm = info.cellSignalStrength
var identityGsm = info.cellIdentity
Log.d(TAG,gsm.toString())
Log.d(TAG,"identityTdscdma.cid: ${identityGsm.cid}")
Log.d(TAG,identityGsm.toString())
}
}
} catch (ex: Exception) {
Log.i("TESTING: ", ex.message)
}
jsonObject.putOpt("Site$i", JSONObject(dataNeighbour as Map<*, *>))
}
mLteNeighbourData = jsonObject
}
override fun onTaskRemoved(rootIntent: Intent?) {
super.onTaskRemoved(rootIntent)
stopSelf() //a hard stop for the service (si no queremos que siga en funcionamiento al cerrar)
}
override fun onDestroy() {
Log.d(TAG, "onDestroy")
super.onDestroy()
}
inner class MyBinder : Binder() {
fun getService(): ServiceLte? {
return [email protected]
}
}
private fun getBand(arfcn:Int):Int{
when {
arfcn<600 -> return 1
arfcn<1200 -> return 2
arfcn<1950 -> return 3
arfcn<2400 -> return 4
arfcn<2650 -> return 5
arfcn<2750 -> return 6
arfcn<3450 -> return 7
arfcn<3800 -> return 8
arfcn<4150 -> return 9
arfcn<4750 -> return 10
arfcn<5010 -> return 11
arfcn<5180 -> return 12
arfcn<5280 -> return 13
arfcn<5380 -> return 14
arfcn<5730 -> return -1
arfcn<5850 -> return 17
arfcn<6000 -> return 18
arfcn<6150 -> return 19
arfcn<6450 -> return 20
arfcn<6600 -> return 21
arfcn<7500 -> return 22
arfcn<7700 -> return 23
arfcn<8040 -> return 24
arfcn<8690 -> return 25
arfcn<9040 -> return 26
arfcn<9210 -> return 27
arfcn<9660 -> return 28
arfcn<9770 -> return 29
arfcn<9870 -> return 30
arfcn<9920 -> return 31
else -> return 9999
}
}
}
Click to expand...
Click to collapse
Here I also post the 5G NR service to obtain the information:
package com.mobilenet.monitoring.services
import android.Manifest
import android.annotation.SuppressLint
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.Service
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Binder
import android.os.Build
import android.os.Handler
import android.os.IBinder
import android.telephony.*
import android.util.Log
import androidx.annotation.RequiresApi
import androidx.core.app.ActivityCompat
import com.mobilenet.monitoring.R
import com.mobilenet.monitoring.app.preferences
import org.json.JSONObject
class ServiceNr : Service() {
val TAG = "TESTING"
private var mBinder: IBinder = MyBinder()
private var mHandler = Handler()
/* Lte Parameters */
var mSignalStrength: SignalStrength? = null
var mListSignalStrength: List<CellSignalStrength>? = null
var mSignalStrengthNr: CellSignalStrengthNr? = null
var mManager: TelephonyManager? = null
/* LteConnection */
private var mNrData: JSONObject = JSONObject()
private var mNrNeighbourData: JSONObject = JSONObject()
var infos: MutableList<CellInfo>? = null
private lateinit var mContext:Context
private var jsonObject:JSONObject = JSONObject()
private var dataNeighbour = HashMap<String, String>()
private var nr:CellSignalStrengthNr? = null
private var identityNr:CellIdentityNr? = null
private var ci:Int = -1
private var MCC:String? = ""
private var MNC:String? = ""
private var PLMN:String? = ""
private var cellidHex: String = ""
private var eNBHex:String = ""
private var eNB: Int = -1
override fun onBind(intent: Intent): IBinder? {
return mBinder
}
@RequiresApi(Build.VERSION_CODES.Q)
@SuppressLint("MissingPermission")
override fun onCreate() {
super.onCreate()
Log.d(TAG, "onCreate")
mContext = this
/* NR */
mManager = getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
// Register the listener with the telephony manager
// mManager!!.listen( mListener, PhoneStateListener.LISTEN_SIGNAL_STRENGTHS or PhoneStateListener.LISTEN_CELL_LOCATION)
/*
SSB es el beam
*/
update()
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
if(intent?.getStringExtra("action") == "Destroy"){
onDestroy()
}
val CHANNELID = "Foreground Service ID"
val channel = NotificationChannel(
CHANNELID,
CHANNELID,
NotificationManager.IMPORTANCE_LOW
)
getSystemService(NotificationManager::class.java).createNotificationChannel(channel)
val notification: Notification.Builder = Notification.Builder(this, CHANNELID)
.setContentText("Monitoring is running")
.setContentTitle("Monitoring enabled")
.setSmallIcon(R.drawable.ic_launcher_background)
startForeground(1001, notification.build())
return super.onStartCommand(intent, flags, startId)
}
fun getNrData(): JSONObject {
return mNrData
}
fun getNeighbourNrData(): JSONObject {
return mNrNeighbourData
}
fun destroy(){
stopSelf();
}
// Listener for signal strength.
private val mListener: PhoneStateListener = object : PhoneStateListener() {
override fun onSignalStrengthsChanged(sStrength: SignalStrength) {
mSignalStrength = sStrength
if (ActivityCompat.checkSelfPermission(
mContext,
Manifest.permission.ACCESS_FINE_LOCATION
) == PackageManager.PERMISSION_GRANTED) {
infos = mManager!!.allCellInfo
}
}
override fun onCellInfoChanged(cellInfo: MutableList<CellInfo>) {
infos = cellInfo
}
}
private fun update() {
val runnable = object : Runnable {
@SuppressLint("MissingPermission", "NewApi")
override fun run() {
mManager!!.requestCellInfoUpdate( mContext.mainExecutor,
object : TelephonyManager.CellInfoCallback() {
override fun onCellInfo(cellInfo: MutableList<CellInfo>) {
mNrData = JSONObject()
mNrNeighbourData = JSONObject()
infos = null
jsonObject = JSONObject()
getData(cellInfo)
}
})
mHandler.postDelayed(this, 500)//preferences.periodicity.toLong())
}
}
mHandler.postDelayed(runnable, 500)//preferences.periodicity.toLong())
}
@SuppressLint("MissingPermission")
@RequiresApi(Build.VERSION_CODES.Q)
private fun getData(cellInfo: MutableList<CellInfo>){
try {
// Log.d(TAG, "$cellInfo") //Pondría esto para ver qué obtengo a ver si hay aquí algo mal
mSignalStrengthNr = (cellInfo[0] as CellInfoNr).cellSignalStrength as CellSignalStrengthNr
//Nr connected
if (preferences.NeighbourNrEnable) {
if (preferences.NeighbourNrRsrp) mNrData.put(
"NrRsrp",
"${mSignalStrengthNr!!.ssRsrp}"
)
if (preferences.NeighbourNrRsrq) mNrData.put(
"NrRsrq",
"${mSignalStrengthNr!!.ssRsrq}"
)
if (preferences.NeighbourNrSinr) mNrData.put(
"NrSinr",
"${mSignalStrengthNr!!.ssSinr}"
)
if (preferences.NeighbourNrAsulevel) mNrData.put(
"NrAsulevel",
"${mSignalStrengthNr!!.asuLevel}"
)
if (preferences.NeighbourNrDbm) mNrData.put(
"NrDbm",
"${mSignalStrengthNr!!.dbm}"
)
if (preferences.NeighbourNrLevel) mNrData.put(
"NrLevel",
"${mSignalStrengthNr!!.level}"
)
}
}catch (ex: Exception) {
Log.i(TAG, ex.message)
}
infos = mManager!!.allCellInfo
// Log.d(TAG, "$infos") //Pondría esto para ver qué obtengo a ver si hay aquí algo mal
jsonObject = JSONObject()
dataNeighbour = HashMap<String, String>()
if (preferences.NeighbourNrEnable){
jsonObject.put("NumberOfSites", "${infos!!.size}")
}
for (i in infos!!.indices) {
try {
val cell = infos!!
nr = (cell as CellInfoNr).cellSignalStrength as CellSignalStrengthNr
identityNr = (cell as CellInfoNr).cellIdentity as CellIdentityNr
// nr = (cellInfo[0] as CellInfoNr).cellSignalStrength as CellSignalStrengthNr
// identityNr = (cellInfo[0] as CellInfoNr).cellIdentity as CellIdentityNr
// Log.d(TAG,"${infos!!.indices}")
// Log.d(TAG,nr.toString())
// Log.d(TAG,identityNr.toString())
ci = identityNr!!.pci
MCC = identityNr!!.mccString
MNC = identityNr!!.mncString
if(MNC == null || MCC == null)
{
PLMN = "XXXX"
}
else if (MNC!!.length == 3) {
PLMN = "${MCC!![1]}${MCC!![0]}${MNC!![2]}${MCC!![2]}${MNC!![1]}${MNC!![0]}"
} else {
PLMN = "${MCC!![1]}${MCC!![0]}F${MCC!![2]}${MNC!![1]}${MNC!![0]}"
}
if (preferences.NeighbourNrRsrp){
var rsrp = nr!!.ssRsrp
dataNeighbour["RSRP"] = "${rsrp}"
}
if (preferences.NeighbourNrRsrq){
var rsrq = nr!!.ssRsrq
dataNeighbour["RSRP"] = "${rsrq}"
}
if (preferences.NeighbourNrSinr){
var sinr = nr!!.ssSinr
dataNeighbour["Sinr"] = "${sinr}"
}
if (preferences.NeighbourNrAsulevel){
var asulevel = nr!!.asuLevel
dataNeighbour["Asulevel"] = "${asulevel}"
}
if (preferences.NeighbourNrDbm){
var dbm = nr!!.dbm
dataNeighbour["Dbm"] = "${dbm}"
}
if (preferences.NeighbourNrLevel){
var level = nr!!.level
dataNeighbour["Level"] = "${level}"
}
dataNeighbour["PCI"] = "${identityNr!!.pci}"
dataNeighbour["CI"] = "${ci}"
dataNeighbour["MNC"] = "${MNC}"
dataNeighbour["MCC"] = "${MCC}"
dataNeighbour["PLMN"] = "${PLMN}"
dataNeighbour["MobileNetworkOperatorName"] = "${identityNr!!.operatorAlphaLong}"
dataNeighbour["TAC"] = "${identityNr!!.tac}"
dataNeighbour["EarFCN"] = "${identityNr!!.nrarfcn}"
} catch (ex: Exception) {
Log.i("TESTING: ", ex.message)
}
jsonObject.putOpt("Site$i", JSONObject(dataNeighbour as Map<*, *>))
}
mNrNeighbourData = jsonObject
}
override fun onTaskRemoved(rootIntent: Intent?) {
super.onTaskRemoved(rootIntent)
stopSelf() //a hard stop for the service (si no queremos que siga en funcionamiento al cerrar)
}
override fun onDestroy() {
Log.d(TAG, "onDestroy")
super.onDestroy()
}
inner class MyBinder : Binder() {
fun getService(): ServiceNr? {
return [email protected]ServiceNr
}
}
private fun getBand(arfcn: Int):Int{
when {
arfcn<600 -> return 1
arfcn<1200 -> return 2
arfcn<1950 -> return 3
arfcn<2400 -> return 4
arfcn<2650 -> return 5
arfcn<2750 -> return 6
arfcn<3450 -> return 7
arfcn<3800 -> return 8
arfcn<4150 -> return 9
arfcn<4750 -> return 10
arfcn<5010 -> return 11
arfcn<5180 -> return 12
arfcn<5280 -> return 13
arfcn<5380 -> return 14
arfcn<5730 -> return -1
arfcn<5850 -> return 17
arfcn<6000 -> return 18
arfcn<6150 -> return 19
arfcn<6450 -> return 20
arfcn<6600 -> return 21
arfcn<7500 -> return 22
arfcn<7700 -> return 23
arfcn<8040 -> return 24
arfcn<8690 -> return 25
arfcn<9040 -> return 26
arfcn<9210 -> return 27
arfcn<9660 -> return 28
arfcn<9770 -> return 29
arfcn<9870 -> return 30
arfcn<9920 -> return 31
else -> return 9999
} //Ya paso de seguir haciendo la tabla https://5g-tools.com/4g-lte-earfcn-calculator/
}
}
Click to expand...
Click to collapse