* @brief Unregister for a particular event *************************************************************/
| 2349 | * @brief Unregister for a particular event |
| 2350 | *************************************************************/ |
| 2351 | bool Kernel::UnregisterForAgentEvent(int callbackID) |
| 2352 | { |
| 2353 | // Build a test object for the callbackID we're interested in |
| 2354 | TestAgentCallback test(callbackID) ; |
| 2355 | |
| 2356 | // Find the event ID for this callbackID |
| 2357 | smlAgentEventId id = m_AgentEventMap.findFirstKeyByTest(&test, smlAGENT_EVENT_BAD) ; |
| 2358 | |
| 2359 | if (id == smlAGENT_EVENT_BAD) |
| 2360 | { |
| 2361 | return false ; |
| 2362 | } |
| 2363 | |
| 2364 | // Remove the handler from our map |
| 2365 | m_AgentEventMap.removeAllByTest(&test) ; |
| 2366 | |
| 2367 | // If we just removed the last handler, then unregister from the kernel for this event |
| 2368 | if (m_AgentEventMap.getListSize(id) == 0) |
| 2369 | { |
| 2370 | UnregisterForEventWithKernel(id, NULL) ; |
| 2371 | } |
| 2372 | |
| 2373 | return true ; |
| 2374 | } |
| 2375 | |
| 2376 | /************************************************************* |
| 2377 | * @brief The smlEVENT_INTERRUPT_CHECK event fires every n-th |