1
mbed_cloud_client_resource.h@0:d193d40d4fa1, 2018-03-21 (annotated)
- Committer:
- group-STM32F031
- Date:
- Wed Mar 21 18:13:41 2018 +0000
- Revision:
- 0:d193d40d4fa1
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
group-STM32F031 | 0:d193d40d4fa1 | 1 | #ifndef MBED_CLOUD_CLIENT_RESOURCE_H |
group-STM32F031 | 0:d193d40d4fa1 | 2 | #define MBED_CLOUD_CLIENT_RESOURCE_H |
group-STM32F031 | 0:d193d40d4fa1 | 3 | |
group-STM32F031 | 0:d193d40d4fa1 | 4 | #include "simple-mbed-cloud-client.h" |
group-STM32F031 | 0:d193d40d4fa1 | 5 | #include "mbed-client/m2mstring.h" |
group-STM32F031 | 0:d193d40d4fa1 | 6 | |
group-STM32F031 | 0:d193d40d4fa1 | 7 | #define NUM_M2M_METHODS 4 |
group-STM32F031 | 0:d193d40d4fa1 | 8 | |
group-STM32F031 | 0:d193d40d4fa1 | 9 | namespace M2MMethod { |
group-STM32F031 | 0:d193d40d4fa1 | 10 | |
group-STM32F031 | 0:d193d40d4fa1 | 11 | enum M2MMethod { |
group-STM32F031 | 0:d193d40d4fa1 | 12 | GET = 0x01, |
group-STM32F031 | 0:d193d40d4fa1 | 13 | PUT = 0x02, |
group-STM32F031 | 0:d193d40d4fa1 | 14 | POST = 0x04, |
group-STM32F031 | 0:d193d40d4fa1 | 15 | DELETE = 0x08 |
group-STM32F031 | 0:d193d40d4fa1 | 16 | }; |
group-STM32F031 | 0:d193d40d4fa1 | 17 | |
group-STM32F031 | 0:d193d40d4fa1 | 18 | }; |
group-STM32F031 | 0:d193d40d4fa1 | 19 | |
group-STM32F031 | 0:d193d40d4fa1 | 20 | class SimpleMbedCloudClient; |
group-STM32F031 | 0:d193d40d4fa1 | 21 | |
group-STM32F031 | 0:d193d40d4fa1 | 22 | class MbedCloudClientResource { |
group-STM32F031 | 0:d193d40d4fa1 | 23 | public: |
group-STM32F031 | 0:d193d40d4fa1 | 24 | MbedCloudClientResource(SimpleMbedCloudClient *client, const char *path, const char *name); |
group-STM32F031 | 0:d193d40d4fa1 | 25 | |
group-STM32F031 | 0:d193d40d4fa1 | 26 | void observable(bool observable); |
group-STM32F031 | 0:d193d40d4fa1 | 27 | void methods(unsigned int methodMask); |
group-STM32F031 | 0:d193d40d4fa1 | 28 | void attach(M2MMethod::M2MMethod method, void *callback); |
group-STM32F031 | 0:d193d40d4fa1 | 29 | void attach_notification(M2MMethod::M2MMethod method, void *callback); |
group-STM32F031 | 0:d193d40d4fa1 | 30 | void detatch(M2MMethod::M2MMethod method); |
group-STM32F031 | 0:d193d40d4fa1 | 31 | void detatch_notification(M2MMethod::M2MMethod method); |
group-STM32F031 | 0:d193d40d4fa1 | 32 | void set_value(int value); |
group-STM32F031 | 0:d193d40d4fa1 | 33 | void set_value(char *value); |
group-STM32F031 | 0:d193d40d4fa1 | 34 | char* get_value(); |
group-STM32F031 | 0:d193d40d4fa1 | 35 | |
group-STM32F031 | 0:d193d40d4fa1 | 36 | private: |
group-STM32F031 | 0:d193d40d4fa1 | 37 | SimpleMbedCloudClient *client; |
group-STM32F031 | 0:d193d40d4fa1 | 38 | String path; |
group-STM32F031 | 0:d193d40d4fa1 | 39 | String name; |
group-STM32F031 | 0:d193d40d4fa1 | 40 | bool isObservable; |
group-STM32F031 | 0:d193d40d4fa1 | 41 | unsigned int methodMask; |
group-STM32F031 | 0:d193d40d4fa1 | 42 | |
group-STM32F031 | 0:d193d40d4fa1 | 43 | void *callbacks[NUM_M2M_METHODS]; |
group-STM32F031 | 0:d193d40d4fa1 | 44 | void *notification_callbacks[NUM_M2M_METHODS]; |
group-STM32F031 | 0:d193d40d4fa1 | 45 | }; |
group-STM32F031 | 0:d193d40d4fa1 | 46 | |
group-STM32F031 | 0:d193d40d4fa1 | 47 | #endif // MBED_CLOUD_CLIENT_RESOURCE_H |