Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbedConnectorInterface by
Diff: api/DynamicResource.h
- Revision:
- 30:113c2a1d8db2
- Parent:
- 24:a6915e19814e
- Child:
- 31:bacc63106754
--- a/api/DynamicResource.h Wed Apr 01 04:33:19 2015 +0000 +++ b/api/DynamicResource.h Tue Apr 07 21:30:03 2015 +0000 @@ -138,19 +138,24 @@ */ void setDataWrapper(DataWrapper *data_wrapper) { this->m_data_wrapper = data_wrapper; } + /** + observe the resource + */ + virtual void observe(); + protected: int notify(uint8_t *data,int data_length); DataWrapper *getDataWrapper() { return this->m_data_wrapper; } - + bool m_observable; + private: - string m_res_type; - uint8_t m_res_mask; - bool m_observable; - uint8_t m_obs_number; - uint8_t *m_obs_token_ptr; - uint8_t m_obs_token_len; - DataWrapper *m_data_wrapper; + string m_res_type; + uint8_t m_res_mask; + uint8_t m_obs_number; + uint8_t *m_obs_token_ptr; + uint8_t m_obs_token_len; + DataWrapper *m_data_wrapper; // convenience method to create a string from the NSDL CoAP data buffers... string coapDataToString(uint8_t *coap_data_ptr,int coap_data_ptr_length);