update
This commit is contained in:
parent
27dca2295d
commit
71e4686245
@ -33,6 +33,7 @@ struct myAdsVariable {
|
||||
{
|
||||
if (!m_Route.IsConnected()) return FALSE;
|
||||
uint32_t bytesRead = 0;
|
||||
if (m_Handle.get() == 0) return FALSE;
|
||||
auto error = m_Route.ReadReqEx2(m_IndexGroup,
|
||||
*m_Handle,
|
||||
size,
|
||||
|
14
das-dn/third_party/AdsLib/AdsDevice.cpp
vendored
14
das-dn/third_party/AdsLib/AdsDevice.cpp
vendored
@ -123,7 +123,9 @@ AdsHandle AdsDevice::GetHandle(const std::string& symbolName) const
|
||||
if (error || (sizeof(handle) != bytesRead)) {
|
||||
LOG_ERROR("AdsDevice GetSymbolHandle is failed: " << symbolName << ".");
|
||||
//throw AdsException(error);
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
handle = Beckhoff::letoh(handle);
|
||||
return {new uint32_t {handle}, {std::bind(&AdsDevice::DeleteSymbolHandle, this, std::placeholders::_1)}};
|
||||
}
|
||||
@ -137,7 +139,8 @@ AdsHandle AdsDevice::GetHandle(const uint32_t indexGroup,
|
||||
PAdsNotificationFuncEx callback,
|
||||
const uint32_t hUser) const
|
||||
{
|
||||
if(m_Connected == true){
|
||||
if (m_Connected == true)
|
||||
{
|
||||
uint32_t handle = 0;
|
||||
auto error = AdsSyncAddDeviceNotificationReqEx(
|
||||
*m_LocalPort, &m_Addr,
|
||||
@ -146,10 +149,13 @@ AdsHandle AdsDevice::GetHandle(const uint32_t indexGroup,
|
||||
callback,
|
||||
hUser,
|
||||
&handle);
|
||||
if (error || !handle) {
|
||||
if (error || !handle)
|
||||
{
|
||||
LOG_WARN("AdsDevice GetNotificationHandle is failed.");
|
||||
//throw AdsException(error);
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
handle = Beckhoff::letoh(handle);
|
||||
return {new uint32_t {handle}, {std::bind(&AdsDevice::DeleteNotificationHandle, this, std::placeholders::_1)}};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user