MPCallbackType

Definition


#include <revolution/mp.h>

#define MP_CB_GROUP_MASK            0xffff0000
#define MP_CB_GROUP_PORT            0x00000000
#define MP_CB_GROUP_ASYNC           0x00010000
#define MP_CB_GROUP_INDICATION      0x00020000
#define MP_CB_GROUP_MPDS            0x00030000

typedef enum
{
    MP_PORT_CB_TYPE_NONE            = (MP_CB_GROUP_PORT  | 0x00), // Not used
    MP_PORT_CB_TYPE_STARTUP         = (MP_CB_GROUP_PORT  | 0x01),
    MP_PORT_CB_TYPE_CLEANUP         = (MP_CB_GROUP_PORT  | 0x02),
    MP_PORT_CB_TYPE_DATA_RECEIVED   = (MP_CB_GROUP_PORT  | 0x03),
    MP_PORT_CB_TYPE_CONNECTED       = (MP_CB_GROUP_PORT  | 0x04),
    MP_PORT_CB_TYPE_DISCONNECTED    = (MP_CB_GROUP_PORT  | 0x05),
    MP_ASYNC_CB_TYPE_DATA_SENT      = (MP_CB_GROUP_ASYNC | 0x01),
    MP_ASYNC_CB_TYPE_BEACON_SENT    = (MP_CB_GROUP_ASYNC | 0x02),
    MP_INDICATION_CB_TYPE_FATAL_ERROR = (MP_CB_GROUP_INDICATION | 0xff01),
    MPDS_PORT_CB_TYPE_DATASET_RECEIVED = (MP_CB_GROUP_MPDS | 0x01)
} MPCallbackType;

Description

This enumerator indicates the originator of the various MP library callbacks.
Used in the type argument with MPPortCallback(). Also used in the type field of the MPCallbackInfo structure passed by the code argument with MPCallback().

The MPPortCallbackInfo member received by the port receive callback function MPPortCallback() varies, based on the type of the originator.

Member Description
MP_PORT_CB_TYPE_STARTUP Notified to the Port Receive Callback.
Indicates that MP communications have started.
MP_PORT_CB_TYPE_CLEANUP Notified to the Port Receive Callback.
Indicates that MP communications have ended.
MP_PORT_CB_TYPE_DATA_RECEIVED Notified to the Port Receive Callback. No notification is sent to the callback function specified by the MPDS library.
Indicates that data has been received.
MP_PORT_CB_TYPE_CONNECTED Notified to the Port Receive Callback.
Indicates that connection has been made with a child device.
MP_PORT_CB_TYPE_DISCONNECTED Notified to the Port Receive Callback.
Indicates that connection has been ended from a child device.
MP_ASYNC_CB_TYPE_DATA_SENT Indicates that this is the callback for the MPSendAsync() function.
MP_ASYNC_CB_TYPE_BEACON_SENT Indicates that this is the callback for the MPUpdateBeaconAsync() function.
MP_INDICATION_CB_TYPE_FATAL_ERROR Notification is sent to the callback that was set with the MPSetIndicationConfig() function.
Indicates that an unrecoverable error has occurred.
MPDS_PORT_CB_TYPE_DATASET_RECEIVED Notification is sent to the port receipt callback specified by the MPDS library.
Indicates that new shared readable data has been created.

See Also

MPPortCallback(), MPPortCallbackInfo

Revision History

2007/11/28 Changed the name, MPPortCallbackType, to MPCallbackType.
2006/11/28 Initial version.


CONFIDENTIAL