javamanager/javacaptain/extensionplugins/boot/inc/booteventprovidermessages.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  BootEventProviderMessages
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef BOOTEVENTPROVIDERMESSAGES_H
       
    19 #define BOOTEVENTPROVIDERMESSAGES_H
       
    20 
       
    21 #include "logger.h"
       
    22 #include "commsmessage.h"
       
    23 
       
    24 namespace java
       
    25 {
       
    26 namespace captain
       
    27 {
       
    28 
       
    29 using namespace java::util;
       
    30 using namespace java::comms;
       
    31 
       
    32 const int BOOT_EVENT_MESSAGE_ID_BOOT_C = 1;
       
    33 
       
    34 const char BOOT_EVENT_PROVIDER[] = "boot";
       
    35 
       
    36 typedef enum
       
    37 {
       
    38     NORMAL_BOOT_C           = 0x00,
       
    39     FIRST_DEVICE_BOOT_C     = 0x01, // device is started first time after flashing
       
    40     IAD_BOOT_C              = 0x02  // device is started after IAD installation
       
    41 } bootEventType_t;
       
    42 
       
    43 inline void setBootMessageParams(CommsMessage& aMessage, const int& aBootTypeMask)
       
    44 {
       
    45     aMessage.setMessageId(BOOT_EVENT_MESSAGE_ID_BOOT_C);
       
    46     aMessage << aBootTypeMask;
       
    47 }
       
    48 
       
    49 inline void getBootMessageParams(CommsMessage& aMessage, int& aBootTypeMask)
       
    50 {
       
    51     if (aMessage.getMessageId() == BOOT_EVENT_MESSAGE_ID_BOOT_C)
       
    52     {
       
    53         aMessage >> aBootTypeMask;
       
    54     }
       
    55     else
       
    56     {
       
    57         ELOG2(EJavaCaptain, "wrong MessageId!: %d should be %d",
       
    58               aMessage.getMessageId(), BOOT_EVENT_MESSAGE_ID_BOOT_C);
       
    59         aBootTypeMask = 0;
       
    60     }
       
    61 }
       
    62 
       
    63 
       
    64 
       
    65 } // namespace captain
       
    66 } // namespace java
       
    67 
       
    68 #endif // BOOTEVENTPROVIDERMESSAGES_H