mqtt specific components for the impact mbed endpoint library
Dependents: mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_mqtt_endpoint_nxp
Diff: MBEDEndpoint.h
- Revision:
- 7:8a4a61202b36
- Parent:
- 6:2db2c7e75ad9
- Child:
- 9:28bd23e25409
--- a/MBEDEndpoint.h Thu Mar 27 18:14:05 2014 +0000 +++ b/MBEDEndpoint.h Fri Mar 28 16:24:22 2014 +0000 @@ -46,17 +46,17 @@ class MBEDEndpoint { private: - EthernetInterface *m_ethernet; // ethernet interface - ErrorHandler *m_error_handler; // our error handler - IOCEndpoint *m_ioc_endpoint; // IOC integration - Transport *m_transports[NUM_TRANSPORTS]; // our transport - Light *m_lights[NUM_LIGHTS]; // our lights (at least 1) - char m_endpoint_name[LIGHT_NAME_LEN+1]; // our endpoint name (light[0]) - MBEDToIOCResourceMap *m_map; // IOC <--> MBED resource mapping - Preferences *m_preferences; // preference support - char m_lcd_status[TEMP_BUFFER_LEN+1]; // LCD status buffer - char m_gw_address[PREFERENCE_VALUE_LEN+1]; // GW address buffer - int m_instance_id; // instance ID for this endpoint + EthernetInterface *m_ethernet; // ethernet interface + ErrorHandler *m_error_handler; // our error handler + IOCEndpoint *m_ioc_endpoint; // IOC integration + Transport *m_transports[NUM_TRANSPORTS]; // our transport + Light *m_personalities[NUM_PERSONALITY_INSTANCES]; // our personality instances (at least 1) + char m_endpoint_name[PERSONALITY_NAME_LEN+1]; // our endpoint name (personality[0]) + MBEDToIOCResourceMap *m_map; // IOC <--> MBED resource mapping + Preferences *m_preferences; // preference support + char m_lcd_status[TEMP_BUFFER_LEN+1]; // LCD status buffer + char m_gw_address[PREFERENCE_VALUE_LEN+1]; // GW address buffer + int m_instance_id; // instance ID for this endpoint public: MBEDEndpoint(ErrorHandler *error_handler,EthernetInterface *ethernet); @@ -64,12 +64,12 @@ ResourceFactory *initResourceFactory(); void run(); - int indexOfLight(char *name); + int indexOfPersonality(char *name); ResourceFactory *getResources(int index); - bool loadEndpoints(); - bool updateEndpoints(); - bool updateEndpoints(int index); + bool loadPersonalities(); + bool updatePersonalities(); + bool updatePersonality(int index); char *getEndpointName(); char *getGWAddress(); @@ -84,20 +84,20 @@ protected: private: - bool initializeEndpointPersonality(); - bool closeEndpointPersonality(); + bool initializePersonalities(); + bool closePersonalities(); ResourceFactory *initLightResourceFactory(); + bool initializeLights(); + void initPreferences(); void initGWAddress(); void initEndpointName(); - bool initializeLights(); bool initializeTransport(int index,char *key,Transport *transport); bool initializeTransports(); bool initializeEthernet(EthernetInterface *ethernet); - bool loadEndpoint(Light *light); - bool updateEndpoint(Light *light); - bool closeLights(); + bool loadPersonality(Personality *instance); + bool updatePersonality(Personality *instance); bool closeTransport(int index,char *key); bool closeTransports(); bool closeEthernet();