Re: PilRC palette/bitmap troubles

2003-11-05 Thread Chris Apers
This problem occured if you have a blank line at the end
of your palette file. Just remove it.

- Original Message - 
From: Ted Peters [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 6:20 PM
Subject: PilRC palette/bitmap troubles


 I am trying to get 8bpp bitmaps with a custom palette to work in my
 application. I have searched archives and found what I thought were the
 answers, but still no success.

 I am using Macintosh CodeWarrior 8.3 with the Mac PilRC plugin version
 2.9p10b.

 I have created a .pal file that looks like this:

 255 255 255
 247 255 255
 239 255 255
 ...
 6 14 31
 9 10 12
 0 0 0

 with 256 entries, with a space at the end of each line.

 My .rcp file looks like this:

 PALETTE ID 1000 W.pal

 BITMAPFAMILYEX ID 1100
 BEGIN
 BITMAP frame_00_L01.BMP BPP 1 DENSITY 1
 BITMAP frame_00_L04.BMP BPP 4 COMPRESS DENSITY 1
 BITMAP frame_00_L08.BMP BPP 8 BITMAPPALETTE W.pal DENSITY 1
 BITMAP frame_00_H08.BMP BPP 8 BITMAPPALETTE W.pal DENSITY 2
 END

 I wind up with the two (low density and high density) 8bpp bitmaps solid
 black. I have tried with and without the COMPRESS keyword for those
 lines. Theose bitmaps appear solid black both when I use them in my
 app, and if I open the .prc with Constructor.

 Any help or suggestions would be greatly appreciated. Thanks in advance,

 Ted


 -- 
 For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: What is error (Sys 0505) (0, 1136)

2003-11-05 Thread Chris Apers
Me too, thanks :)

- Original Message - 
From: Hildinger, Robert [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 11:47 PM
Subject: Re: What is error (Sys 0505) (0, 1136)


 Guys,

 Thanks for the info! You really helped me solve my problem!

 -Robert



 -- 
 For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


all programs break on Tungsten (Palm OS 5.2.1)

2003-11-05 Thread Holger Klawitter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi there,

All of my applications suddenly seem to break on Palm OS 5.2.1 (Tungsten). As 
I don't have Windows I cannot try the Simulator to debug on my own.

On the other hand I've heard that there is a very common problem with 
applications crashing after the Tungesten has been turned off and on again. 
Can someone tell me what this issue is about and point me to a solution? 
(searches on Tungsten/5.2.1 did not succeed)

Mit freundlichem Gruß / With kind regards
Holger Klawitter
- --
[EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/qL3L1Xdt0HKSwgYRAtYqAJ9y/0eoKX4lwVaBlJCiAooF1k+eFgCfXl2r
8b8HsgmH1KXlwS997JQ/xlQ=
=UoYV
-END PGP SIGNATURE-


--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


CW 9.2 STL memory question.

2003-11-05 Thread Vytautas Leonavicius
Hello,

Well, MemPtrNew allocates a maximum of ~64Kb. But when I allocate
std::vector on the stack, I got bad_alloc if I try to allocate more than
~30Kb. But if I use new on vector, that is:

VecP p = new Vec[64k] it works, when allocating in this way - Vec v =
Vec[64k]. Why?

Thanks,

-- 
Sincerily,

Vytautas Leonavicius

http://sc-filip.vtu.lt/~vyts/



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: RGB-display

2003-11-05 Thread Anders Rahm-Nilzon
I'm sorry for not know this but what do you mean with that ???

Carsten [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 To make long explanations short:
 Little Endian.





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: RGB-display

2003-11-05 Thread Aaron Ardiri
 I'm sorry for not know this but what do you mean with that ???

m68k-- 0x1234  (bigendian)
x86/arm -- 0x3412  (little endian)

same number. different endian, based on the CPU mainly :)

http://www.hyperdictionary.com/computing/little-endian
http://www.hyperdictionary.com/computing/big-endian

---
Aaron Ardiri
[EMAIL PROTECTED]
http://www.mobilewizardry.com/members/aaron_ardiri.php [profile]

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Palm OS 3.5-en-colordbg.rom

2003-11-05 Thread Duc Dang


Hi all,
Help me please!

I have function keyDownEvent :
case keyDownEvent:
// Scroll down key presed?
if (gCurrentActPk-1){
if ((eventP-data.keyDown.chr == pageDownChr)  
(IsLast == true))
{
ScrollActRecord(1);//mode=0 : Previous; mode=1 
: Next
handled = true;
}
// Scroll up key presed?
else if ((eventP-data.keyDown.chr == pageUpChr)  
(IsFirst == true))
{
ScrollActRecord(0);//mode=0 : Previous; mode=1 
: Next
handled = true;
}
handled = true;
break;
}
break;
With :
Boolean ScrollActRecord(int mode)//mode=0 : Previous; mode=1 : Next
{
VoidHandrecordH;
Err err;
Boolean find=false;
ActRecordPtr cons;
ActRecPtr conRec;

DataOfA2Changed();
if (changeField ){
A2AskSave();
gEditMode = false;
changeField = false;
}

cons = (ActRecordPtr)MemHandleLock(ActsHandle);
for (int i=0; iNumActs;i++){
if (gCurrentIndex == 
cons[i].recordNum){
if (mode == 0)
gCurrentIndex = 
cons[--i].recordNum;
else if (mode == 1)
gCurrentIndex = 
cons[++i].recordNum;
checkNextPrevious(i);
find=true;
}
if (find == true)   break;
}
MemHandleUnlock(ActsHandle);
find = false;

if ((err = GetRecord(ActDB, gCurrentIndex, 
recordH)) != 0)
return false;
conRec = (ActRecPtr)MemHandleLock(recordH);
if (conRec) gCurrentActPk = conRec-act_pk;
MemHandleUnlock(recordH);
FrmGotoForm(A2Form);
return true;
}

I want to go ONE record when user click pageDownChr or pageUpChr button. But it go 
through over one, sometimes 2 or 3 record.
I use POSE with ROM : Palm OS 3.5-en-colordbg.rom.If I use others ROM, it work right.
Any idea? help me
Thanks,
Duc


--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: SSL certificates (again)

2003-11-05 Thread Philippe Fischer
Thanks Rajan,
I've just changed the return value of my callback to errNone and the
handshake passes through. I think I should read the manual more carefully
!!!


Best regards

Philippe

- Original Message - 
From: [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 6:05 AM
Subject: Re: SSL  certificates (again)


 Hi,

 Implement a verify callback and return errNone in it if you want to allow
 all certificate violations . You can look at the command and flavour
 parameters if you want to allow only select errors.Set this callback
 function to the context using the SslContextSet_verifyCallback macro.

 Hope this helps.

 regards,
 rajan



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: RGB-display

2003-11-05 Thread Anders Rahm-Nilzon
Thank you fpr your time !!!
 \Anders

Aaron Ardiri [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  I'm sorry for not know this but what do you mean with that ???

 m68k-- 0x1234  (bigendian)
 x86/arm -- 0x3412  (little endian)

 same number. different endian, based on the CPU mainly :)

 http://www.hyperdictionary.com/computing/little-endian
 http://www.hyperdictionary.com/computing/big-endian

 ---
 Aaron Ardiri
 [EMAIL PROTECTED]
 http://www.mobilewizardry.com/members/aaron_ardiri.php [profile]




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Palm OS 3.5-en-colordbg.rom

2003-11-05 Thread Vladimir
Hi to All Can samebody to help me 
I want to change system font to spanish font.
And use new font in DateBook.
Thanks to all.

Vladimir



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


System keyboard

2003-11-05 Thread Vladimir




 Hi to All Can samebody to help me
 I want to change system font to spanish font.
 And use new font in DateBook.
 Thanks to all.

 Vladimir



 --
 For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Nasty Breakpoint CW9.2 !!!!!!

2003-11-05 Thread Harish
Thx Ben,

 If you don't see anything that could go wrong here, then try removing your
 project's _Data folder (with the project closed) and rebuilding.

 Finally, if you're running with the Palm OS Emulator, make sure that it
 doesn't have any breakpoints set and saved in your PSF file.  The easiest
 way is to just create a new session.
- The problem is solved for Emulator (created new session)
   But for Simulator the behaviour is still same though i create new
sessions each time.

Regards
Harish



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Equivalents to standard C routines for PalmOS

2003-11-05 Thread Anders Rahm-Nilzon
Is there an equivalent C routine in Palm OS for:

fprintf
fscanf
sscanf
fgetc
fgets
fputs
fputs
fopen
freopen

 \Anders R-N



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


TxtFindString oddity

2003-11-05 Thread Matthias Jordan
Hi, folks!

I'm working on a device that has the International Feature Set present.
Now, when I call TxtFindString, the result code is always 0 and pos and
len contain arbitrary values. Even in the following cases:

TxtFindString(foobar, foo, pos, len)
TxtFindString(foobar, oba, pos, len)
TxtFindString(foo, foo, pos, len)
TxtFindString(oba, foobar, pos, len)

This is quite strange because the behaviour of this function is
advertised differently in the API documentation. What's going wrong here?

Matthias


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: How can i set the name of the plam used in hotsync ?

2003-11-05 Thread Alexandre Barreto
Thnx a lot for the help guys
the code in c fits perfect.. for what i need.. its just a backup action .. 
so its ok
thanx a lot again

_
MSN Hotmail, o maior webmail do Brasil.  http://www.hotmail.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


SOAP Library

2003-11-05 Thread Oscar De León
Hi all,
has anyone heard about a ready PRC library that handles the SOAP protocol
(Simple Object Access Protocol) available for Palm OS?

Regards
Oscar



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Determining processor frequency

2003-11-05 Thread vianna . mauricio
How do I determine the frequency of a processor (programatically)?

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Palm SDK

2003-11-05 Thread Mark Lenz

Since I should create a differenct directory for the SDK (sdk-5r3) does
anyone know how I can make Falch.net use the new SDK?

Mark Lenz
Software Engineer
Control Systems Group
Pierce Manufacturing, Inc.
(920) 832-3523
[EMAIL PROTECTED]


|-+---
| |   John Marshall   |
| |   [EMAIL PROTECTED]|
| |  |
| |   Sent by:|
| |   [EMAIL PROTECTED]|
| |   .palmos.com |
| |   |
| |   |
| |   10/18/2003 10:08 AM |
| |   Please respond to Palm |
| |   Developer Forum|
| |   |
|-+---
  
---|
  |
   |
  |   To:   Palm Developer Forum [EMAIL PROTECTED] 
  |
  |   cc:  
   |
  |   Subject:  Re: Palm SDK   
   |
  
---|




Mark Lenz [EMAIL PROTECTED] wrote:
 I went to the Palm Source website to see if there was an updated SDK.

Look again.  There is now a 5 R3 SDK there that includes PalmOSGlue etc
for prc-tools.

John

--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/






-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


int parameter not changing value

2003-11-05 Thread kshaff03
I am trying to parse a buffer that is read in from the serial port, and I
want to be
able to use this parsing function 3 times, to reduce my code size.  I pass
in the index of the buffer, and it increments as I parse the buffer.  Then I
call parse again
and it parses the buffer from where the first call left off.  The parse
function also has a size parameter.  The problem that I am having, is when I
call Parse() the second, or third time, the variable size inside the
parse() function remains 5, instead of being 31, and then 34.

Why is this?



//Defines
#define CODE_SIZE  5
#define NAME_SIZE  31
#define ADDRESS_SIZE 34

//in main
code = Parse(buffer, index, CODE_SIZE);
name = Parse(buffer, index, NAME_SIZE);
address = Parse(buffer, index, ADDRESS_SIZE);
setMainFields(code, name, address);

//my parsing function, parses a buffer that comes in through the serial port
char* Parse(char* buffer,  UInt *buffIndex, UInt size)
{
 CharPtr string;
 char* tempBuffer;
 char delimeter = '%';
 Handle htempBuffer;

 UInt16 tempIndex;

 htempBuffer = MemHandleNew(size);
 MemHandleResize(htext, size);

 tempBuffer = MemHandleLock(htempBuffer);
 string = MemHandleLock(htext);

 tempIndex = 0;

 //check to see if character is the delimeter
 while(buffer[*buffIndex] != delimeter)
 {
  tempBuffer[tempIndex] = buffer[*buffIndex];
  *buffIndex = *buffIndex + 1;
  tempIndex++;
 }

 //add NULL character to end of buffer
 tempBuffer[tempIndex-1] = chrNull;
 StrCopy(string, tempBuffer);
 *buffIndex = *buffIndex + 1;

 MemHandleUnlock(htempBuffer);


 return string;

}



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Looping optimization

2003-11-05 Thread Anders Rahm-Nilzon
You should be careful with the division operator. Instead of dividing with
87 all times in the for-loop you get the same result if you divide result
after the loop with 87.

 for (j = 0; j  2; j++)
 {
  result += (j + 19 * 71 + (j + 35 + 28)) ;
 }
result = result/87;


Picco Chu [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I am not familiar with the Palm architecture. But I have a very
 head-scratching problem on how to do fast loops.

 I need to do some simple operations (+ - * / only) in a loop for around
 2 times. The speed on DragonBall 33MHz devices are too slow! I don't
 know if I have done something wrong when I compile / link it or the code
 itself is not optimized.

 To simplify my problem, I have greatly reduce the problem to this:

UInt32 i,j;
UInt32 result=0;

 Case 1 - All Int operation.

 for (j = 0; j  2; j++) {
  result += (j + 19 * 71 + (j + 35 + 28)) / 87;
 }

 On a certain POSE, it took 35 clock ticks to finish.

 Case 2 - One operation involves floating pt. (71 changed to 71.0f)

 for (j = 0; j  2; j++) {
  result += (j + 19 * 71.0f + (j + 35 + 28)) / 87;
 }

 On the same POSE, it took 932 clock ticks to finish. A 30 TIMES
difference!!

 I am using CW9 creating a C++ application with setting Optimized for
faster
 execution speed and Optimization Level 4 (Don't know if there is any
help
 using these setting anyway)

 If All Integer operation is faster I can use no floating point
 operation. But still the speed is too slow. So is there any tips or
 tricks on how to optimize coding in loops? There will be only + - * / and
 array look-up (i.e. result = my_array[i]) in the loop.

 Any help will be very much appreciated!



 Here is the full segment of code:

char strt[100];
UInt32 i,j;
UInt32 result=0;

UInt32 e_tick;
UInt32 s_tick = TimGetTicks();

 for (j = 0; j  2; j++) {
  result += (j + 19 * 71.0f + (j + 35 + 28)) / 87;
 }

e_tick = TimGetTicks();

StrPrintF(strt, result: %lu,result);
WinDrawChars(strt, StrLen(strt), 10, 50);
StrPrintF(strt, tick: %lu,e_tick - s_tick);
WinDrawChars(strt, StrLen(strt), 10, 70);

 Desperately
 Picco







-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Looping optimization

2003-11-05 Thread Picco Chu
Oh yes~ Thanks for pointing out.

But this is not where the problem lies...

Anders Rahm-Nilzon [EMAIL PROTECTED] ¼¶¼g©ó¶l¥ó·s»D
:[EMAIL PROTECTED]
 You should be careful with the division operator. Instead of dividing with
 87 all times in the for-loop you get the same result if you divide
result
 after the loop with 87.

  for (j = 0; j  2; j++)
  {
   result += (j + 19 * 71 + (j + 35 + 28)) ;
  }
 result = result/87;


 Picco Chu [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  I am not familiar with the Palm architecture. But I have a very
  head-scratching problem on how to do fast loops.
 
  I need to do some simple operations (+ - * / only) in a loop for around
  2 times. The speed on DragonBall 33MHz devices are too slow! I don't
  know if I have done something wrong when I compile / link it or the code
  itself is not optimized.
 
  To simplify my problem, I have greatly reduce the problem to this:
 
 UInt32 i,j;
 UInt32 result=0;
 
  Case 1 - All Int operation.
 
  for (j = 0; j  2; j++) {
   result += (j + 19 * 71 + (j + 35 + 28)) / 87;
  }
 
  On a certain POSE, it took 35 clock ticks to finish.
 
  Case 2 - One operation involves floating pt. (71 changed to 71.0f)
 
  for (j = 0; j  2; j++) {
   result += (j + 19 * 71.0f + (j + 35 + 28)) / 87;
  }
 
  On the same POSE, it took 932 clock ticks to finish. A 30 TIMES
 difference!!
 
  I am using CW9 creating a C++ application with setting Optimized for
 faster
  execution speed and Optimization Level 4 (Don't know if there is any
 help
  using these setting anyway)
 
  If All Integer operation is faster I can use no floating point
  operation. But still the speed is too slow. So is there any tips or
  tricks on how to optimize coding in loops? There will be only + - * /
and
  array look-up (i.e. result = my_array[i]) in the loop.
 
  Any help will be very much appreciated!
 
 
 
  Here is the full segment of code:
 
 char strt[100];
 UInt32 i,j;
 UInt32 result=0;
 
 UInt32 e_tick;
 UInt32 s_tick = TimGetTicks();
 
  for (j = 0; j  2; j++) {
   result += (j + 19 * 71.0f + (j + 35 + 28)) / 87;
  }
 
 e_tick = TimGetTicks();
 
 StrPrintF(strt, result: %lu,result);
 WinDrawChars(strt, StrLen(strt), 10, 50);
 StrPrintF(strt, tick: %lu,e_tick - s_tick);
 WinDrawChars(strt, StrLen(strt), 10, 70);
 
  Desperately
  Picco
 
 
 
 






-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Looping optimization

2003-11-05 Thread Markus Dresch
floating point is always slow... and divide is always slow too.
multiplying is slower than adding and subtracting.

just search google for c optimization and you'll find a lot of useful hints.

(in your code for example you multiply 19 * 71 2 times when you only
need to to it once before the loop)

markus dresch (www.palmside.com)


Picco Chu [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
 Oh yes~ Thanks for pointing out.

 But this is not where the problem lies...

 Anders Rahm-Nilzon [EMAIL PROTECTED] ¼¶¼g©ó¶l¥ó·s»D
 :[EMAIL PROTECTED]
  You should be careful with the division operator. Instead of dividing
with
  87 all times in the for-loop you get the same result if you divide
 result
  after the loop with 87.
 
   for (j = 0; j  2; j++)
   {
result += (j + 19 * 71 + (j + 35 + 28)) ;
   }
  result = result/87;
 
 
  Picco Chu [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
   I am not familiar with the Palm architecture. But I have a very
   head-scratching problem on how to do fast loops.
  
   I need to do some simple operations (+ - * / only) in a loop for
around
   2 times. The speed on DragonBall 33MHz devices are too slow! I
don't
   know if I have done something wrong when I compile / link it or the
code
   itself is not optimized.
  
   To simplify my problem, I have greatly reduce the problem to this:
  
  UInt32 i,j;
  UInt32 result=0;
  
   Case 1 - All Int operation.
  
   for (j = 0; j  2; j++) {
result += (j + 19 * 71 + (j + 35 + 28)) / 87;
   }
  
   On a certain POSE, it took 35 clock ticks to finish.
  
   Case 2 - One operation involves floating pt. (71 changed to 71.0f)
  
   for (j = 0; j  2; j++) {
result += (j + 19 * 71.0f + (j + 35 + 28)) / 87;
   }
  
   On the same POSE, it took 932 clock ticks to finish. A 30 TIMES
  difference!!
  
   I am using CW9 creating a C++ application with setting Optimized for
  faster
   execution speed and Optimization Level 4 (Don't know if there is
any
  help
   using these setting anyway)
  
   If All Integer operation is faster I can use no floating point
   operation. But still the speed is too slow. So is there any tips
or
   tricks on how to optimize coding in loops? There will be only + - * /
 and
   array look-up (i.e. result = my_array[i]) in the loop.
  
   Any help will be very much appreciated!
  
  
  
   Here is the full segment of code:
  
  char strt[100];
  UInt32 i,j;
  UInt32 result=0;
  
  UInt32 e_tick;
  UInt32 s_tick = TimGetTicks();
  
   for (j = 0; j  2; j++) {
result += (j + 19 * 71.0f + (j + 35 + 28)) / 87;
   }
  
  e_tick = TimGetTicks();
  
  StrPrintF(strt, result: %lu,result);
  WinDrawChars(strt, StrLen(strt), 10, 50);
  StrPrintF(strt, tick: %lu,e_tick - s_tick);
  WinDrawChars(strt, StrLen(strt), 10, 70);
  
   Desperately
   Picco
  
  
  
  
 
 
 






-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Looping optimization

2003-11-05 Thread Axel Bernard
Picco Chu wrote:
I am not familiar with the Palm architecture. But I have a very
head-scratching problem on how to do fast loops.
I need to do some simple operations (+ - * / only) in a loop for around
2 times. The speed on DragonBall 33MHz devices are too slow! I don't
know if I have done something wrong when I compile / link it or the code
itself is not optimized.
To simplify my problem, I have greatly reduce the problem to this:

   UInt32 i,j;
   UInt32 result=0;
Case 1 - All Int operation.

for (j = 0; j  2; j++) {
 result += (j + 19 * 71 + (j + 35 + 28)) / 87;
}
On a certain POSE, it took 35 clock ticks to finish.

Case 2 - One operation involves floating pt. (71 changed to 71.0f)

for (j = 0; j  2; j++) {
 result += (j + 19 * 71.0f + (j + 35 + 28)) / 87;
}
On the same POSE, it took 932 clock ticks to finish. A 30 TIMES difference!!

I am using CW9 creating a C++ application with setting Optimized for faster
execution speed and Optimization Level 4 (Don't know if there is any help
using these setting anyway)
If All Integer operation is faster I can use no floating point
operation. But still the speed is too slow. So is there any tips or
tricks on how to optimize coding in loops? There will be only + - * / and
array look-up (i.e. result = my_array[i]) in the loop.
Any help will be very much appreciated!



Here is the full segment of code:

   char strt[100];
   UInt32 i,j;
   UInt32 result=0;
   UInt32 e_tick;
   UInt32 s_tick = TimGetTicks();
for (j = 0; j  2; j++) {
 result += (j + 19 * 71.0f + (j + 35 + 28)) / 87;
}
   e_tick = TimGetTicks();

   StrPrintF(strt, result: %lu,result);
   WinDrawChars(strt, StrLen(strt), 10, 50);
   StrPrintF(strt, tick: %lu,e_tick - s_tick);
   WinDrawChars(strt, StrLen(strt), 10, 70);
Desperately
Picco



By the way, if the prog below is really intended to be used, just 
replace the for loop with this line,

 #define LOOPS   2UL
 result =  (LOOPS*(LOOPS+1UL) + (LOOPS+1UL) * 1412UL) / 87UL;
 and your program will be much quicker ;-)

 ( based on   Sum(j=1 to n) = n(n+1)/2 )



--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Looping optimization

2003-11-05 Thread Hildinger, Robert

Picco Chu [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I am not familiar with the Palm architecture. But I have a very
 head-scratching problem on how to do fast loops.

 I need to do some simple operations (+ - * / only) in a loop for around
 2 times. The speed on DragonBall 33MHz devices are too slow! I don't
 know if I have done something wrong when I compile / link it or the code
 itself is not optimized.


Major piece of advice: Become as familiar as you can with 68K assembly and
the built in disassembler within Codewarrior - doins so will help you
immensely in loop optimization. Also, POSE is great for functional testing,
but is not an accurate guage for loop optimization. There are too many
places where real 68K architecture has different delay characteristics than
POSE. Use the real hardware if at all possible.

Some general hints with regard to 68K architecture:

In most if not all cases the use of 32 bit integers causes a performance
penalty over the use of 8 or 16 bit integers, so use smaller integer types
where possible.

As others have said, multiplication and division have horrible performance
penalties, so use them sparingly and optimize them out of the loop if
possible. If you must use them, take a look at the disassembler output for
the multiplication and division instructions. The 68K instruction set
includes instructions for 16 bit x 16 bit multiplication and division, so
make sure your particular instances fit with the 68K instruction set,
otherwise the compiler will inline a software multiplication or division
that is much slower.

Again, as I said before, analyse the disassembler output. This will help you
optimize the loop.

-Robert



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: TxtFindString oddity

2003-11-05 Thread Dave Lasker
The 2nd parameter to TxtFindString must be a prepared string. You need to
run TxtGluePrepFindString on it before passing it to TxtFindString. Or if
you are implementing the system find command, use the strToFind field. See
the API doc for more info...

Dave

Matthias Jordan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi, folks!

 I'm working on a device that has the International Feature Set present.
 Now, when I call TxtFindString, the result code is always 0 and pos and
 len contain arbitrary values. Even in the following cases:

 TxtFindString(foobar, foo, pos, len)
 TxtFindString(foobar, oba, pos, len)
 TxtFindString(foo, foo, pos, len)
 TxtFindString(oba, foobar, pos, len)

 This is quite strange because the behaviour of this function is
 advertised differently in the API documentation. What's going wrong here?

 Matthias





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: SOAP Library

2003-11-05 Thread Tony Yat-Tung Cheung
Oscar De León wrote:
Hi all,
has anyone heard about a ready PRC library that handles the SOAP protocol
(Simple Object Access Protocol) available for Palm OS?
Regards
Oscar


You may want to take a look at the Web Services Toolkit, by IBM  PalmSource
http://www.palmos.com/dev/tech/webservices/
If you have joined the PalmSource's Developer program, it is available 
in the Development Seeding Area for trial.

Regards,
Tony Cheung




--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Debugger for armlets ?

2003-11-05 Thread Francis Picard


Hi all, 

We develop applications for Palm with prc-tools and we'd like to start
making armlets. 

In prc-tools for windows, there is a arm-palmos-*.exe for almost every
m68k-palmos-*.exe, but there is no arm-palmos-gdb.exe. 

Does that mean we can't debug armlets with gdb ? 
If not, is there other palm debuggers working with armlets ?

Thank you, 
Francis Picard


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


RE: SOAP library

2003-11-05 Thread Tom Frauenhofer
Actually, this includes both Java and C (gSoap-based) implementations.  IBM 
and PalmSource have since partnered to make this available for Palm OS 
developers.

An even better link for all of this: 
http://www.palmos.com/dev/tech/webservices/

At 03:00 AM 11/5/2003, Keith Rollin [EMAIL PROTECTED]wrote:
Tom Frauenhofer recommended Web Services Tool=20
Kit for Mobile Devices in a thread back in May:
http://www.alphaworks.ibm.com/tech/wstkmd

However, this is in Java.  In the same thread,=20
SebastianM pointed out that for SOAP, all you=20
need is an HTTP layer, an XML library, and a SOAP=20
parser -- and that the first two were already=20
around on the Web.

Tom Frauenhofer, [EMAIL PROTECTED]
http://www.beret.com 



--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: TxtFindString oddity

2003-11-05 Thread Matthias Jordan
Hey, folks!

Dave Lasker wrote:

 The 2nd parameter to TxtFindString must be a prepared string. You need to

I don't know how this could happen but I must have overlooked it. I read
this API doc a couple of times very precise (haha) and just missed it.
Now it works. Thanks for your prompt help.

Bye!

Matthias


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Serial device stopped working on T3?

2003-11-05 Thread Mike
All this seems to do is turn off the RTS signal.  It does nothing to stop
the CTS from inhibiting data transmission regardless of the flags.  The Palm
still sits there until the CTS is asserted.

Any more secrets you'd like to share? :c)

-Mike




Sabeen Cochinwala [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

Try using the following to turn off RTS and see if it disables HW
handshaking.

SrmControl(portID, srmCtlCustomDisableRTS, NULL, NULL);

#define srmCtlCustomDisableRTS 0x8001 //- Make RTS inactive.
#define srmCtlCustomEnableRTS  0x8002 //- Make RTS active.

Regards,
Sabeen

-Original Message-
From: Wayne Hortensius [mailto:[EMAIL PROTECTED]
Sent: Monday, November 03, 2003 10:44 AM
To: Palm Developer Forum
Subject: Re: Serial device stopped working on T3?


At 10:08 AM 11/3/03 -0800, Dave Johnson [EMAIL PROTECTED] wrote:
We have a mature hardware product that connects to the Palm via serial
through the cradle port (universal connector). It works just fine on every
Palm we've tried except for our new Tungsten T3.

Have you tried looping RTS to CTS? I've seen several messages regarding
problems with not being able to turn off hardware handshaking on the T3.

Wayne


-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Debugger for armlets ?

2003-11-05 Thread Ben Combee
At 10:39 AM 11/5/2003, Francis Picard wrote:
We develop applications for Palm with prc-tools and we'd like to start
making armlets.
In prc-tools for windows, there is a arm-palmos-*.exe for almost every
m68k-palmos-*.exe, but there is no arm-palmos-gdb.exe.
Does that mean we can't debug armlets with gdb ?
If not, is there other palm debuggers working with armlets ?
The FAST toolkit from PalmSource supports debugging PACE Native Objects 
using the Palm OS Debugger on Windows.  You need a toolset that can produce 
DWARF 2 debugger output, such as CodeWarrior for Palm OS V9.2.  It's 
available in the PalmSource developer seeding section.

--
Ben Combee [EMAIL PROTECTED]
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: CW 9.2 STL memory question.

2003-11-05 Thread Ben Combee
At 03:12 AM 11/5/2003, Vytautas Leonavicius wrote:
Hello,

Well, MemPtrNew allocates a maximum of ~64Kb. But when I allocate
std::vector on the stack, I got bad_alloc if I try to allocate more than
~30Kb. But if I use new on vector, that is:
The stack on Palm OS apps is limited to around 4K.

VecP p = new Vec[64k] it works, when allocating in this way - Vec v =
Vec[64k]. Why?
The vector implementation in MSL doesn't allocate memory until an element 
has been modified or accessed.  This is for efficiency -- you can create a 
vector and if you don't use it, you don't have the allocation overhead.

--
Ben Combee [EMAIL PROTECTED]
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: PilRC palette/bitmap troubles

2003-11-05 Thread Ted Peters
Chris,

thanks for the reply.

Unfortunately, there was no blank line at the end of my palette file.

I tried removing the trailing space on the last line, and tired adding 
a blank line, just for grins. In all three cases, I get solid black 
bitmaps.

Does anyone have any other ideas or suggestions? I'm getting desperate!

Thanks,

Ted

On Wednesday, November 5, 2003, at 12:22  AM, Chris Apers wrote:

This problem occured if you have a blank line at the end
of your palette file. Just remove it.
- Original Message -
From: Ted Peters [EMAIL PROTECTED]
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 6:20 PM
Subject: PilRC palette/bitmap troubles

I am trying to get 8bpp bitmaps with a custom palette to work in my
application. I have searched archives and found what I thought were 
the
answers, but still no success.

I am using Macintosh CodeWarrior 8.3 with the Mac PilRC plugin version
2.9p10b.
I have created a .pal file that looks like this:

255 255 255
247 255 255
239 255 255
...
6 14 31
9 10 12
0 0 0
with 256 entries, with a space at the end of each line.

My .rcp file looks like this:

PALETTE ID 1000 W.pal

BITMAPFAMILYEX ID 1100
BEGIN
BITMAP frame_00_L01.BMP BPP 1 DENSITY 1
BITMAP frame_00_L04.BMP BPP 4 COMPRESS DENSITY 1
BITMAP frame_00_L08.BMP BPP 8 BITMAPPALETTE W.pal DENSITY 1
BITMAP frame_00_H08.BMP BPP 8 BITMAPPALETTE W.pal DENSITY 2
END
I wind up with the two (low density and high density) 8bpp bitmaps 
solid
black. I have tried with and without the COMPRESS keyword for those
lines. Theose bitmaps appear solid black both when I use them in my
app, and if I open the .prc with Constructor.

Any help or suggestions would be greatly appreciated. Thanks in 
advance,

Ted


--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: int parameter not changing value

2003-11-05 Thread Kevin Shaffer
I found another flaw with this code.  Please disregard.  Thanks

Kevin

kshaff03 [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I am trying to parse a buffer that is read in from the serial port, and I
 want to be
 able to use this parsing function 3 times, to reduce my code size.  I pass
 in the index of the buffer, and it increments as I parse the buffer.  Then
I
 call parse again
 and it parses the buffer from where the first call left off.  The parse
 function also has a size parameter.  The problem that I am having, is when
I
 call Parse() the second, or third time, the variable size inside the
 parse() function remains 5, instead of being 31, and then 34.

 Why is this?



 //Defines
 #define CODE_SIZE  5
 #define NAME_SIZE  31
 #define ADDRESS_SIZE 34

 //in main
 code = Parse(buffer, index, CODE_SIZE);
 name = Parse(buffer, index, NAME_SIZE);
 address = Parse(buffer, index, ADDRESS_SIZE);
 setMainFields(code, name, address);

 //my parsing function, parses a buffer that comes in through the serial
port
 char* Parse(char* buffer,  UInt *buffIndex, UInt size)
 {
  CharPtr string;
  char* tempBuffer;
  char delimeter = '%';
  Handle htempBuffer;

  UInt16 tempIndex;

  htempBuffer = MemHandleNew(size);
  MemHandleResize(htext, size);

  tempBuffer = MemHandleLock(htempBuffer);
  string = MemHandleLock(htext);

  tempIndex = 0;

  //check to see if character is the delimeter
  while(buffer[*buffIndex] != delimeter)
  {
   tempBuffer[tempIndex] = buffer[*buffIndex];
   *buffIndex = *buffIndex + 1;
   tempIndex++;
  }

  //add NULL character to end of buffer
  tempBuffer[tempIndex-1] = chrNull;
  StrCopy(string, tempBuffer);
  *buffIndex = *buffIndex + 1;

  MemHandleUnlock(htempBuffer);


  return string;

 }






-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


underclock Tungsten T

2003-11-05 Thread Alvin Chin
Is there a Palm application where you can underclock the Tungsten T?  I've
found some to overclock/underclock a Tungsten C and T3, basically for the
OS5 XScale CPUs, and there are some for the old DragonBall CPUs.

Thanks.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


RE: Looping optimization

2003-11-05 Thread Blake Winton
 Picco Chu wrote:
  I am not familiar with the Palm architecture. But I have a very
  head-scratching problem on how to do fast loops.
  
  for (j = 0; j  2; j++) {
   result += (j + 19 * 71 + (j + 35 + 28)) / 87;
  }

 By the way, if the prog below is really intended to be used, just 
 replace the for loop with this line,
 
   #define LOOPS   2UL
   result =  (LOOPS*(LOOPS+1UL) + (LOOPS+1UL) * 1412UL) / 87UL;
 
   and your program will be much quicker ;-)
   ( based on   Sum(j=1 to n) = n(n+1)/2 )

And this is far and away the best advice I've seen in this whole
thread.  It's so much more useful that I think it bears repeating:

Optimize on the algorithmic scale before you start fiddling on
the statement level.

Current compilers can (and should) do all the things suggested
by the other people in their optimization phase, but no compiler
that I've used will get rid of the for-loop entirely, and that
solution is far, far faster than the for-loop will ever be.

(Okay, compiler people, now it's your turn to tell me about a
 compiler that will get rid of for loops.  Perhaps one of the
 more recent FORTRAN compilers?)

Later,
Blake.


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Palm OS SDK (68K) R3 and cw7

2003-11-05 Thread Amy Chen
Hi All,
I'm using CodeWarrior7.
Yesterday I downloaded Palm OS SDK 5 (68k) R3 .
Today I get Operating System Error 2. Unable to create new project. No such
file. when trying to create a new project.
Don't know what I'm missing.

THANKS!


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


RE: Looping optimization

2003-11-05 Thread Ben Combee

(Okay, compiler people, now it's your turn to tell me about a
 compiler that will get rid of for loops.  Perhaps one of the
 more recent FORTRAN compilers?)
If you unroll your loop enough, CW can actually get rid of it... of course, 
it requires unrolling it such that you end up generating inline code for 
every iteration :)  That only really works for counting loop too.  I've 
seen some cases where loop strength reduction ended up pulling everything 
out of a loop, but that's pretty rare.

--
Ben Combee [EMAIL PROTECTED]
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


FrmGetNumberOfObjects

2003-11-05 Thread Dennis Chistopher
I wrote some debugging code to look at the objects on a form
and ran into this problem: fatal alert object #0 not found on form.
I am using palmOS40-eng-colordbg.rom in the Emulator. Have
also tried a 41 rom with the same result.
This problem initially came up on a form in which I created some
gadgets dynamically, but now I move the code to a form that
has plain old buttons and works fine, and still get the alert.
in the following frmP is returned from frmGetActiveForm().

UInt16 numObjs = FrmGetNumberOfObjects(frmP);
for (UInt16 i = 0; i  numObjs; i++)
{
theIndex = FrmGetObjectIndex(frmP, i);
theID = FrmGetObjectId(frmP, theIndex);
theType = FrmGetObjectType(frmP, theIndex);
}
Dennis Christopher

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: FrmGetNumberOfObjects

2003-11-05 Thread Ben Combee
At 01:42 PM 11/5/2003, Dennis Chistopher wrote:
in the following frmP is returned from frmGetActiveForm().

UInt16 numObjs = FrmGetNumberOfObjects(frmP);
for (UInt16 i = 0; i  numObjs; i++)
{
theIndex = FrmGetObjectIndex(frmP, i);
theID = FrmGetObjectId(frmP, theIndex);
theType = FrmGetObjectType(frmP, theIndex);
}
Shouldn't you be writing:

theID = FrmGetObjectId(frmP, i);
theIndex = FrmGetObjectIndex(frmP, theID);
It looks like you've got those reversed.

--
Ben Combee [EMAIL PROTECTED]
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Debugger for armlets ?

2003-11-05 Thread Carsten


Get some nice GBA emulator..  most of them come with a fine debugging 
interface.

ahh.. and some GBA emus are even open source.

Carsten.

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


RE: SOAP library

2003-11-05 Thread SebastianM
During next week we will be posting our XML parser. It's a real XML parser,
not just a wrapper for a specific Web Service.

Combined with HTTP, you will be able access any Web Service, dinamically. We
will also post some examples using it with som tipical Web Services. I'll
keep the forum posted.

Thanks,

SebastianM
PDADevelopers.com
Visit us at http://www.pdadevelopers.com


|-Original Message-
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED] Behalf Of Keith
|Rollin
|Sent: Wednesday, November 05, 2003 1:59 AM
|To: Palm Developer Forum
|Subject: RE: SOAP library
|
|
|Tom Frauenhofer recommended Web Services Tool
|Kit for Mobile Devices in a thread back in May:
|
|http://www.alphaworks.ibm.com/tech/wstkmd
|
|However, this is in Java.  In the same thread,
|SebastianM pointed out that for SOAP, all you
|need is an HTTP layer, an XML library, and a SOAP
|parser -- and that the first two were already
|around on the Web.
|
|SebastianM appears to be a member of
|http://www.pdadevelopers.com, whose home page
|advertises HTTP and (coming soon) SOAP solutions
|for the Palm.
|
|-- Keith
|
|
|At 8:49 PM -0800 11/4/03, Russell G. Wells wrote:
|Oscar,
|
|Try the gSOAP project from IBM.  This is a port of the open source gSOAP
|project to the Palm OS.  Look at this link
|http://xml.coverpages.org/ni2002-11-18-a.html
|
|Russell
|
|
|-Original Message-
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED] Behalf Of Oscar
|De León
|Sent: Tuesday, November 04, 2003 20:31
|To: Palm Developer Forum
|Subject: SOAP library
|
|
|Hi,
|has anyone heard about a library that handles the SOAP protocol (Simple
|Object Access Protocol) available for Palm OS?
|
|Regards
|Oscar
|
|--
|For information on using the Palm Developer Forums, or to
|unsubscribe, please see http://www.palmos.com/dev/support/forums/
|


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


App to view pending alarms?

2003-11-05 Thread Peter Easton
Hi,

I seem to remember that there is an app that lists all pending alarms for all
applications.  Does anyone know what the app is called, and where I can get it
from?

Thanks,

Peter



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


System Traps

2003-11-05 Thread Alvin Chin
How can I figure out what parameters (if any) are needed for the system
traps available under the CoreTraps list?




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: System Traps

2003-11-05 Thread Ben Combee
At 02:41 PM 11/5/2003, Alvin Chin wrote:
How can I figure out what parameters (if any) are needed for the system
traps available under the CoreTraps list?
Look for the API prototype in the public headers that uses that trap 
value.  Some routines are system-use-only and aren't documented in public 
SDK sources.  Calling those traps should be avoided unless you really know 
what you are doing.

--
Ben Combee [EMAIL PROTECTED]
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com 

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


How to draw bitmap on gadget when it hangs out of bounds?

2003-11-05 Thread Kerry Twibell
I am drawing a bitmap on a gadget. 

When the bitmap is drawn to the gadget (using
WinDrawBitmap), its coordinates are generated
dynamically, and it may hang below the bottom bounds
of the gadget. 

How do I only draw the portion of the bitmap that will
fit within the gadget bounds? 

I thought about drawing the bitmap to an offscreen
window rectangle, then copy the rectangle to the
active window. But, I cannot call
WinCreateBitmapWindow to draw the bitmap to an
offscreen window because I am writing this application
for OS 3.0. I must use functions compatible with 3.0.

Would anyone have suggestions? 

Thanks in advance, 
Kerry Twibell

__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Using the Serial manager for USB

2003-11-05 Thread Lance Gregory
The palm documentation for using the serial manager for USB is very
sparse. I can open a serial port, but every time I try to send data
through that port I get a time out error. In the SrmExtOpen call there
is a SrmOpenConfigType struct that has a drvrDataP for specific data
about the driver. I suspect my calls might not be working due to the
fact that I am opening the port with this value as NULL. What should go
here?

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: SrmReceiveCheck Workaround

2003-11-05 Thread Mike
After you posted, this is exactly what I did.

I am amazed!  All I did was change the serPortCradlePort to
sysFileCVirtRfComm when I open the port and the thing basically connected
right up to the Bluetooth to RS232 dev kit I bought
(http://www.smartm.com/product/c_mini_devkit.cfm   Now thats connectivity!

Unfortunately, the BT to RS232 module doesn't support the baud rate I need
(non standard) so I cant test it full speed to test latency. I have to run
it connected to a simulator I wrote in VB, which runs slow.  I'm waiting to
hear back from the manufacture to see if the baud rate can be changed.

Thanks!
-Mike




Peter Easton [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi Mike,

 Does BT on the Palm not have the buffer delay bug?
 No, the BT radio forwards packets to the Palm BT stack as soon as it
receives
 them.  The Palm can ACK packets in less than 1 ms, and respond to inbound
 packets in less than 2ms.  In addition, Bluetooth offers higher bandwidth
(up
 to 723 Kbps) than RS-232.

 As a cheap experiment, it might be worth getting a RS-232 -- Bluetooth
 adapter and connecting it to your hardware, then make a small change in
your
 app to use the Bluetooth RFCOMM virtual serial driver.  You use the driver
like
 any other serial port; use the SrmOpen or SrmExtOpen calls to open it and
the
 Srm calls to send/receive data and close the port.

 Unfortunately, you need to poll the BT serial driver for inbound data
 (SrmReceiveCheck).  If you call the BT library directly you receive a
 notification of inbound data so you don't need to poll and you get your
data
 immediately.  Of course, this is a lot more work, but you have some sample
code
 like BtLibTest and BtPiconet which don't do exactly what you want but
provide a
 good starting point.  For the RFCOMM virtual driver, take a look at the
 BtCommVdrvr.h file in the OS 5 R3 SDK.

 I have two freeware apps: BtSerial which uses the Srm calls and polls for
data
 and BtSerial Pro which uses the Bluetooth library directly and receives
data
 the instant it is available.

 I haven't done any work to verify the latency over Bluetooth.  I'd be
 interested in knowing if it meets the theoretical figures mentioned above.
 With a bit of work I could run some Palm-to-Palm tests.  Unfortunately I
can't
 use my BtServer app since it polls for inbound data; I'd have to create
 BtServer Pro which will use the BT lib directly.

 Regards,

 Peter

 http://www.whizoo.com
 Contractor for hire (PalmSource Certified Developer)
 Source code available for all apps!!
 BtSerial Pro - Serial Port Client for the Palm OS
 BtSerial - Bluetooth Serial Port Client for the Palm OS
 BtServer - Bluetooth Serial Port Server for the Palm OS
 Net Sync - Programmatically manipulate network settings
 RegCode - Add registration code support to your app






-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Tungsten E Native App Data Structure

2003-11-05 Thread Harry Cantrell
Does anyone know what the Contacts and Calendar data structures are, or how
to find out? We are trying to read and write the data with a Conduit.

Harry Cantrell



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Palm String Compressing/Uncompressing

2003-11-05 Thread Régis Daniel de Oliveira
Hy all!

Does anybody know a library that i can use to compress/decompress strings in
PalmOS?

My server app (developed using VB - so, the lib should have a dll that will
be used to compress the string on the server and, then, send it to the palm)
will need to compress the string, send it to the palm and palm should
decompress it.

Thanks any information.

Régis Daniel de Oliveira



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Do you have any handy functions/libraries you would like to donate?

2003-11-05 Thread Jason Oakley
I'm collecting a bunch of functions to archive on my website so programmers 
(new and old) have a central location to look for handy code. 

Does anyone have any functions they would like to donate (or libraries?). 

You can either email me or add it to my forum below. 

Cheers, 

Jason.

http://zigzag.bangrocks.com/ - PalmOS Software
Also Palm Game Programmers forum
Discuss and post your handy functions! 

-- For information on using the Palm Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/ 

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Palm String Compressing/Uncompressing

2003-11-05 Thread Alan Ingleby
You can use zlib for this.  We do a similar thing on records of about 2000
bytes, and get about 15:1 compression.  For short strings you won't find it
much use though (a string of about 16 chars rarely ends up smaller after
compression.)

http://www.gzip.org/zlib/

Alan

Régis Daniel de Oliveira [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hy all!

 Does anybody know a library that i can use to compress/decompress strings
in
 PalmOS?

 My server app (developed using VB - so, the lib should have a dll that
will
 be used to compress the string on the server and, then, send it to the
palm)
 will need to compress the string, send it to the palm and palm should
 decompress it.

 Thanks any information.

 Régis Daniel de Oliveira






-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Global Variable

2003-11-05 Thread Khurram
Hi,
I want to know how i can declare Global variable in Starter.c and then
access it from ULDatabase.sqc

Regards
Khuram Mir


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Multisegment help required

2003-11-05 Thread husnain malik
Hi all,
This error has been bugging for the last week. But i
cant
get rid of it.This is when i have segmented my
application .. Is it 
because of my prctools ??

m68k-palmos-gcc  -c Care.c -o Care.o
m68k-palmos-gcc  -c CareSec2.c -o CareSec2.o
m68k-palmos-multigenCare.def
m68k-palmos-gcc  -o Care Care.o CareSec2.o
Care-sections.ld
Care.o(.text+0x7462):Care.c: undefined reference to
`__text__sec2form'
collect2: ld returned 1 exit status
make: *** [Care] Error 1

Some Explaination
my Make file
VERSION   = 1.0
APP= Care
ICONTEXT   = Care
APPID   = PApd
RCP   = $(APP).rcp
PRC   = $(APP).prc
DEF   = $(APP).def
SRC   = $(APP).c $(APP)Sec2.c
SECTIONS  = $(APP)-sections
CC   = m68k-palmos-gcc
PILRC   = pilrc
BUILDPRC  = build-prc
MULTIGEN  = m68k-palmos-multigen
# multigen

all: $(PRC)
$(PRC): $(APP) bin.stamp
 $(BUILDPRC) $(DEF) *.bin $(APP) 
 ls -l *.prc
$(APP): $(SRC:.c=.o) $(SECTIONS).ld
 $(CC) $(CFLAGS) -o $@ $^
bin.stamp: $(RCP)
 $(PILRC) $^ $(BINDIR)
 touch $@

%.o: %.c
 $(CC) $(CFLAGS) -c $ -o $@
$(SECTIONS).o: $(SECTIONS).s
 $(CC) $(CFLAGS) -c $ -o $@
$(SECTIONS).s $(SECTIONS).ld: $(DEF)
 $(MULTIGEN) $(DEF)
depend dep:
 $(CC) -M $(SRC)  .dependencies
///
My .def file is

application {Care PApd}
multiple code{sec2form}
///
I have got just one huge method which i have put in
the other 
segment.
the other segment's header file looks like this
#define SEC2_SEC __attribute__ ((section
(sec2form)))
void PreFillEditStructure() SEC2_SEC;
///
and the implementation of this method (in the
CareSec2.c file)
looks like this 
void PreFillEditStructure()
{
..
}

//

i included the this header file in my main.c file..
and from main.c i call the method
PreFillEditStructure() (note that 
this method
is in the other segment)..
Doing this generates the above error. But if i remove
the call to 
this
method. it compiles fine.. But definatly it wont call
the
method.(PreFillEditStructure).

Plzzz help me out ... 

Husnain Malik

 


__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/