API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
See Also
This function allows a callback to be registered with the AEE shell. It adds the callback to the AEE shell's list of pending operations. The AEE shell invokes the callback function the next time the event loop is called, allowing an application or object to cooperatively multitask. If the callback has already been registered, it is cancelled (de-registered) and then re-registered.
Pointer to the IShell interface object.
Pointer to the AEECallback structure. When the application invokes this function, the following members in the AEECallback structure must be set by the caller.
  • - pfnNotify member must be filled by the caller. This is the callback
  • function that is invoked by AEE when the event loop is called.

  • - pNotifyData must be filled by the caller. This is the data that is passed
  • to the callback function.

  • - pfnCancel member must be set to NULL by the caller before registering
  • the callback for the first time. The AEE shell fills this member with
  • the right value when this function returns.
  •     void ISHELL_Resume(IShell * pIShell, AEECallback * pcb);
  • None
Side Effect
  • If pcb is already scheduled on a different callback list, it is cancelled.
When ISHELL_Resume() is used, the AEE shell automatically fills up some of the data members of the AEECallback structure passed to it (for example, the members pfnCancel and pCancelData are filled by the AEE shell). To cancel a callback that has been registered, use the pfnCancel member of the AEECallback structure and pass the pCancelData as a parameter to it. The following example assumes that pme refers to the applet struct and that pme->m_cb refers to the AEECallback structure in applet data. Example: The following example shows how the ISHELL_Resume() works. // Fill up the members of the callback structure. pme->m_cb.pfnNotify = MyCB; // My callback function. It must be declared. // as void MyCB(void *) pme->m_cb.pNotifyData = pme; // Applet-specific data. pme->m_cb.pfnCancel = NULL; // Initialize to NULL. It is updated by the shell. //To register the callback do the following: ISHELL_Resume(pme->a.m_pIShell,&pme->m_cb); // To cancel the callback do the following: if(pme->m_cb.pfnCancel) pme->m_cb.pfnCancel(&pme->m_cb);