Computing.Net > Forums > PDAs > unable to transmit serial data

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

unable to transmit serial data

Reply to Message Icon

Name: JSY
Date: November 30, 2004 at 08:26:55 Pacific
OS: Palm OS v3.3
CPU/Ram: 4MB
Comment:

hi. i'm new in doing this. i've written a set of codes in CodeWarrior using C++ intending to transmit data out from my PDA (PAlmIIIx) via serial communication but it doesn't work. What's wrong?

class dish
{
private:
string identity;
public:
dish(string orderId);
string getIdentity();

};


dish :: dish(string orderId)
{
identity = orderId;
}

string dish :: getIdentity()
{
return identity;
}


static Boolean MainFormHandleEvent(EventPtr eventP)
{
Boolean handled = false;
FormPtr frmP;
string tableNumber, toSend;

toSend[4] = '|';


switch (eventP->eType)
{
case frmOpenEvent:
frmP = FrmGetActiveForm();
MainFormInit (frmP);
FrmDrawForm (frmP);
handled = true;


tableNumber = "0001|";

case ctlSelectEvent:
switch (eventP->data.ctlSelect.controlID)
{

case MainChickenButton:
dish Chicken(ChickenId);
toSend = Chicken.getIdentity();
break;

case MainBeefButton:
dish Beef(BeefId);
toSend = Beef.getIdentity();
break;

case MainOkButton:
static Err OpenSerial(void);
static void WriteSerial(void);
static void CloseSerial(void);

FrmGotoForm (TQDialog);
handled = true;
break;

}


tableNumber += toSend;


case frmCloseEvent:
MainFormDeinit(FrmGetActiveForm());
break;

default:
break;

}
return handled;

}

/*Opening Serial Port*/

static Err OpenSerial (void)
{

#define serPortLocalHotSync 0x8000
UInt16 portID;
Err error;
Boolean serPortOpened = false;

//srmOpen(port identifier, baud rate, pointer to a variable to
//receiver portID)
error = SrmOpen(serPortLocalHotSync, 9600, &portID);

if (error)
{

//Displays error message if error occurs
ErrNonFatalDisplayIf(error == serErrBadPort, "serErrBadPort");

}

return serPortOpened;
}

/*Closing Serial Port*/

static void CloseSerial (void)
{

Err error;
#define portID 0x8000 //Defines portID as serPortLocalHotSync
0x8000


//Waits until all data in the transmit queue has been sent and then
// only exit the application.
error = SrmSendWait(portID);
SrmClose(portID);

if (error)
{

//Displays error message if error occurs.
ErrNonFatalDisplayIf(error == serErrBadPort, "srmClose :
BadPort");

}

}

/*Sending Data*/

static void WriteSerial (void)
{

string tableNumber, numSent;
Err error;
numSent = SrmSend(portID, &tableNumber, 256, &error);

}



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Lost connection whit IPAG using PDAs with MS Access



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to PDAs Forum Home


Sponsored links

Ads by Google


Results for: unable to transmit serial data

HP548 Unable to Delete name.MP3 www.computing.net/answers/pda/hp548-unable-to-delete-namemp3/1252.html

Unable to create Playlist from SD Card www.computing.net/answers/pda/unable-to-create-playlist-from-sd-card/2282.html

Software to transmit in serial port www.computing.net/answers/pda/software-to-transmit-in-serial-port/505.html