Official Sheffield ARMBand micro:bit program

Committer:
MrBedfordVan
Date:
Mon Oct 17 12:41:20 2016 +0000
Revision:
0:b9164b348919
Official Sheffield ARMBand Micro:bit program

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MrBedfordVan 0:b9164b348919 1 /*
MrBedfordVan 0:b9164b348919 2 The MIT License (MIT)
MrBedfordVan 0:b9164b348919 3
MrBedfordVan 0:b9164b348919 4 Copyright (c) 2016 British Broadcasting Corporation.
MrBedfordVan 0:b9164b348919 5 This software is provided by Lancaster University by arrangement with the BBC.
MrBedfordVan 0:b9164b348919 6
MrBedfordVan 0:b9164b348919 7 Permission is hereby granted, free of charge, to any person obtaining a
MrBedfordVan 0:b9164b348919 8 copy of this software and associated documentation files (the "Software"),
MrBedfordVan 0:b9164b348919 9 to deal in the Software without restriction, including without limitation
MrBedfordVan 0:b9164b348919 10 the rights to use, copy, modify, merge, publish, distribute, sublicense,
MrBedfordVan 0:b9164b348919 11 and/or sell copies of the Software, and to permit persons to whom the
MrBedfordVan 0:b9164b348919 12 Software is furnished to do so, subject to the following conditions:
MrBedfordVan 0:b9164b348919 13
MrBedfordVan 0:b9164b348919 14 The above copyright notice and this permission notice shall be included in
MrBedfordVan 0:b9164b348919 15 all copies or substantial portions of the Software.
MrBedfordVan 0:b9164b348919 16
MrBedfordVan 0:b9164b348919 17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
MrBedfordVan 0:b9164b348919 18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
MrBedfordVan 0:b9164b348919 19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
MrBedfordVan 0:b9164b348919 20 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
MrBedfordVan 0:b9164b348919 21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
MrBedfordVan 0:b9164b348919 22 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
MrBedfordVan 0:b9164b348919 23 DEALINGS IN THE SOFTWARE.
MrBedfordVan 0:b9164b348919 24 */
MrBedfordVan 0:b9164b348919 25
MrBedfordVan 0:b9164b348919 26 #ifndef MES_EVENTS_H
MrBedfordVan 0:b9164b348919 27 #define MES_EVENTS_H
MrBedfordVan 0:b9164b348919 28
MrBedfordVan 0:b9164b348919 29 //
MrBedfordVan 0:b9164b348919 30 // MicroBit Event Service Event ID's and values
MrBedfordVan 0:b9164b348919 31 //
MrBedfordVan 0:b9164b348919 32
MrBedfordVan 0:b9164b348919 33 //
MrBedfordVan 0:b9164b348919 34 // Events that master devices respond to:
MrBedfordVan 0:b9164b348919 35 //
MrBedfordVan 0:b9164b348919 36 #define MES_REMOTE_CONTROL_ID 1001
MrBedfordVan 0:b9164b348919 37 #define MES_REMOTE_CONTROL_EVT_PLAY 1
MrBedfordVan 0:b9164b348919 38 #define MES_REMOTE_CONTROL_EVT_PAUSE 2
MrBedfordVan 0:b9164b348919 39 #define MES_REMOTE_CONTROL_EVT_STOP 3
MrBedfordVan 0:b9164b348919 40 #define MES_REMOTE_CONTROL_EVT_NEXTTRACK 4
MrBedfordVan 0:b9164b348919 41 #define MES_REMOTE_CONTROL_EVT_PREVTRACK 5
MrBedfordVan 0:b9164b348919 42 #define MES_REMOTE_CONTROL_EVT_FORWARD 6
MrBedfordVan 0:b9164b348919 43 #define MES_REMOTE_CONTROL_EVT_REWIND 7
MrBedfordVan 0:b9164b348919 44 #define MES_REMOTE_CONTROL_EVT_VOLUMEUP 8
MrBedfordVan 0:b9164b348919 45 #define MES_REMOTE_CONTROL_EVT_VOLUMEDOWN 9
MrBedfordVan 0:b9164b348919 46
MrBedfordVan 0:b9164b348919 47
MrBedfordVan 0:b9164b348919 48 #define MES_CAMERA_ID 1002
MrBedfordVan 0:b9164b348919 49 #define MES_CAMERA_EVT_LAUNCH_PHOTO_MODE 1
MrBedfordVan 0:b9164b348919 50 #define MES_CAMERA_EVT_LAUNCH_VIDEO_MODE 2
MrBedfordVan 0:b9164b348919 51 #define MES_CAMERA_EVT_TAKE_PHOTO 3
MrBedfordVan 0:b9164b348919 52 #define MES_CAMERA_EVT_START_VIDEO_CAPTURE 4
MrBedfordVan 0:b9164b348919 53 #define MES_CAMERA_EVT_STOP_VIDEO_CAPTURE 5
MrBedfordVan 0:b9164b348919 54 #define MES_CAMERA_EVT_STOP_PHOTO_MODE 6
MrBedfordVan 0:b9164b348919 55 #define MES_CAMERA_EVT_STOP_VIDEO_MODE 7
MrBedfordVan 0:b9164b348919 56 #define MES_CAMERA_EVT_TOGGLE_FRONT_REAR 8
MrBedfordVan 0:b9164b348919 57
MrBedfordVan 0:b9164b348919 58
MrBedfordVan 0:b9164b348919 59 #define MES_ALERTS_ID 1004
MrBedfordVan 0:b9164b348919 60 #define MES_ALERT_EVT_DISPLAY_TOAST 1
MrBedfordVan 0:b9164b348919 61 #define MES_ALERT_EVT_VIBRATE 2
MrBedfordVan 0:b9164b348919 62 #define MES_ALERT_EVT_PLAY_SOUND 3
MrBedfordVan 0:b9164b348919 63 #define MES_ALERT_EVT_PLAY_RINGTONE 4
MrBedfordVan 0:b9164b348919 64 #define MES_ALERT_EVT_FIND_MY_PHONE 5
MrBedfordVan 0:b9164b348919 65 #define MES_ALERT_EVT_ALARM1 6
MrBedfordVan 0:b9164b348919 66 #define MES_ALERT_EVT_ALARM2 7
MrBedfordVan 0:b9164b348919 67 #define MES_ALERT_EVT_ALARM3 8
MrBedfordVan 0:b9164b348919 68 #define MES_ALERT_EVT_ALARM4 9
MrBedfordVan 0:b9164b348919 69 #define MES_ALERT_EVT_ALARM5 10
MrBedfordVan 0:b9164b348919 70 #define MES_ALERT_EVT_ALARM6 11
MrBedfordVan 0:b9164b348919 71
MrBedfordVan 0:b9164b348919 72 //
MrBedfordVan 0:b9164b348919 73 // Events that master devices generate:
MrBedfordVan 0:b9164b348919 74 //
MrBedfordVan 0:b9164b348919 75 #define MES_SIGNAL_STRENGTH_ID 1101
MrBedfordVan 0:b9164b348919 76 #define MES_SIGNAL_STRENGTH_EVT_NO_BAR 1
MrBedfordVan 0:b9164b348919 77 #define MES_SIGNAL_STRENGTH_EVT_ONE_BAR 2
MrBedfordVan 0:b9164b348919 78 #define MES_SIGNAL_STRENGTH_EVT_TWO_BAR 3
MrBedfordVan 0:b9164b348919 79 #define MES_SIGNAL_STRENGTH_EVT_THREE_BAR 4
MrBedfordVan 0:b9164b348919 80 #define MES_SIGNAL_STRENGTH_EVT_FOUR_BAR 5
MrBedfordVan 0:b9164b348919 81
MrBedfordVan 0:b9164b348919 82
MrBedfordVan 0:b9164b348919 83 #define MES_DEVICE_INFO_ID 1103
MrBedfordVan 0:b9164b348919 84 #define MES_DEVICE_ORIENTATION_LANDSCAPE 1
MrBedfordVan 0:b9164b348919 85 #define MES_DEVICE_ORIENTATION_PORTRAIT 2
MrBedfordVan 0:b9164b348919 86 #define MES_DEVICE_GESTURE_NONE 3
MrBedfordVan 0:b9164b348919 87 #define MES_DEVICE_GESTURE_DEVICE_SHAKEN 4
MrBedfordVan 0:b9164b348919 88 #define MES_DEVICE_DISPLAY_OFF 5
MrBedfordVan 0:b9164b348919 89 #define MES_DEVICE_DISPLAY_ON 6
MrBedfordVan 0:b9164b348919 90 #define MES_DEVICE_INCOMING_CALL 7
MrBedfordVan 0:b9164b348919 91 #define MES_DEVICE_INCOMING_MESSAGE 8
MrBedfordVan 0:b9164b348919 92
MrBedfordVan 0:b9164b348919 93
MrBedfordVan 0:b9164b348919 94 #define MES_DPAD_CONTROLLER_ID 1104
MrBedfordVan 0:b9164b348919 95 #define MES_DPAD_BUTTON_A_DOWN 1
MrBedfordVan 0:b9164b348919 96 #define MES_DPAD_BUTTON_A_UP 2
MrBedfordVan 0:b9164b348919 97 #define MES_DPAD_BUTTON_B_DOWN 3
MrBedfordVan 0:b9164b348919 98 #define MES_DPAD_BUTTON_B_UP 4
MrBedfordVan 0:b9164b348919 99 #define MES_DPAD_BUTTON_C_DOWN 5
MrBedfordVan 0:b9164b348919 100 #define MES_DPAD_BUTTON_C_UP 6
MrBedfordVan 0:b9164b348919 101 #define MES_DPAD_BUTTON_D_DOWN 7
MrBedfordVan 0:b9164b348919 102 #define MES_DPAD_BUTTON_D_UP 8
MrBedfordVan 0:b9164b348919 103 #define MES_DPAD_BUTTON_1_DOWN 9
MrBedfordVan 0:b9164b348919 104 #define MES_DPAD_BUTTON_1_UP 10
MrBedfordVan 0:b9164b348919 105 #define MES_DPAD_BUTTON_2_DOWN 11
MrBedfordVan 0:b9164b348919 106 #define MES_DPAD_BUTTON_2_UP 12
MrBedfordVan 0:b9164b348919 107 #define MES_DPAD_BUTTON_3_DOWN 13
MrBedfordVan 0:b9164b348919 108 #define MES_DPAD_BUTTON_3_UP 14
MrBedfordVan 0:b9164b348919 109 #define MES_DPAD_BUTTON_4_DOWN 15
MrBedfordVan 0:b9164b348919 110 #define MES_DPAD_BUTTON_4_UP 16
MrBedfordVan 0:b9164b348919 111
MrBedfordVan 0:b9164b348919 112 //
MrBedfordVan 0:b9164b348919 113 // Events that typically use radio broadcast:
MrBedfordVan 0:b9164b348919 114 //
MrBedfordVan 0:b9164b348919 115 #define MES_BROADCAST_GENERAL_ID 2000
MrBedfordVan 0:b9164b348919 116
MrBedfordVan 0:b9164b348919 117 #endif