本文整理汇总了C++中CNodeConManager::vSetNodeAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ CNodeConManager::vSetNodeAddress方法的具体用法?C++ CNodeConManager::vSetNodeAddress怎么用?C++ CNodeConManager::vSetNodeAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNodeConManager
的用法示例。
在下文中一共展示了CNodeConManager::vSetNodeAddress方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DILJ_NM_ClaimAddress
/**
* \brief Claim address
* \req RSI_26_013 - DILJ_NM_ClaimAddress
* \param[in] dwClientId Already register node's client Id
* \param[in] unChannel Channel number
* \param[in] byAddress New address to be claimed
* \param[in] byPriority Priority (0 - 7)
* \return S_OK if successful, else S_FALSE.
*
* Node tries to claim a new address by sending Address Claim message into the network.
*/
USAGEMODE HRESULT DILJ_NM_ClaimAddress (DWORD dwClientId, UINT unChannel, BYTE byAddress, BYTE byPriority)
{
HRESULT hResult = S_FALSE;
CNodeConManager* pManager = NULL;
pManager = CNetworkMgmt::ouGetNWManagementObj().pouGetConMagrObj(dwClientId);
if (NULL != pManager && pManager->bIsActive())
{
hResult = S_OK;
if (pManager->bIsMonitorNode())
{
pManager->vSetNodeAddress(byAddress);
}
pManager->vSendMessage(unChannel, MSG_TYPE_NM_ACL, byAddress, 0, NULL, byPriority, ADDRESS_ALL);
}
return hResult;
}
示例2: DILJ_RequestPGN
/**
* \brief Requests a PGN from a node
* \req RSI_26_007 - DILJ_RequestPGN
* \param[in] dwClient Client Id
* \param[in] unChannel Channel number
* \param[in] unPGN Parameter group number to be requested
* \param[in] byPriority Priority (0-7)
* \param[in] byDesrAdress Destination address.
* \return S_OK if successful, else S_FALSE.
*
* Requests a PGN from the node.
*/
USAGEMODE HRESULT DILJ_RequestPGN(DWORD dwClient, UINT unChannel, UINT32 unPGN,
BYTE byPriority, BYTE bySrc, BYTE byDestAddress)
{
HRESULT hResult = S_FALSE;
CNodeConManager* pManager = NULL;
pManager = CNetworkMgmt::ouGetNWManagementObj().pouGetConMagrObj(dwClient);
if (NULL != pManager && pManager->bIsActive())
{
hResult = S_OK;
if (pManager->bIsMonitorNode())
{
pManager->vSetNodeAddress(bySrc);
}
pManager->vSendMessage(unChannel, MSG_TYPE_REQUEST, unPGN, 0, 0, byPriority, byDestAddress);
}
return hResult;
}
示例3: DILJ_NM_RequestAddress
/**
* \brief Requests address from the node.
* \req RSI_26_014 - DILJ_NM_RequestAddress
* \param[in] dwClientId Already register node's client Id
* \param[in] unChannel Channel number
* \param[in] byDestAddress Destination Address
* \param[in] byPriority Priority (0 - 7).
* \return S_OK if successful, else S_FALSE.
*
* A node requests address from an another node.
*/
USAGEMODE HRESULT DILJ_NM_RequestAddress(DWORD dwClient, UINT unChannel, BYTE byPriority,
BYTE bySrc, BYTE byDestAddress)
{
HRESULT hResult = S_FALSE;
CNodeConManager* pManager = nullptr;
pManager = CNetworkMgmt::ouGetNWManagementObj().pouGetConMagrObj(dwClient);
if (nullptr != pManager && pManager->bIsActive())
{
hResult = S_OK;
if (pManager->bIsMonitorNode())
{
pManager->vSetNodeAddress(bySrc);
}
pManager->vSendMessage(unChannel, MSG_TYPE_NM_RQST_ACL, 0, nullptr, 0, byPriority, byDestAddress);
}
return hResult;
}
示例4:
/**
* \brief Sends a J1939 message.
* \req RSI_26_005 - DILJ_SendJ1939Msg
* \param[in] dwClient Client Id
* \param[in] unChannel Channel number
* \param[in] eMsgType COMMAND, BROADCAST, REQUEST, RESPONSE
* \param[in] unPGN Parameter group number
* \param[in] pbyData Data bytes
* \param[in] unDLC Data length in number of bytes.
* \param[in] byPriority Priority (0-7) byDesrAdress = Destination address.
* \return S_OK if successful, else S_FALSE.
*
* Sends a J1939 message.
*/
USAGEMODE HRESULT DILJ_SendJ1939Msg (DWORD dwClientId, UINT unChannel, EJ1939_MSG_TYPE eMsgType, UINT32 unPGN,
BYTE* pbyData, UINT unDLC, BYTE byPriority, BYTE bySrc, BYTE byDestAdres)
{
HRESULT hResult = S_FALSE;
CNodeConManager* pManager = NULL;
pManager = CNetworkMgmt::ouGetNWManagementObj().pouGetConMagrObj(dwClientId);
if (NULL != pManager && pManager->bIsActive())
{
hResult = S_OK;
if (pManager->bIsMonitorNode())
{
pManager->vSetNodeAddress(bySrc);
}
pManager->vSendMessage(unChannel, eMsgType, unPGN, pbyData, unDLC, byPriority, byDestAdres);
}
return hResult;
}
示例5: DILJ_SendAckMsg
/**
* \brief Sends a acknowledgement message.
* \req RSI_26_006 - DILJ_SendAckMsg
* \param[in] dwClientId Already register node's client Id
* \param[in] unChannel Channel number
* \param[in] eAckType Acknowledge type (ACK_POS, ACK_NEG)
* \param[in] unPGN PGN to be sent.
* \param[in] pbyData PGN data.
* \param[in] byAddresAck Destination address.
* \return S_OK if successful, else S_FALSE.
*
* Sends Positive/Negative acknowledgement msg.
*/
USAGEMODE HRESULT DILJ_SendAckMsg(DWORD dwClient, UINT unChannel, ETYPE_ACK eAckType, UINT32 unPGN, BYTE bySrc, BYTE byAddresAck)
{
HRESULT hResult = S_FALSE;
CNodeConManager* pManager = NULL;
pManager = CNetworkMgmt::ouGetNWManagementObj().pouGetConMagrObj(dwClient);
if (NULL != pManager && pManager->bIsActive())
{
hResult = S_OK;
if (pManager->bIsMonitorNode())
{
pManager->vSetNodeAddress(bySrc);
}
BYTE abyFrame[MAX_FRAME_DATA_SIZE];
switch (eAckType)
{
case ACK_POS:
{
abyFrame[0] = CB_ACK_POS;
abyFrame[4] = byAddresAck;
}
break;
case ACK_NEG:
{
abyFrame[0] = CB_ACK_NEG;
abyFrame[4] = ADDRESS_NULL;
}
break;
}
abyFrame[1] = 0xFF;
abyFrame[2] = 0xFF;
abyFrame[3] = 0xFF;
abyFrame[5] = (BYTE)unPGN;
abyFrame[6] = (BYTE)(unPGN >> 8);
abyFrame[7] = (BYTE)(unPGN >> 16);
pManager->vSendMessage(unChannel, MSG_TYPE_ACKNOWLEDGEMENT,
unPGN, abyFrame, 0, DEFAULT_PRIORITY, byAddresAck);
}
示例6: DILJ_NM_CommandAddress
/**
* \brief Commands a node with perticular NAME to assume a address.
* \req RSI_26_015 - DILJ_NM_CommandAddress
* \param[in] dwClientId Already register node's client Id
* \param[in] unChannel Channel number
* \param[in] unECU_NAME 64 bit ECU NAME of the destination node
* \param[in] byDestAddress Destination Address
* \param[in] byPriority Priority (0 - 7)
* \return S_OK if successful, else S_FALSE.
*
* A node commands another node to assume an address.
*/
USAGEMODE HRESULT DILJ_NM_CommandAddress(DWORD dwClient, UINT unChannel, UINT64 unECU_NAME,
BYTE byNewAddress, BYTE byPriority, BYTE bySrc, BYTE byDestAddress)
{
HRESULT hResult = S_FALSE;
CNodeConManager* pManager = NULL;
pManager = CNetworkMgmt::ouGetNWManagementObj().pouGetConMagrObj(dwClient);
if (NULL != pManager && pManager->bIsActive())
{
hResult = S_OK;
if (pManager->bIsMonitorNode())
{
pManager->vSetNodeAddress(bySrc);
}
BYTE abyFrame[DATA_LEN_CMD_ADDRESS] = {0xFF};
memcpy(abyFrame, &unECU_NAME, MAX_FRAME_DATA_SIZE);
abyFrame[DATA_LEN_CMD_ADDRESS - 1] = byNewAddress;
pManager->vSendMessage(unChannel, MSG_TYPE_NM_CMD_ADDRESS, 0, abyFrame, DATA_LEN_CMD_ADDRESS, byPriority, byDestAddress);
}
return hResult;
}