CAmvConn:SetAction()

Mark the alarm with up to two actions to be sent to the AMRP the next time UpdateList() is called.

Comments

Up to two actions may be set in a two-character string. The valid characters are:

AM_ACK_CHAR

Acknowledge the alarm

AM_CLR_CHAR

Clear the alarm

AM_DEL_CHAR

Delete the alarm

A blank character string indicates no action.

Clearing an alarm requires that the user be allowed to manually clear alarms. This may be checked with CAmvAlarm::ManualClearAllowed().

Deleting an alarm requires that the user be allowed to manually delete alarms. This may be checked with CAmvAlarm::DeleteAllowed().

Syntax

SetAction(const AlarmInfo *pAI, const TCHAR *action,

          COR_STATUS *ret_stat);

Data Type

void

Example

Delete an alarm, if allowed. Return TRUE if successful, FALSE otherwise.

Int DeleteAlarm(CAmvConn* amvConn,

                struct AlarmInfo *pAlarmInfo);

{

   TCHAR action[3];

   if (amvConn->DeleteAllowed())

     {

       _tcsncpy(action, _T(" ");

       action[0] = AM_DEL_CHAR;

       amvConn->SetAction(pAlarmInfo, action, &status);

       amvConn->UpdateList(&status);

       return TRUE;

     }

     else

     {

       return FALSE;

     }

}

See Also

CAmvConn::UpdateList() , CAmvAlarm::ManualClearAllowed() ,

CAmvConn::DeleteAllowed()

More information

CAmvConn class member overview.