Minor Update:
- DeviceCore: Issue event with DataPath, not param name
This commit is contained in:
@@ -1764,6 +1764,8 @@ int CDeviceCore::HandleCommand( const char *ChannelName, const char * SourceRef,
|
||||
// Generate Event output
|
||||
bool CDeviceCore::EventOutput( TDeviceParam * Param, bool Force )
|
||||
{
|
||||
char Message[200];
|
||||
|
||||
// Validate
|
||||
if (!Param || !(Param->EventChannel))
|
||||
return false;
|
||||
@@ -1773,38 +1775,37 @@ bool CDeviceCore::EventOutput( TDeviceParam * Param, bool Force )
|
||||
(Param->EventInterval && Timeout( Param->EventTimeout, Param->EventInterval )) )
|
||||
{
|
||||
// Post event
|
||||
char Message[200];
|
||||
switch (Param->DataType)
|
||||
{
|
||||
case dtBool :
|
||||
sprintf( Message, "%s: %u\n", Param->Name, *((bool*)Param->Value) );
|
||||
sprintf( Message, "%s: %u\n", Param->DataPath, *((bool*)Param->Value) );
|
||||
break;
|
||||
|
||||
case dtUnsigned16 :
|
||||
sprintf( Message, "%s: %u\n", Param->Name, *((u_int16_t*)Param->Value) );
|
||||
sprintf( Message, "%s: %u\n", Param->DataPath, *((u_int16_t*)Param->Value) );
|
||||
break;
|
||||
|
||||
case dtUnsigned32_HL :
|
||||
case dtUnsigned32_LH :
|
||||
sprintf( Message, "%s: %u\n", Param->Name, *((u_int32_t*)Param->Value) );
|
||||
sprintf( Message, "%s: %u\n", Param->DataPath, *((u_int32_t*)Param->Value) );
|
||||
break;
|
||||
|
||||
case dtSigned16 :
|
||||
sprintf( Message, "%s: %d\n", Param->Name, *((int16_t*)Param->Value) );
|
||||
sprintf( Message, "%s: %d\n", Param->DataPath, *((int16_t*)Param->Value) );
|
||||
break;
|
||||
|
||||
case dtSigned32_HL :
|
||||
case dtSigned32_LH :
|
||||
sprintf( Message, "%s: %d\n", Param->Name, *((int32_t*)Param->Value) );
|
||||
sprintf( Message, "%s: %d\n", Param->DataPath, *((int32_t*)Param->Value) );
|
||||
break;
|
||||
|
||||
case dtFloat32_L :
|
||||
case dtFloat32_B :
|
||||
sprintf( Message, "%s: %f\n", Param->Name, *((float*)Param->Value) );
|
||||
sprintf( Message, "%s: %f\n", Param->DataPath, *((float*)Param->Value) );
|
||||
break;
|
||||
|
||||
case dtString :
|
||||
sprintf( Message, "%s: %s\n", Param->Name, (char*)Param->Value );
|
||||
sprintf( Message, "%s: %s\n", Param->DataPath, (char*)Param->Value );
|
||||
break;
|
||||
|
||||
default :
|
||||
|
||||
Reference in New Issue
Block a user