Skip to content

Commit

Permalink
Fix duplicate RAW mode
Browse files Browse the repository at this point in the history
Verif previous sqn to know if it's new or no
(used when attr responses contain multi attr)
  • Loading branch information
fairecasoimeme committed Jan 25, 2021
1 parent 80a1cc6 commit 20c051c
Showing 1 changed file with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ void vAPP_ZCL_DeviceSpecific_Init ( void );
/****************************************************************************/
/*** Local Variables ***/
/****************************************************************************/
uint8_t tmpSqn=0;
tsZLO_ControlBridgeDevice sControlBridge;
tsCLD_ZllDeviceTable sDeviceTable = { ZLO_NUMBER_DEVICES,
{ { 0,
Expand Down Expand Up @@ -432,22 +433,29 @@ PRIVATE void APP_ZCL_cbEndpointCallback ( tsZCL_CallBackEvent* psEvent )
//ZNC_BUF_U8_UPD ( &au8LinkTxBuffer [u16Length], psEvent->pZPSevent->uEvent.sApsDataIndEvent.u8LinkQuality, u16Length );
//vSL_WriteMessage ( 0x9999, u16Length,au8LinkTxBuffer,u8LinkQuality);
u16Length = 0;

if (sZllState.u8RawMode == RAW_MODE_ON){
ZPS_tsAfEvent* psStackEvent = psEvent->pZPSevent;
if (psEvent->eEventType != E_ZCL_CBET_CLUSTER_UPDATE &&
psEvent->eEventType != E_ZCL_CBET_UNHANDLED_EVENT &&
psEvent->eEventType != E_ZCL_CBET_REPORT_ATTRIBUTES &&
psEvent->eEventType != E_ZCL_CBET_READ_ATTRIBUTES_RESPONSE
)

if (tmpSqn!=psEvent->u8TransactionSequenceNumber)
{
Znc_vSendDataIndicationToHost(psStackEvent, au8LinkTxBuffer);
return;
tmpSqn=psEvent->u8TransactionSequenceNumber;
if (psEvent->eEventType != E_ZCL_CBET_CLUSTER_UPDATE &&
psEvent->eEventType != E_ZCL_CBET_UNHANDLED_EVENT &&
psEvent->eEventType != E_ZCL_CBET_REPORT_ATTRIBUTES &&
psEvent->eEventType != E_ZCL_CBET_READ_ATTRIBUTES_RESPONSE
)
{
Znc_vSendDataIndicationToHost(psStackEvent, au8LinkTxBuffer);
return;
}
}else{
return;
}
}

switch (psEvent->eEventType)
{

case E_ZCL_CBET_READ_REQUEST:
{
vLog_Printf(TRACE_ZCL, LOG_DEBUG, "EP EVT:E_ZCL_CBET_READ_REQUEST\r\n");
Expand Down

1 comment on commit 20c051c

@fairecasoimeme
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.