Uppdate Property FROM Device??
Posted: Mon Aug 23, 2004 5:14 pm
I am trying to build a device for UDP/IP communication. So far I have succeded to make it send messages (when I change an alphaNumerical property it send the property value to a preset port and address) BUT how can I make the device notify the HB server when device RECEIVES a message. I have modified the BeepDevice example in the SDK and i know the device have received the message (using TraceMessage() ) but it (seems to) only update the receiving property when i update any other property!?!
I have my receiving code in the loop in DeviceRun method and use CreatePropertyValue(szReceivedUDPData) to update my property. To simplify the problem i tested the code below and it only run when the user change one of the other properties in the device.
Example from the loop in the DeviceRun method:
if((m_dwOldTickCount+1000)<GetTickCount())
{
sprintf(buffer,"Tick count is %d",GetTickCount());
CPropertyValue* pNoValue = m_pData->CreatePropertyValue( buffer );
if (pNoValue)
{
pNoValue->ChangeRequestCompleted();
delete pNoValue;
}
m_dwOldTickCount = GetTickCount();
}
What have i missed??
I have my receiving code in the loop in DeviceRun method and use CreatePropertyValue(szReceivedUDPData) to update my property. To simplify the problem i tested the code below and it only run when the user change one of the other properties in the device.
Example from the loop in the DeviceRun method:
if((m_dwOldTickCount+1000)<GetTickCount())
{
sprintf(buffer,"Tick count is %d",GetTickCount());
CPropertyValue* pNoValue = m_pData->CreatePropertyValue( buffer );
if (pNoValue)
{
pNoValue->ChangeRequestCompleted();
delete pNoValue;
}
m_dwOldTickCount = GetTickCount();
}
What have i missed??