[mw_shl_code=c,true]/**
*****************************************************************************
**
** @brief Send a SET_READER_CONFIG message that resets the
** reader to factory defaults.
**
** NB: The ResetToFactoryDefault semantics vary between readers.
** It might have no effect because it is optional.
**
** The message is:
**
** <SET_READER_CONFIG MessageID='101'>
** <ResetToFactoryDefault>1</ResetToFactoryDefault>
** </SET_READER_CONFIG>
**
** @return ==0 Everything OK
** !=0 Something went wrong
**
*****************************************************************************/
int
resetConfigurationToFactoryDefaults (void)
{
LLRP_tSSET_READER_CONFIG Cmd = {
.hdr.elementHdr.pType = &LLRP_tdSET_READER_CONFIG,
.hdr.MessageID = 101,
.ResetToFactoryDefault = 1
};
LLRP_tSMessage * pRspMsg;
LLRP_tSSET_READER_CONFIG_RESPONSE *pRsp;
/*
* Send the message, expect the response of certain type
*/
pRspMsg = transact(&Cmd.hdr);
if(NULL == pRspMsg)
{
/* transact already tattled */
return -1;
}
/*
* Cast to a SET_READER_CONFIG_RESPONSE message.
*/
pRsp = (LLRP_tSSET_READER_CONFIG_RESPONSE *) pRspMsg;
/*
* Check the LLRPStatus parameter.
*/
if(0 != checkLLRPStatus(pRsp->pLLRPStatus,
"resetConfigurationToFactoryDefaults"))
{
/* checkLLRPStatus already tattled */
freeMessage(pRspMsg);
return -1;
}
/*
* Done with the response message.
*/
freeMessage(pRspMsg);
/*
* Tattle progress, maybe
*/
if(g_Verbose)
{
printf("INFO: Configuration reset to factory defaults\n");
}
/*
* Victory.
*/
return 0;
}[/mw_shl_code]
在注释里面可以看到通讯的消息格式为XML消息流格式,请问在MDK中可以如上解析这条XML消息?
|