Hi!
I compiled the BTPointToPoint example and it works nice on 7650. But now i have a question. What should i do if i like a second menue item to send another TextString!? Or what should i write in:
[code:1]
TKeyResponse CTestAppUi::HandleKeyEventL(
const TKeyEvent& aKeyEvent,TEventCode aType)
{
if (aType==EEventKey && aKeyEvent.iCode=='1')
{
//key 1 pressed
//bluetooth sendstring here!!
return EKeyWasConsumed;
}
return EKeyWasNotConsumed;
}
[/code:1]
so send a string over bluetoot!?
I hope you could help me.
CU
Flo
I am not so sure about the bluetooth portion but if you want a second menu item, you will have to modify the .rss file's menu declaration to add another menuitem (the enumeration under .hrh will need another member)..
This member is what you will use under the command id of the APPUI's handleevent and write an handler for the menu item being chosen.
Hi
I am also very interested in this subject.....please make a post if u r able to do that...........
Hi!
Yes when i would like to add a new item i must add a new line to the rss file like this
[code:1]
RESOURCE MENU_PANE r_btpointtopoint_menu
{
items =
{
MENU_ITEM {command = EBTPointToPointSendMessage; txt = "Nachricht 1 senden";},
MENU_ITEM {command = EBTPointToPointClearList; txt = "Liste L�schen";},
MENU_ITEM {command = EAknSoftkeyExit; txt = "Schlie�en";}
// MY NEW LINE
MENU_ITEM {command = mynewitem; txt = "exit two";}, //new line
};
}
[/code:1]
and in the appui.cpp i must add a case for this menue item like this
[code:1]
void CBTPointToPointAppUi::HandleCommandL(TInt aCommand)
{
switch(aCommand)
{
case EAknSoftkeyExit:
Exit();
break;
case mynewitem:
exit();
break;
case EBTPointToPointSendMessage:
iClient->SendMessageL();
break;
case EBTPointToPointClearList:
iAppView->ClearMessageListL();
break;
default:
Panic(EBTPointToPointBasicUi);
break;
}
}
[/code:1]
but if i do this the programm crashes if i open the menue.. whats my mistake!??!?
Is that code pasted exactly as you typed it in? There's a typo: the lines
[code:1]MENU_ITEM {command = EAknSoftkeyExit; txt = "Schlie�en";}
MENU_ITEM {command = mynewitem; txt = "exit two";}, [/code:1]
should be changed to
[code:1]MENU_ITEM {command = EAknSoftkeyExit; txt = "Schlie�en";},
MENU_ITEM {command = mynewitem; txt = "exit two";}[/code:1]
This may solve your problem.
thx that was my mistake 😊)
Speaking of Bluetooth, has anybody here done any development with it? Can you tell me what is the latency of a Bluetooth connection (using serial port) i.e. how much time does it take to send a small message to another phone and get a response back?