1 //******************************************************************
3 // Copyright 2014 Intel Corporation.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
29 #include "OCPlatform.h"
30 #include "OCResource.h"
37 shared_ptr<OCResource> m_resourceHandle;
38 OCRepresentation m_ledRepresentation;
39 GetCallback m_GETCallback;
40 PutCallback m_PUTCallback;
41 void onGet(const HeaderOptions&, const OCRepresentation&, int);
42 void onPut(const HeaderOptions&, const OCRepresentation&, int);
46 LED(shared_ptr<OCResource> Resource);
50 class TemperatureSensor
52 shared_ptr<OCResource> m_resourceHandle;
53 OCRepresentation m_temperatureRepresentation;
54 GetCallback m_GETCallback;
55 ObserveCallback m_OBSERVECallback;
57 void onObserve(const HeaderOptions headerOptions, const OCRepresentation& rep, int eCode,
59 void onGet(const HeaderOptions&, const OCRepresentation&, int);
64 TemperatureSensor(shared_ptr<OCResource> Resource);
65 virtual ~TemperatureSensor();
70 shared_ptr<OCResource> m_resourceHandle;
71 OCRepresentation m_ledRepresentation;
72 GetCallback m_GETCallback;
73 ObserveCallback m_OBSERVECallback;
75 void onObserve(const HeaderOptions headerOptions, const OCRepresentation& rep, int eCode,
77 void onGet(const HeaderOptions&, const OCRepresentation&, int);
82 AmbientLight(shared_ptr<OCResource> Resource);
83 virtual ~AmbientLight();
88 shared_ptr<TemperatureSensor> m_temperatureSensor;
89 shared_ptr<AmbientLight> m_ambientLightSensor;
90 shared_ptr<LED> m_platformLED;
91 shared_ptr<PlatformConfig> m_platformConfig;
92 FindCallback m_resourceDiscoveryCallback;
93 void initializePlatform();
94 void discoveredResource(shared_ptr<OCResource>);
96 shared_ptr<TemperatureSensor> getTemperatureSensor();
97 shared_ptr<AmbientLight> getAmbientLightSensor();
98 shared_ptr<LED> getPlatformLED();
101 virtual ~IoTClient();
102 static void DisplayMenu();
105 #endif /* CLIENT_H_ */