Skip to content
Snippets Groups Projects
Commit 7d279243 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Change MQTT topic for other than CREATE operations before registration

parent e0393c76
No related branches found
No related tags found
2 merge requests!63Merge Release4-onwards into Release4,!62Merge Release2-onwards into Release2
......@@ -5629,7 +5629,7 @@ module OneM2M_Functions {
* @param data Corresponding information for the correct execution of the given action
* @verdict
*/
function f_sendAcPrimitive(in charstring p_event, in integer p_resourceIndex) runs on Tester {
function f_sendAcPrimitive(in charstring p_event, in integer p_resourceIndex, template (omit) XSD.ID p_originator := omit) runs on Tester {
var XSD.ID v_aeResourceAddress;
var charstring v_spRelativeAeIdForMqtt;
......@@ -5675,7 +5675,7 @@ module OneM2M_Functions {
}
}
case ("MqttSetDefaultTopicToNotRegistration") {
acPort.send(AcRequestPrimitive:{p_event, {charstring := int2str(p_resourceIndex)}});
acPort.send(AcRequestPrimitive:{p_event, {charstring := oct2str(unichar2oct(p_originator))}});
}
case ("MqttSetDefaultTopicToRegistration") {
acPort.send(AcRequestPrimitive:{p_event, {charstring := int2str(p_resourceIndex)}});
......@@ -6010,13 +6010,17 @@ module OneM2M_Functions {
if(ispresent(p_msgOut.primitive.requestPrimitive.resourceType)) {
if((valueof(p_msgOut.primitive.requestPrimitive.resourceType) != int2) and (valueof(p_msgOut.primitive.requestPrimitive.resourceType) != int16)){
//Modify default topic to publish a non-registration message
f_sendAcPrimitive("MqttSetDefaultTopicToNotRegistration", -1);
f_sendAcPrimitive("MqttSetDefaultTopicToNotRegistration", -1, valueof(p_msgOut.primitive.requestPrimitive.from_));
vc_myInterfaces[enum2int(p_interfaceIds)].myPort.send(p_msgOut);
f_sendAcPrimitive("MqttSetDefaultTopicToRegistration", -1);
return;
} //else {
//f_sendAcPrimitive("MqttSetDefaultTopicToRegistration", -1);
//}
}
} else {//RETRIEVE - UPDATE - DELETE - NOTIFY
//Modify default topic to publish a non-registration message
f_sendAcPrimitive("MqttSetDefaultTopicToNotRegistration", -1, valueof(p_msgOut.primitive.requestPrimitive.from_));
vc_myInterfaces[enum2int(p_interfaceIds)].myPort.send(p_msgOut);
f_sendAcPrimitive("MqttSetDefaultTopicToRegistration", -1);
return;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment