A metronome using the FRDM K64F board

Committer:
ram54288
Date:
Sun May 14 18:40:18 2017 +0000
Revision:
0:a7a43371b306
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ram54288 0:a7a43371b306 1 /*
ram54288 0:a7a43371b306 2 * Copyright (c) 2015 ARM Limited. All rights reserved.
ram54288 0:a7a43371b306 3 * SPDX-License-Identifier: Apache-2.0
ram54288 0:a7a43371b306 4 * Licensed under the Apache License, Version 2.0 (the License); you may
ram54288 0:a7a43371b306 5 * not use this file except in compliance with the License.
ram54288 0:a7a43371b306 6 * You may obtain a copy of the License at
ram54288 0:a7a43371b306 7 *
ram54288 0:a7a43371b306 8 * http://www.apache.org/licenses/LICENSE-2.0
ram54288 0:a7a43371b306 9 *
ram54288 0:a7a43371b306 10 * Unless required by applicable law or agreed to in writing, software
ram54288 0:a7a43371b306 11 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
ram54288 0:a7a43371b306 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ram54288 0:a7a43371b306 13 * See the License for the specific language governing permissions and
ram54288 0:a7a43371b306 14 * limitations under the License.
ram54288 0:a7a43371b306 15 */
ram54288 0:a7a43371b306 16 #ifndef EVENT_DATA_H
ram54288 0:a7a43371b306 17 #define EVENT_DATA_H
ram54288 0:a7a43371b306 18
ram54288 0:a7a43371b306 19 #include "mbed-client/m2mvector.h"
ram54288 0:a7a43371b306 20
ram54288 0:a7a43371b306 21 //FORWARD DECLARATION
ram54288 0:a7a43371b306 22 class M2MObject;
ram54288 0:a7a43371b306 23
ram54288 0:a7a43371b306 24
ram54288 0:a7a43371b306 25 typedef Vector<M2MObject *> M2MObjectList;
ram54288 0:a7a43371b306 26
ram54288 0:a7a43371b306 27 class M2MSecurity;
ram54288 0:a7a43371b306 28
ram54288 0:a7a43371b306 29 class EventData
ram54288 0:a7a43371b306 30 {
ram54288 0:a7a43371b306 31 public:
ram54288 0:a7a43371b306 32 virtual ~EventData() {}
ram54288 0:a7a43371b306 33 };
ram54288 0:a7a43371b306 34
ram54288 0:a7a43371b306 35 class M2MSecurityData : public EventData
ram54288 0:a7a43371b306 36 {
ram54288 0:a7a43371b306 37 public:
ram54288 0:a7a43371b306 38 M2MSecurityData()
ram54288 0:a7a43371b306 39 :_object(NULL){}
ram54288 0:a7a43371b306 40 virtual ~M2MSecurityData() {}
ram54288 0:a7a43371b306 41 M2MSecurity *_object;
ram54288 0:a7a43371b306 42 };
ram54288 0:a7a43371b306 43
ram54288 0:a7a43371b306 44 class ResolvedAddressData : public EventData
ram54288 0:a7a43371b306 45 {
ram54288 0:a7a43371b306 46 public:
ram54288 0:a7a43371b306 47 ResolvedAddressData()
ram54288 0:a7a43371b306 48 :_address(NULL),
ram54288 0:a7a43371b306 49 _port(0){}
ram54288 0:a7a43371b306 50 virtual ~ResolvedAddressData() {}
ram54288 0:a7a43371b306 51 const M2MConnectionObserver::SocketAddress *_address;
ram54288 0:a7a43371b306 52 uint16_t _port;
ram54288 0:a7a43371b306 53 };
ram54288 0:a7a43371b306 54
ram54288 0:a7a43371b306 55 class ReceivedData : public EventData
ram54288 0:a7a43371b306 56 {
ram54288 0:a7a43371b306 57 public:
ram54288 0:a7a43371b306 58 ReceivedData()
ram54288 0:a7a43371b306 59 :_data(NULL),
ram54288 0:a7a43371b306 60 _size(0),
ram54288 0:a7a43371b306 61 _port(0),
ram54288 0:a7a43371b306 62 _address(NULL){}
ram54288 0:a7a43371b306 63 virtual ~ReceivedData() {}
ram54288 0:a7a43371b306 64 uint8_t *_data;
ram54288 0:a7a43371b306 65 uint16_t _size;
ram54288 0:a7a43371b306 66 uint16_t _port;
ram54288 0:a7a43371b306 67 const M2MConnectionObserver::SocketAddress *_address;
ram54288 0:a7a43371b306 68 };
ram54288 0:a7a43371b306 69
ram54288 0:a7a43371b306 70 class M2MRegisterData : public EventData
ram54288 0:a7a43371b306 71 {
ram54288 0:a7a43371b306 72 public:
ram54288 0:a7a43371b306 73 M2MRegisterData()
ram54288 0:a7a43371b306 74 :_object(NULL){}
ram54288 0:a7a43371b306 75 virtual ~M2MRegisterData() {}
ram54288 0:a7a43371b306 76 M2MSecurity *_object;
ram54288 0:a7a43371b306 77 M2MObjectList _object_list;
ram54288 0:a7a43371b306 78 };
ram54288 0:a7a43371b306 79
ram54288 0:a7a43371b306 80 class M2MUpdateRegisterData : public EventData
ram54288 0:a7a43371b306 81 {
ram54288 0:a7a43371b306 82 public:
ram54288 0:a7a43371b306 83 M2MUpdateRegisterData()
ram54288 0:a7a43371b306 84 :_object(NULL),
ram54288 0:a7a43371b306 85 _lifetime(0){}
ram54288 0:a7a43371b306 86 virtual ~M2MUpdateRegisterData() {}
ram54288 0:a7a43371b306 87 M2MSecurity *_object;
ram54288 0:a7a43371b306 88 uint32_t _lifetime;
ram54288 0:a7a43371b306 89 M2MObjectList _object_list;
ram54288 0:a7a43371b306 90 };
ram54288 0:a7a43371b306 91
ram54288 0:a7a43371b306 92
ram54288 0:a7a43371b306 93 #endif //EVENT_DATA_H
ram54288 0:a7a43371b306 94