set the bearermode V110 for a GSM ISDN data connection - Windows Mobile Development and Hacking General

Hi,
how can I set the bearermode for a GSM to ISDN dataconnection?
If I connect with my tornado (SDA) smartephone (TAPI) to ISDN, the bearermode will be 3,1 KHz and not "unrestricted digital, V110".
How can I change this?
my code:
Code:
LPLINECALLPARAMS lpCallParams;
lpCallParams = (LPLINECALLPARAMS)malloc(sizeof(LINECALLPARAMS) + 1024); //Speicher reservieren
memset(lpCallParams,0,sizeof(LINECALLPARAMS) + 1024); //0en
lpCallParams->dwTotalSize = sizeof(LINECALLPARAMS) + 1024;
lpCallParams->dwMediaMode = mediaMode;
lpCallParams->dwBearerMode = LINEBEARERMODE_VOICE; //LINEBEARERMODE_VOICE;//LINEBEARERMODE_PASSTHROUGH; //LINEBEARERMODE_VOICE;
lpCallParams->dwCallParamFlags = LINECALLPARAMFLAGS_IDLE;
lpCallParams->dwAddressMode = LINEADDRESSMODE_ADDRESSID;
lpCallParams->dwAddressID = 0;
lpCallParams->dwDisplayableAddressOffset = sizeof(LINECALLPARAMS);
lpCallParams->dwDisplayableAddressSize = number.GetLength();
strcpy((LPSTR)lpCallParams + sizeof(LINECALLPARAMS), (const char*)num);
ret = lineMakeCall(line, &hCall, num, 0, lpCallParams);
Thanks
Thomas

tq said:
Hi,
how can I set the bearermode for a GSM to ISDN dataconnection?
If I connect with my tornado (SDA) smartephone (TAPI) to ISDN, the bearermode will be 3,1 KHz and not "unrestricted digital, V110".
How can I change this?
my code:
Code:
LPLINECALLPARAMS lpCallParams;
lpCallParams = (LPLINECALLPARAMS)malloc(sizeof(LINECALLPARAMS) + 1024); //Speicher reservieren
memset(lpCallParams,0,sizeof(LINECALLPARAMS) + 1024); //0en
lpCallParams->dwTotalSize = sizeof(LINECALLPARAMS) + 1024;
lpCallParams->dwMediaMode = mediaMode;
lpCallParams->dwBearerMode = LINEBEARERMODE_VOICE; //LINEBEARERMODE_VOICE;//LINEBEARERMODE_PASSTHROUGH; //LINEBEARERMODE_VOICE;
lpCallParams->dwCallParamFlags = LINECALLPARAMFLAGS_IDLE;
lpCallParams->dwAddressMode = LINEADDRESSMODE_ADDRESSID;
lpCallParams->dwAddressID = 0;
lpCallParams->dwDisplayableAddressOffset = sizeof(LINECALLPARAMS);
lpCallParams->dwDisplayableAddressSize = number.GetLength();
strcpy((LPSTR)lpCallParams + sizeof(LINECALLPARAMS), (const char*)num);
ret = lineMakeCall(line, &hCall, num, 0, lpCallParams);
Click to expand...
Click to collapse
I would think using LINEBEARERMODE_DATA would help, but the mediamode is also important, it could be LINEMEDIAMODE_DIGITALDATA or LINEMEDIAMODE_DATAMODEM.
bigmac

LINEBEARERMODE_DATA, LINEMEDIAMODE_DIGITALDATA
Hi,
if I set LINEBEARERMODE_DATA the result is the same (3,1 kHz audio). LINEMEDIAMODE_DIGITALDATA don't work with LINEBEARERMODE_DATA or LINEBEARERMODE_VOICE.
Today, I test it on an O2 XDA mini and I get 3,1KHz audio, too.
I found the function lineSetCallBarringState. But what is "lpszPassword ". What is the default setting?
Is the functioned helpful?
thx Thomas

Related

HD2 take only photo with 640x480 when using CameraCaptureDialog

Hi,
I have write an application for the HD2 to take a photo in my application.
But the photo has always a resolution of 640x480 even if I set
ccd.Resolution = new Size(2592, 1552);
My code:
Code:
public void OpenCamera(CameraCaptureMode mode)
{
DateTime timestamp = DateTime.Now;
CameraCaptureDialog ccd = new CameraCaptureDialog();
ccd.InitialDirectory = Config.GetString("UserImageFolder");
if (!System.IO.Directory.Exists(ccd.InitialDirectory))
System.IO.Directory.CreateDirectory(ccd.InitialDirectory);
ccd.Mode = mode;
ccd.StillQuality = CameraCaptureStillQuality.High;
ccd.Resolution = new Size(2592, 1552);
String basename = String.Format("{0:0000}-{1:00}-{2:00} {3:00}{4:00}{5:00} - ", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
if (Global.SelectedCache != null)
{
basename += Global.RemoveInvalidFatChars(StringUtils.Left(Global.SelectedCache.Name, 32).Trim());
ccd.Title = Global.SelectedCache.Name;
}
String extension = (mode == CameraCaptureMode.Still) ? ".jpg" : ".mp4";
int cnt = 0;
while (System.IO.File.Exists(Config.GetString("UserImageFolder") + "\\" + basename + ((cnt > 0) ? " - " + cnt.ToString() : "") + extension))
cnt++;
ccd.DefaultFileName = basename + ((cnt > 0) ? " - " + cnt.ToString() : "") + extension;
try
{
ccd.ShowDialog();
String name = (Global.SelectedCache != null) ? Global.SelectedCache.Name : "Image";
AnnotateMedia(name, ccd.DefaultFileName, Global.Locator.LastValidPosition, timestamp);
}
catch (Exception exc)
{
#if DEBUG
Global.AddLog("Main.OpenCamera: " + exc.ToString());
#endif
MessageBox.Show("An error occured! Seems as if your device had no camera!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
cameraImageButton.Enabled = false;
cameraVideoButton.Enabled = false;
}
ccd.Dispose();
}
Is anybody out here, who can tell me what I have to do, to change the resolution to the max. (2592x1552) of the HD2?
Thanks a lot and please sorry my bad english.
Andreas
I found the solution
CameraCaptureDialog accept only resolution that define in the registry.
So I modify
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Pictures\Camera\OEM\PictureResolution\1]
the keys
Height = 1944
Width = 2592
No I can take pictures with 2592x1552 with the code modify
Code:
ccd.Resolution = new Size(2592, 1552);

Kernel developer, please check these code about vibration for korean model

Dear kernel developer on xda, I need a small help from you.
maybe you know, if you upload custom kernel on I9100 korean version (known as m250k, m250s...), the vibration will be weak than original.
I tried to change the kernel code to fix the problem.
I compiled the original code from samsungopensource, and fix the code like below, and it works.
But there are another problem is that the kernel I compiled was some power consuming.
So can you give me a hand to merge these code to your kernel and release them for korean hardware?
Thanks a lot.
----------------arch/arm/mach-exynos/mach-u1.c-----------------
-------------before(original code)----------------
#ifdef CONFIG_VIBETONZ
#ifdef CONFIG_TARGET_LOCALE_NTT
static struct max8997_motor_data max8997_motor = {
.max_timeout = 10000,
.duty = 43696,
.period = 44138,
.init_hw = NULL,
.motor_en = NULL,
.pwm_id = 1,
};
#elif defined(CONFIG_TARGET_LOCALE_KOR) || defined(CONFIG_TARGET_LOCALE_NA)
static struct max8997_motor_data max8997_motor = {
.max_timeout = 10000,
.duty = 44196,
.period = 44643,
.init_hw = NULL,
.motor_en = NULL,
.pwm_id = 1,
};
#elif defined(CONFIG_MACH_Q1_BD)
static struct max8997_motor_data max8997_motor = {
.max_timeout = 10000,
.duty = 37641,
.period = 38022,
.init_hw = motor_init_hw,
.motor_en = motor_en,
.pwm_id = 1,
};
#else
static struct max8997_motor_data max8997_motor = {
.max_timeout = 10000,
.duty = 37641,
.period = 38022,
.init_hw = NULL,
.motor_en = NULL,
.pwm_id = 1,
};
#endif
#endif
-------------after(code after change)----------------
#ifdef CONFIG_VIBETONZ
static struct max8997_motor_data max8997_motor = {
.max_timeout = 10000,
.duty = 44196,
.period = 44643,
.init_hw = NULL,
.motor_en = NULL,
.pwm_id = 1,
};
#endif
-----------------------------------------code end------------------------------------------------

[Q] How to convert extended ASCII character to number in Android?

Hi!
Can you help me, please? I'm working on an Android app. I get some characters from a file on the Internet and put it to a TextView. These characters are ASCII characters. Then I read these characters one by one and convert it to numbers with the following code:
Code:
char my_char2;
char my_char3;
int myNum = 0;
for (int k = 170; k < len; k++) {
if (c.charAt(k) == '0' && c.charAt(k+1) == '.') {
my_char2 = c.charAt(k+13);
my_char3 = c.charAt(k+14);
myNum = my_char2 * 256 + my_char3;
}
}
Then I write it to an another TextView:
Code:
crlNumber.setText("" + myNum);
The problem is that this can only convert standard ASCII characters(from 0 to 127) except of the new line character(character number 10), carriage return character(character number 13) and the cancel character(character number 24).
But I need to convert also the extended ASCII characters(from 128 to 255) and the 3 characters mentioned above.
What should I do?
Thanks for helping.
Do these help?
http://stackoverflow.com/questions/13826781/java-extended-ascii-table-usage
http://stackoverflow.com/questions/5535988/string-to-binary-and-vice-versa-extended-ascii
nikwen said:
Do these help?
http://stackoverflow.com/questions/13826781/java-extended-ascii-table-usage
http://stackoverflow.com/questions/5535988/string-to-binary-and-vice-versa-extended-ascii
Click to expand...
Click to collapse
A little. I have tried the following code below. It didn't show me the number of the extended ascii characters. But I think I should somehow read the text not as a String, but as a byte, and then I think, it should work(maybe I am wrong). If it is right, please, can you tell me, how should I do it?
Code:
final String textSource = "path to my file";
URL textUrl;
try {
textUrl = new URL(textSource);
BufferedReader bufferReader = new BufferedReader(
new InputStreamReader(textUrl.openStream()));
String StringBuffer;
String stringText = "";
while ((StringBuffer = bufferReader.readLine()) != null) {
stringText += StringBuffer;
}
bufferReader.close();
textMsg.setText(stringText);
String PT = textMsg.getText().toString();
CharSequence c = new String(PT);
String string0 = "";
String string1 = "";
char my_char2;
char my_char3;
String binary = "";
String binary2 = "";
int myNum2 = 0;
int decimalValue1 = 0;
int decimalValue2 = 0;
for (int k = 170; k < len; k++) {
if (c.charAt(k) == '0' && c.charAt(k+1) == '.') {
my_char2 = c.charAt(k+13);
my_char3 = c.charAt(k+14);
string0 = Character.toString(my_char2);
string1 = Character.toString(my_char3);
char[] buffer = string0.toCharArray();
byte[] b = new byte[buffer.length];
for (int i = 0; i < b.length; i++) {
b[i] = (byte) buffer[i];
binary = Integer,toBinaryString(b[i] & 0xFF);
decimalValue1 = Integer.parseInt(binary, 2);
}
char[] buffer2 = string1.toCharArray();
byte[] b2 = new byte[buffer2.length];
for (int i = 0; i < b2.length; i++) {
b2[i] = (byte) buffer2[i];
binary2 = Integer.toBinaryString(b2[i] & 0xFF);
decimalValue2 = Integer.parseInt(binary2, 2);
}
myNum2 = decimalValue1 * 256 + decimalValue2;
}
}
crlNumber.setText("" + binary2 + "," + decimalValue1 + "," + decimalValue2 + "," + myNum2);
}
adamhala007 said:
A little. I have tried the following code below. It didn't show me the number of the extended ascii characters. But I think I should somehow read the text not as a String, but as a byte, and then I think, it should work(maybe I am wrong). If it is right, please, can you tell me, how should I do it?
Code:
final String textSource = "path to my file";
URL textUrl;
try {
textUrl = new URL(textSource);
BufferedReader bufferReader = new BufferedReader(
new InputStreamReader(textUrl.openStream()));
String StringBuffer;
String stringText = "";
while ((StringBuffer = bufferReader.readLine()) != null) {
stringText += StringBuffer;
}
bufferReader.close();
textMsg.setText(stringText);
String PT = textMsg.getText().toString();
CharSequence c = new String(PT);
String string0 = "";
String string1 = "";
char my_char2;
char my_char3;
String binary = "";
String binary2 = "";
int myNum2 = 0;
int decimalValue1 = 0;
int decimalValue2 = 0;
for (int k = 170; k < len; k++) {
if (c.charAt(k) == '0' && c.charAt(k+1) == '.') {
my_char2 = c.charAt(k+13);
my_char3 = c.charAt(k+14);
string0 = Character.toString(my_char2);
string1 = Character.toString(my_char3);
char[] buffer = string0.toCharArray();
byte[] b = new byte[buffer.length];
for (int i = 0; i < b.length; i++) {
b[i] = (byte) buffer[i];
binary = Integer,toBinaryString(b[i] & 0xFF);
decimalValue1 = Integer.parseInt(binary, 2);
}
char[] buffer2 = string1.toCharArray();
byte[] b2 = new byte[buffer2.length];
for (int i = 0; i < b2.length; i++) {
b2[i] = (byte) buffer2[i];
binary2 = Integer.toBinaryString(b2[i] & 0xFF);
decimalValue2 = Integer.parseInt(binary2, 2);
}
myNum2 = decimalValue1 * 256 + decimalValue2;
}
}
crlNumber.setText("" + binary2 + "," + decimalValue1 + "," + decimalValue2 + "," + myNum2);
}
Click to expand...
Click to collapse
Hm, I don't know. According to this answer, you can change the encoding on the desktop, otherwise you will just see question marks.
But according to the accepted answer here, this should be done automatically on a Linux system. And Android is Linux based. Did you try it on an Android device or just on your computer?
Bytes shouldn't work. In Java they are signed, so their range is -128 ... 127.
nikwen said:
Hm, I don't know. According to this answer, you can change the encoding on the desktop, otherwise you will just see question marks.
But according to the accepted answer here, this should be done automatically on a Linux system. And Android is Linux based. Did you try it on an Android device or just on your computer?
Bytes shouldn't work. In Java they are signed, so their range is -128 ... 127.
Click to expand...
Click to collapse
Yes, I tried it on my Android device. Maybe, the best choice would be then to use that certificate code which you suggested me in one of my previous threads, but the problem is, that I am beginner in Android developing and I read it and I didn't know how to use it in my code. So I thougt, if I got the 2 ASCII characters and converted it to decimal numbers, it would also work. And it also works until I have the standard ASCII characters. When there is an extended ASCII character, it shows me the number 65533.
adamhala007 said:
Yes, I tried it on my Android device. Maybe, the best choice would be then to use that certificate code which you suggested me in one of my previous threads, but the problem is, that I am beginner in Android developing and I read it and I didn't know how to use it in my code. So I thougt, if I got the 2 ASCII characters and converted it to decimal numbers, it would also work. And it also works until I have the standard ASCII characters. When there is an extended ASCII character, it shows me the number 65533.
Click to expand...
Click to collapse
But I think I have found out something.
Code:
string0 = Character.toString(my_char2);
string1 = Character.toString(my_char3);
int one = 0;
int two = 0;
String ascii1="\u001f";
String ascii2="\u0018";
String aa = "";
String bb = "";
if(string0.equals(ascii1)){
one = one + 31;
aa = aa + one;
}else{
one = 1;
}
if(string1.equals(ascii2)){
two = two + 24;
bb = bb + two;
}else{
two = 1;
}
textPrompt.setText("" + aa + bb);
But this needs a little correction, because this way it doesn't show me anything, but if I write
Code:
textPrompt.setText("" + aa);
inside my first if statement it shows me correctly 31. What can be the mistake I have made?
convert ASCII character
I'm a self android learner. I want to convert ascii code to character. Here is the code I used.
String s = "1000001";
int num = Integer.parseInt(s, 2);
TextView textView = new TextView(this);
textView.setText(String.valueOf(num));
setContentView(textView);
Here s is 1000001(65 in decimal) 65 is ascii value of 'A'. I want to get 'A' in my output screen.variable num has the value 65. please help me

$response JSON return only 1 row, PHP, ANDROID

When I use json_encode($response), it returns only the first row of the query, how to make it return all the rows?
main.php
Code:
$email = $_POST['email'];
$password = $_POST['password'];
$user = $db->getUserByEmailAndPassword($email, $password);
if ($user != false ) {
// user found
$response["error"] = FALSE;
$response["user"]["name"] = $user["name"];
$response["user"]["email"] = $user["email"];
$response["user"]["dega"] = $user["dega"];
$response["user"]["salla"] = $user["salla"];
$response["user"]["ora"] = $user["ora"];
$response["user"]["lenda"] = $user["lenda"];
$response["user"]["dita"] = $user["dita"];
echo json_encode($response);
}
method.php
Code:
public function getUserByEmailAndPassword($email, $password) {
$result = mysql_query("SELECT U.name, U.email, U.password, F.dega,
O.salla, O.ora, O.lenda, O.dita FROM users U
INNER JOIN fakulteti F on U.id = F.studenti
INNER JOIN orari O on F.id = O.fakulteti WHERE email = '$email'") or die(mysql_error());
$no_of_rows = mysql_num_rows($result);
if ($no_of_rows > 0) {
$result = mysql_fetch_array($result);
$encrypted_password = $result['password']
if ($encrypted_password == $password) {
return $result;
}
}
}
Android class and this is how I recieve a response on my android:
Code:
JSONObject user = jObj.getJSONObject("user");
String name = user.getString("name");
String email = user.getString("email");
String dega = user.getString("dega");
String salla = user.getString("salla");
String ora = user.getString("ora");
String lenda = user.getString("lenda");
String dita = user.getString("dita");
bump!!!!

Kernel Build Question. [DEVELOPERS] Overclocking SM-G360T1 Stock Kernel

I'm completely new to the world of kernel building and everything. So after weeks of googling, reading, modifying, etc, I've managed to get the stock kernel of SM-G360T1. Now I've been looking on overclocking the kernel and am under the assumption that kernel max and min freq are in drivers/cpufreq/cpufreq_limit.c with it being defined on line 117. Am I correct in assuming that this is the correct one/area to modify or am I completely wrong. If so, guide me in the right direction.
Code:
struct cpufreq_limit_hmp hmp_param = {
.little_cpu_start = 4,
.little_cpu_end = 7,
.big_cpu_start = 0,
.big_cpu_end = 3,
.big_min_freq = 1036800,
.big_max_freq = 1497600,
.little_min_freq = 200000, // 400000 Khz
.little_max_freq = 556800, // 1113600 Khz
.little_min_lock = 400000, // 800000 Khz
.little_divider = 2,
.hmp_boost_type = 1,
.hmp_boost_active = 0,
};

Resources