mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Merge commit 'b2bcba7' into openknx-merge
This commit is contained in:
commit
2043141301
@ -87,6 +87,9 @@ int KNX_Decode_Value(uint8_t* payload, size_t payload_length, const Dpt& datatyp
|
|||||||
// DPT 26.* - Scene Info
|
// DPT 26.* - Scene Info
|
||||||
if (datatype.mainGroup == 26 && datatype.subGroup == 1 && datatype.index <= 1)
|
if (datatype.mainGroup == 26 && datatype.subGroup == 1 && datatype.index <= 1)
|
||||||
return busValueToSceneInfo(payload, payload_length, datatype, value);
|
return busValueToSceneInfo(payload, payload_length, datatype, value);
|
||||||
|
// DPT 27.001 - 32 Bit field
|
||||||
|
if (datatype.mainGroup == 27 && datatype.subGroup == 1 && !datatype.index)
|
||||||
|
return busValueToSigned32(payload, payload_length, datatype, value);
|
||||||
// DPT 28.* - Unicode String
|
// DPT 28.* - Unicode String
|
||||||
if (datatype.mainGroup == 28 && datatype.subGroup == 1 && !datatype.index)
|
if (datatype.mainGroup == 28 && datatype.subGroup == 1 && !datatype.index)
|
||||||
return busValueToUnicode(payload, payload_length, datatype, value);
|
return busValueToUnicode(payload, payload_length, datatype, value);
|
||||||
@ -206,6 +209,9 @@ int KNX_Encode_Value(const KNXValue& value, uint8_t* payload, size_t payload_len
|
|||||||
// DPT 26.* - Scene Info
|
// DPT 26.* - Scene Info
|
||||||
if (datatype.mainGroup == 26 && datatype.subGroup == 1 && datatype.index <= 1)
|
if (datatype.mainGroup == 26 && datatype.subGroup == 1 && datatype.index <= 1)
|
||||||
return valueToBusValueSceneInfo(value, payload, payload_length, datatype);
|
return valueToBusValueSceneInfo(value, payload, payload_length, datatype);
|
||||||
|
// DPT 27.001 - 32 Bit Field
|
||||||
|
if (datatype.mainGroup == 27 && datatype.subGroup == 1 && !datatype.index)
|
||||||
|
return valueToBusValueUnsigned32(value, payload, payload_length, datatype);
|
||||||
// DPT 28.* - Unicode String
|
// DPT 28.* - Unicode String
|
||||||
if (datatype.mainGroup == 28 && datatype.subGroup == 1 && !datatype.index)
|
if (datatype.mainGroup == 28 && datatype.subGroup == 1 && !datatype.index)
|
||||||
return valueToBusValueUnicode(value, payload, payload_length, datatype);
|
return valueToBusValueUnicode(value, payload, payload_length, datatype);
|
||||||
|
@ -1205,19 +1205,19 @@ void TpUartDataLinkLayer::processRxQueue()
|
|||||||
void TpUartDataLinkLayer::pushByteToRxQueue(uint8_t byte)
|
void TpUartDataLinkLayer::pushByteToRxQueue(uint8_t byte)
|
||||||
{
|
{
|
||||||
_rxBuffer[_rxBufferFront] = byte;
|
_rxBuffer[_rxBufferFront] = byte;
|
||||||
_rxBufferFront = (_rxBufferFront + 1) % MAX_RX_QUEUE_BYTES;
|
_rxBufferFront = (_rxBufferFront + 1) % (MAX_RX_QUEUE_BYTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t TpUartDataLinkLayer::pullByteFromRxQueue()
|
uint8_t TpUartDataLinkLayer::pullByteFromRxQueue()
|
||||||
{
|
{
|
||||||
uint8_t byte = _rxBuffer[_rxBufferRear];
|
uint8_t byte = _rxBuffer[_rxBufferRear];
|
||||||
_rxBufferRear = (_rxBufferRear + 1) % MAX_RX_QUEUE_BYTES;
|
_rxBufferRear = (_rxBufferRear + 1) % (MAX_RX_QUEUE_BYTES);
|
||||||
return byte;
|
return byte;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t TpUartDataLinkLayer::availableInRxQueue()
|
uint16_t TpUartDataLinkLayer::availableInRxQueue()
|
||||||
{
|
{
|
||||||
return ((_rxBufferFront == _rxBufferRear) ? MAX_RX_QUEUE_BYTES : (((MAX_RX_QUEUE_BYTES - _rxBufferFront) + _rxBufferRear) % MAX_RX_QUEUE_BYTES)) - 1;
|
return ((_rxBufferFront == _rxBufferRear) ? (MAX_RX_QUEUE_BYTES) : ((((MAX_RX_QUEUE_BYTES) - _rxBufferFront) + _rxBufferRear) % (MAX_RX_QUEUE_BYTES))) - 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user