summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJin Yoon <jinny.yoon@samsung.com>2018-11-24 03:47:48 +0900
committerJin Yoon <jinny.yoon@samsung.com>2018-11-24 03:48:10 +0900
commitbd4f3f524608fe791910a46d01df7f14d70a15aa (patch)
treef4484ed95c4ddd853386c83990ce6dcad9d3df47
parent8d033dfa4ea245d902b83c3cfb4a88d868edc265 (diff)
downloadst-things-co2-meter-adc.tar.gz
st-things-co2-meter-adc.tar.bz2
st-things-co2-meter-adc.zip
Update SmartThings APIs for Tizen 5.0spiadc
Change-Id: Ibc5829bd05512fe33c9e2a8c068e78b03ea72350
-rw-r--r--.gitignore2
-rw-r--r--inc/smartthings.h18
-rw-r--r--inc/smartthings_payload.h11
-rw-r--r--inc/smartthings_resource.h19
-rw-r--r--lib/libst_thing_master_api.sobin111232 -> 111204 bytes
-rw-r--r--lib/libst_thing_resource_api.sobin72552 -> 72524 bytes
-rw-r--r--shared/res/master.json6
-rw-r--r--src/co2.c12
8 files changed, 33 insertions, 35 deletions
diff --git a/.gitignore b/.gitignore
index 0259f26..db8d9d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@
.vscode
*.backup
Debug/
+/SA_Report/
+/res/
diff --git a/inc/smartthings.h b/inc/smartthings.h
index f1b6edc..7206479 100644
--- a/inc/smartthings.h
+++ b/inc/smartthings.h
@@ -1,5 +1,6 @@
- /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+/*****************************************************************
+ *
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -8,11 +9,13 @@
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ *
+ ******************************************************************/
+
#ifndef __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_H__
#define __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_H__
@@ -163,16 +166,11 @@ typedef struct smartthings_ap_list_s *smartthings_ap_list_h;
/**
* @brief Callback for status of connection to SmartThings Thing agent.
- * @details The following error codes can be received: \n
- #SMARTTHINGS_ERROR_NONE: Success \n
- #SMARTTHINGS_ERROR_PERMISSION_DENIED: Permission denied \n
- #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE: Service unavailable \n
* @since_ses 1
*
* @remarks The @a handle should not be released.
* @remarks The @a handle is the same object for which the callback was set/added.
* @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks When callback is called, user can see result as #smartthings_error_e enumeration value.
* @remarks When callback is called, user can see connection status as #smartthings_connection_status_e enumeration value.
*
* @param[in] result The result of connection operation
@@ -182,7 +180,7 @@ typedef struct smartthings_ap_list_s *smartthings_ap_list_h;
*
* @see smartthings_initialize()
*/
-typedef void (*smartthings_connection_status_cb)(smartthings_error_e result, smartthings_h handle, smartthings_connection_status_e status, void *user_data);
+typedef void (*smartthings_connection_status_cb)(smartthings_h handle, smartthings_connection_status_e status, void *user_data);
/**
* @brief Callback for SmartThings Thing status.
diff --git a/inc/smartthings_payload.h b/inc/smartthings_payload.h
index b4612c1..988585d 100644
--- a/inc/smartthings_payload.h
+++ b/inc/smartthings_payload.h
@@ -1,5 +1,6 @@
- /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+/*****************************************************************
+ *
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -8,11 +9,13 @@
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ *
+ ******************************************************************/
+
#ifndef __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_PAYLOAD_H__
#define __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_PAYLOAD_H__
diff --git a/inc/smartthings_resource.h b/inc/smartthings_resource.h
index 962339b..1968c50 100644
--- a/inc/smartthings_resource.h
+++ b/inc/smartthings_resource.h
@@ -1,5 +1,6 @@
- /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+/*****************************************************************
+ *
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -8,11 +9,13 @@
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ *
+ ******************************************************************/
+
#ifndef __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_RESOURCE_H__
#define __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_RESOURCE_H__
@@ -80,16 +83,11 @@ typedef struct smartthings_resource_s *smartthings_resource_h;
/**
* @brief Callback for status of connection to SmartThings Thing agent.
- * @details The following error codes can be received: \n
- #SMARTTHINGS_RESOURCE_ERROR_NONE: Success \n
- #SMARTTHINGS_RESOURCE_ERROR_PERMISSION_DENIED: Permission denied \n
- #SMARTTHINGS_RESOURCE_ERROR_SERVICE_UNAVAILABLE: Service unavailable \n
* @since_ses 1
*
* @remarks The @a handle should not be released.
* @remarks The @a handle is the same object for which the callback was set/added.
* @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks When callback is called, user can see result as #smartthings_resource_error_e enumeration value.
* @remarks When callback is called, user can see connection status as #smartthings_connection_status_e enumeration value.
*
* @param[in] result The result of connection operation
@@ -99,8 +97,7 @@ typedef struct smartthings_resource_s *smartthings_resource_h;
*
* @see smartthings_resource_initialize()
*/
-typedef void (*smartthings_resource_connection_status_cb)(smartthings_resource_error_e result, smartthings_resource_h handle, smartthings_resource_connection_status_e status, void *user_data);
-
+typedef void (*smartthings_resource_connection_status_cb)(smartthings_resource_h handle, smartthings_resource_connection_status_e status, void *user_data);
/**
* @brief Callback for handling request(GET/SET) messages.
diff --git a/lib/libst_thing_master_api.so b/lib/libst_thing_master_api.so
index 2e258c9..aef594a 100644
--- a/lib/libst_thing_master_api.so
+++ b/lib/libst_thing_master_api.so
Binary files differ
diff --git a/lib/libst_thing_resource_api.so b/lib/libst_thing_resource_api.so
index 53b9b44..245093f 100644
--- a/lib/libst_thing_resource_api.so
+++ b/lib/libst_thing_resource_api.so
Binary files differ
diff --git a/shared/res/master.json b/shared/res/master.json
index e99be34..3df0390 100644
--- a/shared/res/master.json
+++ b/shared/res/master.json
@@ -2,7 +2,7 @@
"devices": [
{
"deviceType": "x.wwst.d.basic",
- "deviceName": "Basic",
+ "deviceName": "!!!YOUR_DEVICE_NAME!!!",
"mnid": "!!!YOUR_MNID!!!",
"vid": "!!!YOUR_VENDOR_ID!!!"
}
@@ -10,9 +10,9 @@
"configuration": {
"easySetup": {
"mode": 1,
- "setupId": "000"
+ "setupId": "!!!YOUR_SETUP_ID!!!"
},
"otm": 2,
"crtType": 1
}
-} \ No newline at end of file
+}
diff --git a/src/co2.c b/src/co2.c
index 8ade1e2..312e11a 100644
--- a/src/co2.c
+++ b/src/co2.c
@@ -30,7 +30,7 @@
#define SENSOR_GATHER_INTERVAL (50) //50ms
#define SENSOR_GATHER_COUNT (60)
-//#define USE_ST_SDK
+#define USE_ST_SDK
#ifdef USE_ST_SDK
@@ -167,13 +167,12 @@ _request_cb(smartthings_resource_h handle, int req_id,
}
static void
-_resource_connection_status_cb(smartthings_resource_error_e error,
- smartthings_resource_h handle,
+_resource_connection_status_cb(smartthings_resource_h handle,
smartthings_resource_connection_status_e status, void *user_data)
{
app_data *ad = user_data;
- _D("result [%s], status=[%d]", __resource_error_to_str(error), status);
+ _D("status=[%d]", status);
ret_if(!ad);
@@ -372,11 +371,10 @@ _thing_status_cb(
}
static void
-_things_connection_status_cb(smartthings_error_e error,
- smartthings_h handle, smartthings_connection_status_e status,
+_things_connection_status_cb(smartthings_h handle, smartthings_connection_status_e status,
void *user_data)
{
- _D("result [%s], status = [%d]", __master_error_to_str(error), status);
+ _D("status = [%d]", status);
if (status == SMARTTHINGS_CONNECTION_STATUS_CONNECTED) {
int err = 0;