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:
- 21:8487990a3baa
- Parent:
- 2:853f9ecc12df
- Child:
- 23:caa0260acc21
--- a/api/DynamicResource.h Thu Mar 05 18:23:28 2015 +0000 +++ b/api/DynamicResource.h Fri Mar 13 05:46:48 2015 +0000 @@ -99,18 +99,41 @@ virtual string get() = 0; /** - Resource value setter (OPTIONAL: defaulted noop if not derived. Binders MAY implement PUT if needed) + Resource value setter (PUT) (OPTIONAL: defaulted noop if not derived. Binders MAY implement PUT if needed) @param string value of the resource */ virtual void put(const string value); - + + /** + Resource value setter (POST) (OPTIONAL: defaulted noop if not derived. Binders MAY implement POST if needed) + @param string value of the resource + */ + virtual void post(const string value); + + /** + Resource value deleter (OPTIONAL: defaulted noop if not derived. Binders MAY implement DELETE if needed) + @param string value of the resource + */ + virtual void del(const string value); + + /** + Send notification of new data + @param data input the new data to update + @returns 1 - success, 0 - failure + */ + int notify(const string data); + protected: + int notify(uint8_t *data,int data_length); 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; // convenience method to create a string from the NSDL CoAP data buffers... string coapDataToString(uint8_t *coap_data_ptr,int coap_data_ptr_length);