mbed.org local branch of microbit-dal. The real version lives in git at https://github.com/lancaster-university/microbit-dal

Dependencies:   BLE_API nRF51822 mbed-dev-bin

Dependents:   microbit Microbit IoTChallenge1 microbit ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MESEvents.h Source File

MESEvents.h

00001 /*
00002 The MIT License (MIT)
00003 
00004 Copyright (c) 2016 British Broadcasting Corporation.
00005 This software is provided by Lancaster University by arrangement with the BBC.
00006 
00007 Permission is hereby granted, free of charge, to any person obtaining a
00008 copy of this software and associated documentation files (the "Software"),
00009 to deal in the Software without restriction, including without limitation
00010 the rights to use, copy, modify, merge, publish, distribute, sublicense,
00011 and/or sell copies of the Software, and to permit persons to whom the
00012 Software is furnished to do so, subject to the following conditions:
00013 
00014 The above copyright notice and this permission notice shall be included in
00015 all copies or substantial portions of the Software.
00016 
00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00018 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00020 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00021 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00022 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00023 DEALINGS IN THE SOFTWARE.
00024 */
00025 
00026 #ifndef MES_EVENTS_H
00027 #define MES_EVENTS_H
00028 
00029 //
00030 // MicroBit Event Service Event ID's and values
00031 //
00032 
00033 //
00034 // Events that master devices respond to:
00035 //
00036 #define MES_REMOTE_CONTROL_ID               1001
00037 #define MES_REMOTE_CONTROL_EVT_PLAY         1
00038 #define MES_REMOTE_CONTROL_EVT_PAUSE        2
00039 #define MES_REMOTE_CONTROL_EVT_STOP         3
00040 #define MES_REMOTE_CONTROL_EVT_NEXTTRACK    4
00041 #define MES_REMOTE_CONTROL_EVT_PREVTRACK    5
00042 #define MES_REMOTE_CONTROL_EVT_FORWARD      6
00043 #define MES_REMOTE_CONTROL_EVT_REWIND       7
00044 #define MES_REMOTE_CONTROL_EVT_VOLUMEUP     8
00045 #define MES_REMOTE_CONTROL_EVT_VOLUMEDOWN   9
00046 
00047 
00048 #define MES_CAMERA_ID                       1002
00049 #define MES_CAMERA_EVT_LAUNCH_PHOTO_MODE    1
00050 #define MES_CAMERA_EVT_LAUNCH_VIDEO_MODE    2
00051 #define MES_CAMERA_EVT_TAKE_PHOTO           3
00052 #define MES_CAMERA_EVT_START_VIDEO_CAPTURE  4
00053 #define MES_CAMERA_EVT_STOP_VIDEO_CAPTURE   5
00054 #define MES_CAMERA_EVT_STOP_PHOTO_MODE      6
00055 #define MES_CAMERA_EVT_STOP_VIDEO_MODE      7
00056 #define MES_CAMERA_EVT_TOGGLE_FRONT_REAR    8
00057 
00058 
00059 #define MES_ALERTS_ID                       1004
00060 #define MES_ALERT_EVT_DISPLAY_TOAST         1
00061 #define MES_ALERT_EVT_VIBRATE               2
00062 #define MES_ALERT_EVT_PLAY_SOUND            3
00063 #define MES_ALERT_EVT_PLAY_RINGTONE         4
00064 #define MES_ALERT_EVT_FIND_MY_PHONE         5
00065 #define MES_ALERT_EVT_ALARM1                6
00066 #define MES_ALERT_EVT_ALARM2                7
00067 #define MES_ALERT_EVT_ALARM3                8
00068 #define MES_ALERT_EVT_ALARM4                9
00069 #define MES_ALERT_EVT_ALARM5                10
00070 #define MES_ALERT_EVT_ALARM6                11
00071 
00072 //
00073 // Events that master devices generate:
00074 //
00075 #define MES_SIGNAL_STRENGTH_ID              1101
00076 #define MES_SIGNAL_STRENGTH_EVT_NO_BAR      1
00077 #define MES_SIGNAL_STRENGTH_EVT_ONE_BAR     2
00078 #define MES_SIGNAL_STRENGTH_EVT_TWO_BAR     3
00079 #define MES_SIGNAL_STRENGTH_EVT_THREE_BAR   4
00080 #define MES_SIGNAL_STRENGTH_EVT_FOUR_BAR    5
00081 
00082 
00083 #define MES_DEVICE_INFO_ID                  1103
00084 #define MES_DEVICE_ORIENTATION_LANDSCAPE    1
00085 #define MES_DEVICE_ORIENTATION_PORTRAIT     2
00086 #define MES_DEVICE_GESTURE_NONE             3
00087 #define MES_DEVICE_GESTURE_DEVICE_SHAKEN    4
00088 #define MES_DEVICE_DISPLAY_OFF              5
00089 #define MES_DEVICE_DISPLAY_ON               6
00090 #define MES_DEVICE_INCOMING_CALL            7
00091 #define MES_DEVICE_INCOMING_MESSAGE         8
00092 
00093 
00094 #define MES_DPAD_CONTROLLER_ID              1104
00095 #define MES_DPAD_BUTTON_A_DOWN              1
00096 #define MES_DPAD_BUTTON_A_UP                2
00097 #define MES_DPAD_BUTTON_B_DOWN              3
00098 #define MES_DPAD_BUTTON_B_UP                4
00099 #define MES_DPAD_BUTTON_C_DOWN              5
00100 #define MES_DPAD_BUTTON_C_UP                6
00101 #define MES_DPAD_BUTTON_D_DOWN              7
00102 #define MES_DPAD_BUTTON_D_UP                8
00103 #define MES_DPAD_BUTTON_1_DOWN              9
00104 #define MES_DPAD_BUTTON_1_UP                10
00105 #define MES_DPAD_BUTTON_2_DOWN              11
00106 #define MES_DPAD_BUTTON_2_UP                12
00107 #define MES_DPAD_BUTTON_3_DOWN              13
00108 #define MES_DPAD_BUTTON_3_UP                14
00109 #define MES_DPAD_BUTTON_4_DOWN              15
00110 #define MES_DPAD_BUTTON_4_UP                16
00111 
00112 //
00113 // Events that typically use radio broadcast:
00114 //
00115 #define MES_BROADCAST_GENERAL_ID            2000
00116 
00117 #endif