mirror of
https://github.com/thelsing/knx.git
synced 2024-12-29 00:05:42 +01:00
add some fixes and enhancements by leoujz
fix build
This commit is contained in:
parent
87a12fa26a
commit
4677044f46
@ -487,7 +487,7 @@ void ApplicationLayer::systemNetworkParameterReadResponse(Priority priority, Hop
|
|||||||
|
|
||||||
//TODO: ApplicationLayer::domainAddressSerialNumberWriteRequest()
|
//TODO: ApplicationLayer::domainAddressSerialNumberWriteRequest()
|
||||||
//TODO: ApplicationLayer::domainAddressSerialNumberReadRequest()
|
//TODO: ApplicationLayer::domainAddressSerialNumberReadRequest()
|
||||||
void ApplicationLayer::domainAddressSerialNumberReadResponse(Priority priority, HopCountType hopType, uint8_t* rfDoA,
|
void ApplicationLayer::domainAddressSerialNumberReadResponse(Priority priority, HopCountType hopType, const uint8_t* rfDoA,
|
||||||
const uint8_t* knxSerialNumber)
|
const uint8_t* knxSerialNumber)
|
||||||
{
|
{
|
||||||
CemiFrame frame(13);
|
CemiFrame frame(13);
|
||||||
@ -506,8 +506,8 @@ void ApplicationLayer::domainAddressSerialNumberReadResponse(Priority priority,
|
|||||||
|
|
||||||
//TODO: ApplicationLayer::IndividualAddressSerialNumberWriteRequest()
|
//TODO: ApplicationLayer::IndividualAddressSerialNumberWriteRequest()
|
||||||
//TODO: ApplicationLayer::IndividualAddressSerialNumberReadRequest()
|
//TODO: ApplicationLayer::IndividualAddressSerialNumberReadRequest()
|
||||||
void ApplicationLayer::IndividualAddressSerialNumberReadResponse(Priority priority, HopCountType hopType, uint8_t* rfDoA,
|
void ApplicationLayer::IndividualAddressSerialNumberReadResponse(Priority priority, HopCountType hopType, const uint8_t* rfDoA,
|
||||||
uint8_t* knxSerialNumber)
|
const uint8_t* knxSerialNumber)
|
||||||
{
|
{
|
||||||
CemiFrame frame(13);
|
CemiFrame frame(13);
|
||||||
APDU& apdu = frame.apdu();
|
APDU& apdu = frame.apdu();
|
||||||
|
@ -135,10 +135,10 @@ class ApplicationLayer
|
|||||||
void systemNetworkParameterReadResponse(Priority priority, HopCountType hopType, uint16_t objectType,
|
void systemNetworkParameterReadResponse(Priority priority, HopCountType hopType, uint16_t objectType,
|
||||||
uint16_t propertyId, uint8_t* testInfo, uint16_t testInfoLength,
|
uint16_t propertyId, uint8_t* testInfo, uint16_t testInfoLength,
|
||||||
uint8_t* testResult, uint16_t testResultLength);
|
uint8_t* testResult, uint16_t testResultLength);
|
||||||
void domainAddressSerialNumberReadResponse(Priority priority, HopCountType hopType, uint8_t* rfDoA,
|
void domainAddressSerialNumberReadResponse(Priority priority, HopCountType hopType, const uint8_t* rfDoA,
|
||||||
|
const uint8_t* knxSerialNumber);
|
||||||
|
void IndividualAddressSerialNumberReadResponse(Priority priority, HopCountType hopType, const uint8_t* rfDoA,
|
||||||
const uint8_t* knxSerialNumber);
|
const uint8_t* knxSerialNumber);
|
||||||
void IndividualAddressSerialNumberReadResponse(Priority priority, HopCountType hopType, uint8_t* rfDoA,
|
|
||||||
uint8_t* knxSerialNumber);
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -323,9 +323,9 @@ uint8_t* CemiFrame::rfSerialOrDoA() const
|
|||||||
return _rfSerialOrDoA;
|
return _rfSerialOrDoA;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CemiFrame::rfSerialOrDoA(uint8_t* rfSerialOrDoA)
|
void CemiFrame::rfSerialOrDoA(const uint8_t* rfSerialOrDoA)
|
||||||
{
|
{
|
||||||
_rfSerialOrDoA = rfSerialOrDoA;
|
_rfSerialOrDoA = (uint8_t*)rfSerialOrDoA;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t CemiFrame::rfInfo() const
|
uint8_t CemiFrame::rfInfo() const
|
||||||
|
@ -60,7 +60,7 @@ class CemiFrame
|
|||||||
#ifdef USE_RF
|
#ifdef USE_RF
|
||||||
// only for RF medium
|
// only for RF medium
|
||||||
uint8_t* rfSerialOrDoA() const;
|
uint8_t* rfSerialOrDoA() const;
|
||||||
void rfSerialOrDoA(uint8_t* rfSerialOrDoA);
|
void rfSerialOrDoA(const uint8_t* rfSerialOrDoA);
|
||||||
uint8_t rfInfo() const;
|
uint8_t rfInfo() const;
|
||||||
void rfInfo(uint8_t rfInfo);
|
void rfInfo(uint8_t rfInfo);
|
||||||
uint8_t rfLfn() const;
|
uint8_t rfLfn() const;
|
||||||
|
@ -1043,7 +1043,7 @@ int valueToBusValueSigned8(const KNXValue& value, uint8_t* payload, size_t paylo
|
|||||||
if ((int64_t)value < INT64_C(-128) || (int64_t)value > INT64_C(127))
|
if ((int64_t)value < INT64_C(-128) || (int64_t)value > INT64_C(127))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
signed8ToPayload(payload, 0, payload_length, (uint64_t)value, 0xFF);
|
signed8ToPayload(payload, payload_length, 0, (uint64_t)value, 0xFF);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +92,16 @@ void TpUartDataLinkLayer::loop()
|
|||||||
uint8_t* buffer = _receiveBuffer + 2;
|
uint8_t* buffer = _receiveBuffer + 2;
|
||||||
uint8_t rxByte;
|
uint8_t rxByte;
|
||||||
|
|
||||||
|
if (!_enabled)
|
||||||
|
{
|
||||||
|
if (millis() - _lastResetChipTime > 1000)
|
||||||
|
{
|
||||||
|
//reset chip every 1 seconds
|
||||||
|
_lastResetChipTime = millis();
|
||||||
|
_enabled = resetChip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!_enabled)
|
if (!_enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -429,12 +439,14 @@ void TpUartDataLinkLayer::enabled(bool value)
|
|||||||
{
|
{
|
||||||
_platform.setupUart();
|
_platform.setupUart();
|
||||||
|
|
||||||
if (resetChip()){
|
if (resetChip())
|
||||||
|
{
|
||||||
_enabled = true;
|
_enabled = true;
|
||||||
print("ownaddr ");
|
print("ownaddr ");
|
||||||
println(_deviceObject.induvidualAddress(), HEX);
|
println(_deviceObject.induvidualAddress(), HEX);
|
||||||
}
|
}
|
||||||
else{
|
else
|
||||||
|
{
|
||||||
_enabled = false;
|
_enabled = false;
|
||||||
println("ERROR, TPUART not responding");
|
println("ERROR, TPUART not responding");
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ class TpUartDataLinkLayer : public DataLinkLayer
|
|||||||
uint8_t _xorSum = 0;
|
uint8_t _xorSum = 0;
|
||||||
uint32_t _lastByteRxTime;
|
uint32_t _lastByteRxTime;
|
||||||
uint32_t _waitConfirmStartTime;
|
uint32_t _waitConfirmStartTime;
|
||||||
|
uint32_t _lastResetChipTime = 0;
|
||||||
|
|
||||||
struct _tx_queue_frame_t
|
struct _tx_queue_frame_t
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user