Skip to content

Commit

Permalink
read/write functions : support of double type added.
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Marini committed Apr 7, 2015
1 parent 04188f9 commit 65453f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions KnxDevice.cpp
Expand Up @@ -238,6 +238,7 @@ template e_KnxDeviceStatus KnxDevice::read <int>(byte objectIndex, int& returned
template e_KnxDeviceStatus KnxDevice::read <unsigned long>(byte objectIndex, unsigned long& returnedValue);
template e_KnxDeviceStatus KnxDevice::read <long>(byte objectIndex, long& returnedValue);
template e_KnxDeviceStatus KnxDevice::read <float>(byte objectIndex, float& returnedValue);
template e_KnxDeviceStatus KnxDevice::read <double>(byte objectIndex, double& returnedValue);



Expand Down Expand Up @@ -286,6 +287,7 @@ template e_KnxDeviceStatus KnxDevice::write <int>(byte objectIndex, int value);
template e_KnxDeviceStatus KnxDevice::write <unsigned long>(byte objectIndex, unsigned long value);
template e_KnxDeviceStatus KnxDevice::write <long>(byte objectIndex, long value);
template e_KnxDeviceStatus KnxDevice::write <float>(byte objectIndex, float value);
template e_KnxDeviceStatus KnxDevice::write <double>(byte objectIndex, double value);


// Update any type of com object (rough DPT value shall be provided)
Expand Down Expand Up @@ -471,6 +473,7 @@ template e_KnxDeviceStatus ConvertFromDpt <int>(const byte dptOriginValue[], int
template e_KnxDeviceStatus ConvertFromDpt <unsigned long>(const byte dptOriginValue[], unsigned long&, byte dptFormat);
template e_KnxDeviceStatus ConvertFromDpt <long>(const byte dptOriginValue[], long&, byte dptFormat);
template e_KnxDeviceStatus ConvertFromDpt <float>(const byte dptOriginValue[], float&, byte dptFormat);
template e_KnxDeviceStatus ConvertFromDpt <double>(const byte dptOriginValue[], double&, byte dptFormat);


// Functions to convert a standard C type to a DPT format
Expand Down Expand Up @@ -541,6 +544,7 @@ template e_KnxDeviceStatus ConvertToDpt <int>(int, byte dptDestValue[], byte dpt
template e_KnxDeviceStatus ConvertToDpt <unsigned long>(unsigned long, byte dptDestValue[], byte dptFormat);
template e_KnxDeviceStatus ConvertToDpt <long>(long, byte dptDestValue[], byte dptFormat);
template e_KnxDeviceStatus ConvertToDpt <float>(float, byte dptDestValue[], byte dptFormat);
template e_KnxDeviceStatus ConvertToDpt <double>(double, byte dptDestValue[], byte dptFormat);

// EOF

5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -48,6 +48,7 @@ This library is still under developpement. The next actions in the pipe are :
|:---------------------------:|:----------------------------------------------------:|
| V0.1 | experimental version |
| V0.2 | read/write functions : support of boolean type added |
| V0.3 | read/write functions : support of double type added |


## API
Expand Down Expand Up @@ -157,7 +158,7 @@ ___
_Read an usual format com object_

* **Description:** Get the current value of a group object. This function is relevant for objects with usual format, see table below.
* **Parameters:** "objectIndex" is the index (in the list) of the object to be read. "returnedValue" is the read com object value. "returnedValue" can be any standard C type (boolean, uchar, char, uint, int, ulong, long, float types).
* **Parameters:** "objectIndex" is the index (in the list) of the object to be read. "returnedValue" is the read com object value. "returnedValue" can be any standard C type (boolean, uchar, char, uint, int, ulong, long, float, double types).
* **Return:** KNX_DEVICE_OK (0) when everything went well, KNX_DEVICE_NOT_IMPLEMENTED (254) in case of F32 conversion, KNX_DEVICE_ERROR (255) in case of unsupported group object format.
* **Examples:**
```
Expand Down Expand Up @@ -198,7 +199,7 @@ ___

* **Description:** update the value of a group object. This function is relevant for objects with usual format, see table below.
In case the object has COMMUNICATION and TRANSMIT flags set, then a telegram is emitted on the EIB bus, thus the new value is propagated to the other devices.
* **Parameters:** "objectIndex" is the index (in the list) of the object to be updated. "value" is the new value. value can be any standard C type (boolean, uchar, char, uint, int, ulong, long, float types).
* **Parameters:** "objectIndex" is the index (in the list) of the object to be updated. "value" is the new value. value can be any standard C type (boolean, uchar, char, uint, int, ulong, long, float, double types).
* **Return:** KNX_DEVICE_OK (0) when everything went well, KNX_DEVICE_NOT_IMPLEMENTED (254) in case of F32 conversion, KNX_DEVICE_ERROR (255) in case of unsupported group object format.
* **Examples:**
```
Expand Down

0 comments on commit 65453f1

Please sign in to comment.