Fix comments 63/198963/4
authorBoyeon <boyeon.son@samsung.com>
Thu, 31 Jan 2019 09:02:25 +0000 (18:02 +0900)
committerBoyeon <boyeon.son@samsung.com>
Thu, 31 Jan 2019 09:11:21 +0000 (18:11 +0900)
Change-Id: I414cf7f45fbaef0498b84343c17b59b69e915124

inc/resource/resource_infrared_motion_sensor.h
inc/resource/resource_led.h
src/controller.c

index 612db3f..49062e6 100755 (executable)
 #define __POSITION_FINDER_RESOURCE_INFRARED_MOTION_SENSOR_H__
 
 /**
- * @brief Reads the value of gpio connected infrared motion sensor(HC-SR501).
- * @param[in] pin_num The number of the gpio pin connected to the infrared motion sensor
+ * @brief Reads value of gpio connected infrared motion sensor (HC-SR501)
+ * @param[in] pin_num The gpio pin number for the infrared motion sensor
  * @param[out] out_value The value of the gpio (zero or non-zero)
  * @return 0 on success, otherwise a negative error value
- * @see If the gpio pin is not open, creates gpio handle before reading the value of gpio.
+ * @see If the gpio pin is not open, create gpio handle before reading the value
  */
 extern int resource_read_infrared_motion_sensor(int pin_num, uint32_t *out_value);
 
 /**
- * @brief Releases the gpio handle and changes the gpio pin state to the close(0).
- * @param[in] pin_num The number of the gpio pin connected to the infrared motion sensor
+ * @brief Releases the gpio handle
  */
 extern void resource_close_infrared_motion_sensor(void);
 
index 44b058a..1a81a18 100755 (executable)
 #ifndef __POSITION_FINDER_RESOURCE_LED_H__
 #define __POSITION_FINDER_RESOURCE_LED_H__
 
+/**
+ * @brief Writes value of gpio connected led light
+ * @param[in] pin_num The gpio pin number for the led light
+ * @param[out] out_value The value of turniing the led light on/off
+ * @return 0 on success, otherwise a negative error value
+ * @see If the gpio pin is not open, create gpio handle before writing the value
+ */
 extern int resource_write_led(int pin_num, int write_value);
 
+/**
+ * @brief Releases the gpio handle
+ */
 extern void resource_close_led(void);
 
 #endif /* __POSITION_FINDER_RESOURCE_LED_H__ */
index 8c3e48d..ecca89f 100644 (file)
 #include "resource/resource_infrared_motion_sensor.h"
 #include "resource/resource_led.h"
 
-// Duration for a timer
+// Timer duration
 #define TIMER_GATHER_INTERVAL (5.0f)
 
-// Motion sensor info
+// Motion sensor information
 #define SENSOR_MOTION_GPIO_NUMBER (46)
 
-// LED info
+// LED sensor information
 #define SENSOR_LED_GPIO_NUMBER (130)
 #define SENSOR_LED_ON "on"
 #define SENSOR_LED_OFF "off"
 
+// For using SmartThings SDK
 #define USE_ST_SDK
 #ifdef USE_ST_SDK
 #include "smartthings.h"
 #include "smartthings_resource.h"
 #include "smartthings_payload.h"
 
-// Cert file name in 'res' directory
+// Certification file and private key file stored in the resource directory
 #define CERT_FILE "certificate.pem"
-// Private key file name in 'res' directory
 #define PRIV_FILE "privatekey.der"
 
+// URI and key information
 #define SENSOR_MOTION_URI "/capability/motionSensor/main/0"
 #define SENSOR_MOTION_KEY "value"
 #define SENSOR_LED_URI "/capability/switch/main/0"
@@ -63,6 +64,7 @@ typedef struct app_data_s {
        smartthings_status_e status;
 #endif /* USE_ST_SDK */
 } app_data;
+
 static app_data *g_ad = NULL;
 
 #ifdef USE_ST_SDK
@@ -430,7 +432,6 @@ static void _thing_status_cb(
        ad->status = status;
 }
 
-//static void _things_connection_status_cb(smartthings_error_e error,
 static void _things_connection_status_cb(
                smartthings_h handle, smartthings_connection_status_e status,
                void *user_data)