Important Update:

- Add GetValue/SetValue commands for Device command interface
- Bug fix: use case compare on searches
This commit is contained in:
Charl Wentzel
2017-03-02 12:31:50 +02:00
parent d4ee138da8
commit 2d9faa7fa6
2 changed files with 117 additions and 65 deletions

View File

@@ -95,13 +95,13 @@ protected:
// Find Devices
inline TDevice * GetDevice( const char * Name ) {
TDevice * Device = FirstDevice;
while (Device && strcmp( Device->Name, Name ))
while (Device && strcasecmp( Device->Name, Name ))
Device = Device->Next;
return Device;
}
inline TDevice ** GetDevicePtr( const char * Name ) {
TDevice ** Device = &FirstDevice;
while (*Device && strcmp( (*Device)->Name, Name ))
while (*Device && strcasecmp( (*Device)->Name, Name ))
Device = &((*Device)->Next);
return Device;
}
@@ -119,14 +119,14 @@ protected:
inline TDeviceParam * GetDeviceParam( TDevice * Device, const char * Name ) {
if (!Device) return NULL;
TDeviceParam * Param = Device->FirstParam;
while (Param && strcmp( Param->Name, Name ))
while (Param && strcasecmp( Param->Name, Name ))
Param = Param->Next;
return Param;
}
inline TDeviceParam ** GetDeviceParamPtr( TDevice * Device, const char * Name ) {
if (!Device) return NULL;
TDeviceParam ** Param = &Device->FirstParam;
while (*Param && strcmp( (*Param)->Name, Name ))
while (*Param && strcasecmp( (*Param)->Name, Name ))
Param = &((*Param)->Next);
return Param;
}
@@ -196,6 +196,10 @@ public:
bool SetSignedValue( TDeviceParam * Param, const int32_t Value, bool Force );
bool SetFloatValue( TDeviceParam * Param, const float Value, bool Force );
bool SetStringValue( TDeviceParam * Param, const char * Value, const int Len, bool Force );
// Text Interfaces
bool SetValue( TDeviceParam * Param, const char * Value, const int Len, bool Force );
bool GetValue( TDeviceParam * Param, char * Value, int &Len );
};
//---------------------------------------------------------------------------