1 /******************************************************************
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
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 * This header file is included to define _EXPORT_.
31 #include "SSMModelDefinition.h"
37 INTERFACE_DECLSPEC void InitializeContext(ICtxDelegate *pDelegate);
46 weight / height*hegith
49 18.5 <= < 25 : Normal Range
50 <= 25 < 30 : Overweight
55 #define OUTOFDATEBMI 0
62 #define UNDERWEIGHT_VAL 18.5
63 #define NORMALRANGE_VAL 25.9
64 #define OVERWEIGHT_VAL 30
67 #define DIFFTIME 4 // valid time difference. (seconds)
73 namespace BMISensorName
75 //#define PHYSICAL_EA 2
78 typedef struct _physicalInput_
90 class BMISensor: public ICtxEvent
94 // static physicalInput s_PHYSICAL_SOFTSENSORs[PHYSICAL_EA];
99 std::string m_usrname; // each user. ; for future
100 std::string m_timestamp;
101 double m_height; // Height.
102 double m_weight; // Weight
103 time_t m_timepstampH;
104 time_t m_timepstampW;
109 //InValue m_DI[PHYSICAL_EA];
112 int runLogic(std::vector< ContextData > &contextDataList);
117 void onCtxEvent(enum CTX_EVENT_TYPE eventType, std::vector< ContextData > contextDataList);
119 DIResult getInput(std::vector< ContextData > &contextDataList);
120 DIResult makeBMI(void);
121 ContextData setOutput(int property_count);
123 friend void INTERFACE_DECLSPEC initializeContext(ICtxDelegate *pDelegate);
127 #endif /* BMISENSOR_H_ */