Commit 8cd75e9424369c930a1f77fe2fbecf6611ffc404

Authored by Miguel Angel Reina Ortega
1 parent 0c52a6ca

Correction for deregistration within f_cse_postamble_deleteResourcesCSE

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
Showing 1 changed file with 16 additions and 14 deletions
... ... @@ -1062,20 +1062,22 @@ module OneM2M_Functions {
1062 1062 }
1063 1063  
1064 1064 if(not(v_deregistrationPerformed)) {
1065   - //Deregistration by Registree (IUT) - Send trigger message for deregistration
1066   - v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(vc_localRemoteCseIndex);
1067   - f_sendUtPrimitive(v_utRequest, v_action & f_getLocalResourceAddress(vc_localRemoteCseIndex));
1068   -
1069   - tc_ac.start;
1070   - alt {
1071   - [] mccPortIn.receive(mw_request(mw_delete(f_getLocalResourceAddress(vc_localRemoteCseIndex)))) -> value vc_request {
1072   - tc_ac.stop;
1073   - f_processDeleteRequestPrimitive(vc_request.primitive.requestPrimitive);
1074   - mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
1075   - log(__SCOPE__&": INFO: Deregistration performed successfully");
1076   - }
1077   - [] tc_ac.timeout {
1078   - log(__SCOPE__&": INFO: No deregistration performed");
  1065 + if(vc_localRemoteCseIndex != -1) {
  1066 + //Deregistration by Registree (IUT) - Send trigger message for deregistration
  1067 + v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(vc_localRemoteCseIndex);
  1068 + f_sendUtPrimitive(v_utRequest, v_action & f_getLocalResourceAddress(vc_localRemoteCseIndex));
  1069 +
  1070 + tc_ac.start;
  1071 + alt {
  1072 + [] mccPortIn.receive(mw_request(mw_delete(f_getLocalResourceAddress(vc_localRemoteCseIndex)))) -> value vc_request {
  1073 + tc_ac.stop;
  1074 + f_processDeleteRequestPrimitive(vc_request.primitive.requestPrimitive);
  1075 + mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
  1076 + log(__SCOPE__&": INFO: Deregistration performed successfully");
  1077 + }
  1078 + [] tc_ac.timeout {
  1079 + log(__SCOPE__&": INFO: No deregistration performed");
  1080 + }
1079 1081 }
1080 1082 }
1081 1083 }
... ...