Core Base Classes for the Light Endpoints

Dependencies:   BufferedSerial

Dependents:   mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more

Committer:
ansond
Date:
Fri Mar 28 16:24:12 2014 +0000
Revision:
134:58e7537a8c5f
Child:
192:54b758a8eaaa
refactor personality

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 134:58e7537a8c5f 1 /* Copyright C2013 Doug Anson, MIT License
ansond 134:58e7537a8c5f 2 *
ansond 134:58e7537a8c5f 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
ansond 134:58e7537a8c5f 4 * and associated documentation files the "Software", to deal in the Software without restriction,
ansond 134:58e7537a8c5f 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
ansond 134:58e7537a8c5f 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
ansond 134:58e7537a8c5f 7 * furnished to do so, subject to the following conditions:
ansond 134:58e7537a8c5f 8 *
ansond 134:58e7537a8c5f 9 * The above copyright notice and this permission notice shall be included in all copies or
ansond 134:58e7537a8c5f 10 * substantial portions of the Software.
ansond 134:58e7537a8c5f 11 *
ansond 134:58e7537a8c5f 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
ansond 134:58e7537a8c5f 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
ansond 134:58e7537a8c5f 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
ansond 134:58e7537a8c5f 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
ansond 134:58e7537a8c5f 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ansond 134:58e7537a8c5f 17 */
ansond 134:58e7537a8c5f 18
ansond 134:58e7537a8c5f 19 #ifndef _PERSONALITY_H_
ansond 134:58e7537a8c5f 20 #define _PERSONALITY_H_
ansond 134:58e7537a8c5f 21
ansond 134:58e7537a8c5f 22 // Base class support
ansond 134:58e7537a8c5f 23 #include "BaseClass.h"
ansond 134:58e7537a8c5f 24
ansond 134:58e7537a8c5f 25 // Transport support
ansond 134:58e7537a8c5f 26 #include "Transport.h"
ansond 134:58e7537a8c5f 27
ansond 134:58e7537a8c5f 28 // ResourceFactory
ansond 134:58e7537a8c5f 29 #include "ResourceFactory.h"
ansond 134:58e7537a8c5f 30
ansond 134:58e7537a8c5f 31 class Personality : public BaseClass {
ansond 134:58e7537a8c5f 32 private:
ansond 134:58e7537a8c5f 33 ResourceFactory *m_resources;
ansond 134:58e7537a8c5f 34
ansond 134:58e7537a8c5f 35 char m_name[PERSONALITY_NAME_LEN+1];
ansond 134:58e7537a8c5f 36 char m_type[PERSONALITY_NAME_LEN+1];
ansond 134:58e7537a8c5f 37
ansond 134:58e7537a8c5f 38 int m_external_id;
ansond 134:58e7537a8c5f 39
ansond 134:58e7537a8c5f 40 protected:
ansond 134:58e7537a8c5f 41 Transport *m_transports[NUM_TRANSPORTS];
ansond 134:58e7537a8c5f 42
ansond 134:58e7537a8c5f 43 public:
ansond 134:58e7537a8c5f 44 Personality(ErrorHandler *error_handler,Transport *transports[NUM_TRANSPORTS],int instance,void *endpoint,char *type);
ansond 134:58e7537a8c5f 45 virtual ~Personality();
ansond 134:58e7537a8c5f 46
ansond 134:58e7537a8c5f 47 Transport *getTransport(int index);
ansond 134:58e7537a8c5f 48
ansond 134:58e7537a8c5f 49 ResourceFactory *getResourceFactory();
ansond 134:58e7537a8c5f 50
ansond 134:58e7537a8c5f 51 char *getName();
ansond 134:58e7537a8c5f 52 char *getType();
ansond 134:58e7537a8c5f 53
ansond 134:58e7537a8c5f 54 int getExternalID();
ansond 134:58e7537a8c5f 55 void setExternalID(int id);
ansond 134:58e7537a8c5f 56
ansond 134:58e7537a8c5f 57 protected:
ansond 134:58e7537a8c5f 58 };
ansond 134:58e7537a8c5f 59
ansond 134:58e7537a8c5f 60 #endif // _PERSONALITY_H_