Mr Minakuchi,
This particular examples uses LTK-XML to import a set reader config message
then uses programming objects to update the transmit power etc.
The Transmit power is located in the CRFTransmitter parameter which is within
the CAntennaConfiguration parameter.
{
CMessage * pCmdMsg;
CSET_READER_CONFIG *pCmd;
CMessage * pRspMsg;
CSET_READER_CONFIG_RESPONSE *pRsp;
CXMLTextDecoder * pDecoder;
std::list<CAntennaConfiguration *>::iterator Cur;
/* Build a decoder to extract the message from XML */
pDecoder = new CXMLTextDecoder(m_pTypeRegistry, "setReaderConfig.xml");
if(NULL == pDecoder)
{
return -1;
}
pCmdMsg = pDecoder->decodeMessage();
delete pDecoder;
if(NULL == pCmdMsg)
{
return -2;
}
if(&CSET_READER_CONFIG::s_typeDescriptor != pCmdMsg->m_pType)
{
return -3;
}
/* get the message as a SET_READER_CONFIG */
pCmd = (CSET_READER_CONFIG *) pCmdMsg;
/* It's always a good idea to give it a unique message ID */
pCmd->setMessageID(m_messageID++);
/* at this point,we would be ready to send the message, but we need
* to make a change to the transmit power for each enabled antenna.
* Loop through */
for(
Cur = pCmd->beginAntennaConfiguration();
Cur != pCmd->endAntennaConfiguration();
Cur++)
{
CRFTransmitter *pRfTx = (*Cur)->getRFTransmitter();
/* we already have this element in our sample XML file, but
* we check here to create one if it doesn't exist to show
* a more general usage */
if(NULL == pRfTx)
{
pRfTx = new CRFTransmitter();
(*Cur)->setRFTransmitter(pRfTx);
}
/*
** Set the max power that we retreived from the capabilities
** and the hopTableID and Channel index we got from the config
*/
pRfTx->setChannelIndex(m_channelIndex);
pRfTx->setHopTableID(m_hopTableID);
pRfTx->setTransmitPower(m_PowerLevelIndex);
}
/*
* Send the message, expect the response of certain type
*/
pRspMsg = transact(pCmd);
/*
* Done with the command message
*/
delete pCmd;
/*
* transact() returns NULL if something went wrong.
*/
if(NULL == pRspMsg)
{
/* transact already tattled */
return -1;
}
/*
* Cast to a CSET_READER_CONFIG_RESPONSE message.
*/
pRsp = (CSET_READER_CONFIG_RESPONSE *) pRspMsg;
/*
* Check the LLRPStatus parameter.
*/
if(0 != checkLLRPStatus(pRsp->getLLRPStatus(),
"setReaderConfig"))
{
/* checkLLRPStatus already tattled */
delete pRspMsg;
return -1;
}
/*
* Done with the response message.
*/
delete pRspMsg;
/*
* Tattle progress, maybe
*/
if(m_Verbose)
{
printf("INFO: Set Reader Configuration \n");
}
/*
* Victory.
*/
return 0;
}
________________________________
From: hiroyuki minakuchi [mailto:[email protected]]
Sent: Monday, March 29, 2010 10:13 AM
To: [email protected]
Subject: [ltk-d] Please let me know how the power output
Nice to meet you.
My name is minakuchi.
LLRP Toolkit for C PlusPlus uses.
I want to change the power output and receiver sensitivity.
But I do not know how.
Would you be able to sample.
________________________________
Get the new Internet Explorer 8 optimized for Yahoo!
JAPAN<http://pr.mail.yahoo.co.jp/ie8/>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
llrp-toolkit-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/llrp-toolkit-devel