We have ported the stack suitable for (B-SA) in PICS32 micro controller. We are facing issue of Controller not sending confirmed COV Notifcation when they are triggered. After a bit of analysis we noticed that the following code in the file h_cov.c under the function cov_send_request() is not getting executed:
if (invoke_id) {
cov_subscription->invokeID = invoke_id;
len = ccov_notify_encode_apdu(&Handler_Transmit_Buffer[pdu_len],
sizeof(Handler_Transmit_Buffer) - pdu_len, invoke_id,
&cov_data);
Is it because tsm_next_free_invokeID() is not returning invokeID?
Please help to resolve the issue.
Thanks & Regards,
Kishore
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The example handler for COV should be using a transaction from the TSM pool, and then freeing it when the transaction is sent (for confirmed COV, not for unconfirmed COV). Without reviewing the code in question, and the version of the stack, it's not possible to know why ConfirmedCOV notififications are not being sent.
Are you defining MAX_TSM_TRANSACTIONS=1 (or more) in your build?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Steve,
After looking at your comments, we noticed that we never call the following code in our application
handler_cov_timer_seconds(elapsed_seconds),
tsm_timer_milliseconds(elapsed_milliseconds);
Though without the above two lines, ucov notification works. Is the problem related to the absence of the above two lines?
In the demo like server, these lines are present in main function. But our application is a bit complex having bluetooth connectivity running and other IP related application running along with BACnet. In that case based on your experience please suggest where could these timer related lines be placed for the right behavior?
Thanks,
Kishore
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
voidbacnet_init(void)
{
...
/* initialize the time base for DCC */timer_interval_start_seconds(&DCC_Timer,1);/* start the cyclic 1 second timer for COV */timer_interval_start_seconds(&COV_Timer,1);/* start the cyclic 1 second timer for TSM */timer_interval_start_seconds(&TSM_Timer,1);
}
voidbacnet_task(void)
{
...
/* handle the timers */if(timer_interval_expired(&DCC_Timer)){
timer_interval_reset(&DCC_Timer);dcc_timer_seconds(timer_interval_seconds(&DCC_Timer));}
if(timer_interval_expired(&COV_Timer)){
timer_interval_reset(&COV_Timer);if(dcc_communication_enabled()){
handler_cov_timer_seconds(timer_interval(&COV_Timer)/1000);}
}
if(timer_interval_expired(&TSM_Timer)){
timer_interval_reset(&TSM_Timer);
#ifMAX_TSM_TRANSACTIONStsm_timer_milliseconds(timer_interval(&TSM_Timer));
#endif}
handler_cov_task();
...
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your timely help and valuable information. I am sorry that I did not respond to you on time. With the above code, COV worked.
Only thing I noticed now is while responding for the Active_COV_Subscriptions, the port is reversed. That is instead of BA C0, the response has C0 BA. I am looking at the code to fix.
Thanks once again.
Kishore
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The BACnet dest address used in COV notifications is copied from src address which comes from whatever module is being used for incoming datalink handler and passed to the npdu_handler() and apdu_handler() and then handler_cov_subscribe() function. Are you using BACnet/IP or MSTP or some other datalink?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We have ported the stack suitable for (B-SA) in PICS32 micro controller. We are facing issue of Controller not sending confirmed COV Notifcation when they are triggered. After a bit of analysis we noticed that the following code in the file h_cov.c under the function cov_send_request() is not getting executed:
if (invoke_id) {
cov_subscription->invokeID = invoke_id;
len = ccov_notify_encode_apdu(&Handler_Transmit_Buffer[pdu_len],
sizeof(Handler_Transmit_Buffer) - pdu_len, invoke_id,
&cov_data);
Is it because tsm_next_free_invokeID() is not returning invokeID?
Please help to resolve the issue.
Thanks & Regards,
Kishore
The example handler for COV should be using a transaction from the TSM pool, and then freeing it when the transaction is sent (for confirmed COV, not for unconfirmed COV). Without reviewing the code in question, and the version of the stack, it's not possible to know why ConfirmedCOV notififications are not being sent.
Are you defining MAX_TSM_TRANSACTIONS=1 (or more) in your build?
MAX_TSM_TRANSACTIONS=5
Steve,
After looking at your comments, we noticed that we never call the following code in our application
handler_cov_timer_seconds(elapsed_seconds),
tsm_timer_milliseconds(elapsed_milliseconds);
Though without the above two lines, ucov notification works. Is the problem related to the absence of the above two lines?
In the demo like server, these lines are present in main function. But our application is a bit complex having bluetooth connectivity running and other IP related application running along with BACnet. In that case based on your experience please suggest where could these timer related lines be placed for the right behavior?
Thanks,
Kishore
The lifetime parameters also did not change.
Here is a snippet from a product using COV:
Hi Steve,
Thanks for your timely help and valuable information. I am sorry that I did not respond to you on time. With the above code, COV worked.
Only thing I noticed now is while responding for the Active_COV_Subscriptions, the port is reversed. That is instead of BA C0, the response has C0 BA. I am looking at the code to fix.
Thanks once again.
Kishore
The BACnet dest address used in COV notifications is copied from src address which comes from whatever module is being used for incoming datalink handler and passed to the npdu_handler() and apdu_handler() and then handler_cov_subscribe() function. Are you using BACnet/IP or MSTP or some other datalink?
Hi,
Please advise how to fix the swapping of MSB and LSB of BACnet Port in the response for Active COV Subscriptions.
Thanks ....
BACnet/IP