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.
Dependents: Wifi_Get_Test_V1 simple-mbed-client-example simple-client-app-shield simple-sensor-client
Fork of simple-mbed-client by
Revision 6:a1a766d45957, committed 2016-07-01
- Comitter:
- Jan Jongboom
- Date:
- Fri Jul 01 13:56:44 2016 +0200
- Parent:
- 5:b875aa494b9f
- Child:
- 7:8a05fbad93d1
- Commit message:
- Add a way of accessing underlying M2MResource
Changed in this revision
| simple-mbed-client.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/simple-mbed-client.h Fri Jul 01 12:55:18 2016 +0200
+++ b/simple-mbed-client.h Fri Jul 01 13:56:44 2016 +0200
@@ -262,6 +262,15 @@
updateValues[route] = simpleResource;
}
+ M2MResource* get_resource(string route) {
+ if (!resources.count(route)) {
+ debug_msg("[SMC] [ERROR] No such route (%s)\r\n", route.c_str());
+ return NULL;
+ }
+
+ return resources[route];
+ }
+
private:
vector<string> parse_route(const char* route) {
string s(route);
@@ -312,6 +321,10 @@
if (onUpdate) onUpdate(v);
}
+ M2MResource* get_resource() {
+ return simpleClient->get_resource(route);
+ }
+
private:
SimpleMbedClientBase* simpleClient;
string route;
@@ -340,6 +353,10 @@
onUpdate(atoi((const char*)v.c_str()));
}
+ M2MResource* get_resource() {
+ return simpleClient->get_resource(route);
+ }
+
private:
SimpleMbedClientBase* simpleClient;
string route;
