//============================================================================= // METHOD: SPELLserverCif::notifyVariableChange() //============================================================================= void SPELLserverCif::notifyVariableChange( const std::vector<SPELLvarInfo>& changed ) { SPELLipcMessage notifyMsg(ExecutorMessages::MSG_VARIABLE_CHANGE); notifyMsg.setType(MSG_TYPE_ONEWAY); std::string names = ""; std::string types = ""; std::string values = ""; std::string globals = ""; for( unsigned int index = 0; index<changed.size(); index++) { if (names != "") { names += ",,"; types += ",,"; values += ",,"; globals += ",,"; } names += changed[index].varName; types += changed[index].varType; values += changed[index].varValue; globals += changed[index].isGlobal ? "True" : "False"; } notifyMsg.set( MessageField::FIELD_PROC_ID, getProcId() ); notifyMsg.set(MessageField::FIELD_VARIABLE_NAME, names); notifyMsg.set(MessageField::FIELD_VARIABLE_TYPE, types); notifyMsg.set(MessageField::FIELD_VARIABLE_VALUE, values); notifyMsg.set(MessageField::FIELD_VARIABLE_GLOBAL, globals); sendGUIMessage(¬ifyMsg); }
int WifiMessageHandler::sendNotificationEvent(void* aEventMsg, size_t aLength) { int ret; WifiNotificationMessage<struct WifiMsgNotifyEvent> notifyMsg( reinterpret_cast<uint8_t*>(aEventMsg), aLength); ret = sendMsg(notifyMsg.getBuffer(), notifyMsg.getLength()); if (ret < 0) { WIFID_ERROR("Fail on sending the notification(%s).", strerror(errno)); } return ret; }
//============================================================================= // METHOD: SPELLserverCif::notifyVariableScopeChange() //============================================================================= void SPELLserverCif::notifyVariableScopeChange( const SPELLscopeInfo& info ) { SPELLipcMessage notifyMsg(ExecutorMessages::MSG_SCOPE_CHANGE); notifyMsg.setType(MSG_TYPE_ONEWAY); notifyMsg.set( MessageField::FIELD_PROC_ID, getProcId() ); std::string varNames = ""; std::string varTypes = ""; std::string varValues = ""; std::string varGlobals = ""; for( unsigned int index = 0; index < info.globalRegisteredVariables.size(); index++) { if (varNames != "") { varNames += ",,"; varTypes += ",,"; varValues += ",,"; varGlobals += ",,"; } varNames += info.globalRegisteredVariables[index].varName; varTypes += info.globalRegisteredVariables[index].varType; varValues += info.globalRegisteredVariables[index].varValue; varGlobals += "True"; } for( unsigned int index = 0; index < info.localRegisteredVariables.size(); index++) { if (varNames != "") { varNames += ",,"; varTypes += ",,"; varValues += ",,"; varGlobals += ",,"; } varNames += info.localRegisteredVariables[index].varName; varTypes += info.localRegisteredVariables[index].varType; varValues += info.localRegisteredVariables[index].varValue; varGlobals += "False"; } notifyMsg.set(MessageField::FIELD_VARIABLE_NAME, varNames); notifyMsg.set(MessageField::FIELD_VARIABLE_TYPE, varTypes); notifyMsg.set(MessageField::FIELD_VARIABLE_VALUE, varValues); notifyMsg.set(MessageField::FIELD_VARIABLE_GLOBAL, varGlobals); sendGUIMessage(¬ifyMsg); }