本文整理汇总了C++中VERIFY_RET_OK函数的典型用法代码示例。如果您正苦于以下问题:C++ VERIFY_RET_OK函数的具体用法?C++ VERIFY_RET_OK怎么用?C++ VERIFY_RET_OK使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VERIFY_RET_OK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sl_Bind
int sl_Bind(int sd, const SlSockAddr_t *addr, int addrlen)
{
_SlSockBindMsg_u Msg;
_SlCmdCtrl_t CmdCtrl = {0, 0, sizeof(_SocketResponse_t)};
switch(addr->sa_family)
{
case SL_AF_INET :
CmdCtrl.Opcode = SL_OPCODE_SOCKET_BIND;
CmdCtrl.TxDescLen = sizeof(_SocketAddrIPv4Command_t);
break;
case SL_AF_INET6_EUI_48:
CmdCtrl.Opcode = SL_OPCODE_SOCKET_BIND_V6;
CmdCtrl.TxDescLen = sizeof(_SocketAddrIPv6EUI48Command_t);
break;
#ifdef SL_SUPPORT_IPV6
case AF_INET6:
CmdCtrl.Opcode = SL_OPCODE_SOCKET_BIND_V6;
CmdCtrl.TxDescLen = sizeof(_SocketAddrIPv6Command_t);
break;
#endif
case SL_AF_RF :
default:
return SL_RET_CODE_INVALID_INPUT;
}
Msg.Cmd.IpV4.lenOrPadding = 0;
Msg.Cmd.IpV4.sd = (UINT8)sd;
_sl_BuildAddress(addr, addrlen, &Msg.Cmd);
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&CmdCtrl, &Msg, NULL));
return Msg.Rsp.statusOrLen;
}
示例2: sl_WlanSmartConfigStart
int sl_WlanSmartConfigStart( const unsigned long groupIdBitmask,
const unsigned char cipher,
const unsigned char publicKeyLen,
const unsigned char group1KeyLen,
const unsigned char group2KeyLen,
const unsigned char* pPublicKey,
const unsigned char* pGroup1Key,
const unsigned char* pGroup2Key)
{
_SlSmartConfigStartMsg_u Msg;
Msg.Cmd.Args.groupIdBitmask = (UINT8)groupIdBitmask;
Msg.Cmd.Args.cipher = (UINT8)cipher;
Msg.Cmd.Args.publicKeyLen = (UINT8)publicKeyLen;
Msg.Cmd.Args.group1KeyLen = (UINT8)group1KeyLen;
Msg.Cmd.Args.group2KeyLen = (UINT8)group2KeyLen;
/* copy keys (if exist) after command (one after another) */
memcpy(SMART_CONFIG_START_PUBLIC_KEY_STRING(&Msg), pPublicKey, publicKeyLen);
memcpy(SMART_CONFIG_START_GROUP1_KEY_STRING(&Msg), pGroup1Key, group1KeyLen);
memcpy(SMART_CONFIG_START_GROUP2_KEY_STRING(&Msg), pGroup2Key, group2KeyLen);
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlSmartConfigStartCmdCtrl , &Msg, NULL));
return (int)Msg.Rsp.status;
}
示例3: sl_NetUtilGet
_i16 sl_NetUtilGet(const _u16 Option, const _u32 ObjID, _u8 *pValues, _u16 *pValueLen)
{
SlNetUtilMsgGet_u Msg;
_SlCmdExt_t CmdExt;
_SlDrvResetCmdExt(&CmdExt);
CmdExt.RxPayloadLen = *pValueLen;
CmdExt.pRxPayload = (_u8 *)pValues;
Msg.Cmd.Option = Option;
Msg.Cmd.ObjId = ObjID;
Msg.Cmd.ValueLen = *pValueLen;
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlNetUtilGetCmdCtrl, &Msg, &CmdExt));
if(CmdExt.RxPayloadLen < CmdExt.ActualRxPayloadLen)
{
*pValueLen = CmdExt.RxPayloadLen;
return SL_ESMALLBUF;
}
else
{
*pValueLen = CmdExt.ActualRxPayloadLen;
}
return (_i16)Msg.Rsp.Status;
}
示例4: sl_WlanRxFilterGet
int sl_WlanRxFilterGet(const SLrxFilterOperation_t RxFilterOperation,
unsigned char* pOutputBuffer,
UINT16 OutputbufferLength)
{
_SlRxFilterGetMsg_u Msg;
_SlCmdExt_t CmdExt;
if (OutputbufferLength == 0)
{
return SL_EZEROLEN;
}
CmdExt.TxPayloadLen = 0;
CmdExt.pTxPayload = NULL;
CmdExt.RxPayloadLen = OutputbufferLength;
CmdExt.pRxPayload = (UINT8 *)pOutputBuffer;
CmdExt.ActualRxPayloadLen = 0;
Msg.Cmd.RxFilterOperation = RxFilterOperation;
Msg.Cmd.OutputBufferLength = OutputbufferLength;
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlRxFilterGetCmdCtrl, &Msg, &CmdExt) );
if (CmdExt.RxPayloadLen < CmdExt.ActualRxPayloadLen)
{
return SL_ESMALLBUF;
}
return (int)Msg.Rsp.Status;
}
示例5: sl_FsClose
int sl_FsClose(long FileHdl, unsigned char* pCeritificateFileName,unsigned char* pSignature ,unsigned long SignatureLen)
{
_SlFsCloseMsg_u Msg = {0};
_SlCmdExt_t ExtCtrl;
Msg.Cmd.FileHandle = FileHdl;
if( pCeritificateFileName != NULL )
{
Msg.Cmd.CertificFileNameLength = (sl_Strlen(pCeritificateFileName)+4) & (~3); /* add 4: 1 for NULL and the 3 for align */
}
Msg.Cmd.SignatureLen = SignatureLen;
ExtCtrl.TxPayloadLen = ((SignatureLen+3) & (~3)); /* align */
ExtCtrl.pTxPayload = pSignature;
ExtCtrl.RxPayloadLen = Msg.Cmd.CertificFileNameLength;
ExtCtrl.pRxPayload = pCeritificateFileName; /* Add signature */
if(ExtCtrl.pRxPayload != NULL && ExtCtrl.RxPayloadLen != 0)
{
g_pCB->RelayFlagsViaRxPayload = TRUE;
}
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlFsCloseCmdCtrl, &Msg, &ExtCtrl));
return (int)((short)Msg.Rsp.status);
}
示例6: sl_GetSockOpt
int sl_GetSockOpt(int sd, int level, int optname, void *optval, SlSocklen_t *optlen)
{
_SlGetSockOptMsg_u Msg;
_SlCmdExt_t CmdExt;
if (*optlen == 0)
{
return SL_EZEROLEN;
}
CmdExt.TxPayloadLen = 0;
CmdExt.RxPayloadLen = *optlen;
CmdExt.pTxPayload = NULL;
CmdExt.pRxPayload = optval;
CmdExt.ActualRxPayloadLen = 0;
Msg.Cmd.sd = sd;
Msg.Cmd.level = level;
Msg.Cmd.optionLen = *optlen;
Msg.Cmd.optionName = optname;
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlGetSockOptCmdCtrl, &Msg, &CmdExt));
if (CmdExt.RxPayloadLen < CmdExt.ActualRxPayloadLen)
{
*optlen = Msg.Rsp.optionLen;
return SL_ESMALLBUF;
}
else
{
*optlen = (UINT8)CmdExt.ActualRxPayloadLen;
}
return (int)Msg.Rsp.status;
}
示例7: sl_NetAppGet
long sl_NetAppGet(unsigned char AppId, unsigned char Option,unsigned char *pOptionLen, unsigned char *pOptionValue)
{
_SlNetAppMsgGet_u Msg;
_SlCmdExt_t CmdExt;
if (*pOptionLen == 0)
{
return SL_EZEROLEN;
}
CmdExt.TxPayloadLen = 0;
CmdExt.RxPayloadLen = *pOptionLen;
CmdExt.pTxPayload = NULL;
CmdExt.pRxPayload = (UINT8 *)pOptionValue;
CmdExt.ActualRxPayloadLen = 0;
Msg.Cmd.AppId = AppId;
Msg.Cmd.ConfigOpt = Option;
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlNetAppGetCmdCtrl, &Msg, &CmdExt));
if (CmdExt.RxPayloadLen < CmdExt.ActualRxPayloadLen)
{
*pOptionLen = (UINT8)CmdExt.RxPayloadLen;
return SL_ESMALLBUF;
}
else
{
*pOptionLen = (UINT8)CmdExt.ActualRxPayloadLen;
}
return (int)Msg.Rsp.Status;
}
示例8: sl_FsGetInfo
_i16 sl_FsGetInfo( const _u8 *pFileName, const _u32 Token,
SlFsFileInfo_t *pFsFileInfo )
{
_SlFsGetInfoMsg_u Msg;
_SlCmdExt_t CmdExt;
CmdExt.TxPayloadLen = ( _sl_Strlen( pFileName ) + 4 ) &
( ~3 ); /* add 4: 1 for NULL and the 3 for align */
CmdExt.RxPayloadLen = 0;
CmdExt.pTxPayload = ( _u8 * )pFileName;
CmdExt.pRxPayload = NULL;
Msg.Cmd.Token = Token;
VERIFY_RET_OK( _SlDrvCmdOp( ( _SlCmdCtrl_t * )&_SlFsGetInfoCmdCtrl, &Msg,
&CmdExt ) );
pFsFileInfo->flags = Msg.Rsp.flags;
pFsFileInfo->FileLen = Msg.Rsp.FileLen;
pFsFileInfo->AllocatedLen = Msg.Rsp.AllocatedLen;
pFsFileInfo->Token[0] = Msg.Rsp.Token[0];
pFsFileInfo->Token[1] = Msg.Rsp.Token[1];
pFsFileInfo->Token[2] = Msg.Rsp.Token[2];
pFsFileInfo->Token[3] = Msg.Rsp.Token[3];
return ( _i16 )( ( _i16 )Msg.Rsp.Status );
}
示例9: sl_FsClose
_i16 sl_FsClose( const _i32 FileHdl, const _u8 *pCeritificateFileName,
const _u8 *pSignature , const _u32 SignatureLen )
{
_SlFsCloseMsg_u Msg = {0};
_SlCmdExt_t ExtCtrl;
Msg.Cmd.FileHandle = FileHdl;
if( pCeritificateFileName != NULL )
{
Msg.Cmd.CertificFileNameLength = ( _sl_Strlen( pCeritificateFileName ) + 4 )
& ( ~3 ); /* add 4: 1 for NULL and the 3 for align */
}
Msg.Cmd.SignatureLen = SignatureLen;
ExtCtrl.TxPayloadLen = ( ( SignatureLen + 3 ) & ( ~3 ) ); /* align */
ExtCtrl.pTxPayload = ( _u8 * )pSignature;
ExtCtrl.RxPayloadLen = ( _i16 )Msg.Cmd.CertificFileNameLength;
ExtCtrl.pRxPayload = ( _u8 * )pCeritificateFileName; /* Add signature */
if( ExtCtrl.pRxPayload != NULL && ExtCtrl.RxPayloadLen != 0 )
ExtCtrl.RxPayloadLen = ExtCtrl.RxPayloadLen * ( -1 );
VERIFY_RET_OK( _SlDrvCmdOp( ( _SlCmdCtrl_t * )&_SlFsCloseCmdCtrl, &Msg,
&ExtCtrl ) );
return ( _i16 )( ( _i16 )Msg.Rsp.status );
}
示例10: sl_WlanRxStatGet
int sl_WlanRxStatGet(SlGetRxStatResponse_t *pRxStat,unsigned long Flags)
{
_SlCmdCtrl_t CmdCtrl = {SL_OPCODE_WLAN_GETRXSTATCOMMAND, 0, sizeof(SlGetRxStatResponse_t)};
memset(pRxStat,0,sizeof(SlGetRxStatResponse_t));
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&CmdCtrl, pRxStat, NULL));
return 0;
}
示例11: sl_NetAppStart
_i16 sl_NetAppStart(_u32 AppBitMap)
{
_SlNetAppStartStopMsg_u Msg;
Msg.Cmd.appId = AppBitMap;
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlNetAppStartCtrl, &Msg, NULL));
return Msg.Rsp.status;
}
示例12: sl_NetAppStop
int sl_NetAppStop(unsigned long AppBitMap)
{
_SlNetAppStartStopMsg_u Msg;
Msg.Cmd.appId = AppBitMap;
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlNetAppStopCtrl, &Msg, NULL));
return Msg.Rsp.status;
}
示例13: sl_Close
int sl_Close(int sd)
{
_SlSockCloseMsg_u Msg;
Msg.Cmd.sd = (UINT8)sd;
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlSockCloseCmdCtrl, &Msg, NULL));
return Msg.Rsp.statusOrLen;
}
示例14: sl_WlanProfileDel
int sl_WlanProfileDel(int Index)
{
_SlProfileDelMsg_u Msg;
Msg.Cmd.index = (UINT8)Index;
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlProfileDelCmdCtrl, &Msg, NULL));
return (int)Msg.Rsp.status;
}
示例15: sl_Listen
int sl_Listen(int sd, int backlog)
{
_SlListenMsg_u Msg;
Msg.Cmd.sd = sd;
Msg.Cmd.backlog = backlog;
VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlListenCmdCtrl, &Msg, NULL));
return (int)Msg.Rsp.status;
}