KIM HyoengJun / Mbed 2 deprecated mbed_fota_robot_control

Dependencies:   mbed-rtos mbed mbed_fota_fan_control

Fork of mbed_fota_lamp_control by KIM HyoengJun

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lamp_control_task.h Source File

lamp_control_task.h

Go to the documentation of this file.
00001 /**
00002  * @file lamp_control_task.h
00003  * @brief Lamp Control Task Header.
00004  * Copyright 2015 SEVENCORE Co., Ltd.
00005  *
00006  * @author HyeongJun Kim 
00007  * @version 1.0.0  
00008  * @date 2015-09-02
00009 */
00010 
00011 #ifndef LAMP_CONTROL_TASK_H_
00012 #define LAMP_CONTROL_TASK_H_
00013 
00014 /*
00015  * INCLUDE FILES
00016  ****************************************************************************************
00017 */
00018 
00019 
00020 /**
00021  ****************************************************************************************
00022  * @addtogroup dialog_fota module
00023  * @brief Fota Server Task Header.
00024  *
00025  * @{
00026  ****************************************************************************************
00027  */
00028 namespace sevencore_fota{
00029 
00030 
00031 /*
00032  * DEFINES
00033  ****************************************************************************************
00034  */
00035 
00036 /// Maximum number of fota server task instances
00037 #define LAMP_CONTROL_IDX_MAX                 (1)
00038 #define LAMP_CONTROL_MIN_SIZE                (1)
00039 #define LAMP_CONTROL_MAX_SIZE                (4)
00040 
00041 /*
00042  * ENUMERATIONS
00043  ****************************************************************************************
00044  */
00045  
00046 ///Attribue Table Indexes
00047 enum
00048 {
00049     LAMP_CONTROL_POWER_STATE_CHAR,
00050     LAMP_CONTROL_LIGHT_INTENSITY_CHAR,
00051     LAMP_CONTROL_LAMP_TIMER_CHAR,
00052     LAMP_CONTROL_RESIDUAL_TIME_CHAR,
00053     
00054     LAMP_CONTROL_CHAR_MAX,
00055 };
00056 
00057 /// Messages for Fota Server
00058 enum
00059 {
00060     /// Start lamp_control. Device connection
00061     LAMP_CONTROL_ENABLE_REQ = TASK_LAMP_CONTROL*1024,
00062     ///Create DataBase
00063     LAMP_CONTROL_CREATE_DB_REQ,
00064     ///Inform APP of database creation status
00065     LAMP_CONTROL_CREATE_DB_CFM,
00066     /// Disable confirm.
00067     LAMP_CONTROL_DISABLE_IND,
00068     //Set Request of The Attribute Value of  Fota Service Characteristics  
00069     LAMP_CONTROL_SET_CHAR_VAL_REQ,
00070     //Fan Control Command Indication
00071     LAMP_CONTROL_COMMAND_IND,
00072     /// Error Indication
00073     LAMP_CONTROL_ERROR_IND,
00074 };
00075 
00076 
00077 /*
00078  * API MESSAGES STRUCTURES
00079  ****************************************************************************************
00080  */
00081 
00082 
00083 /// Parameters of the @ref LAMP_CONTROL_ENABLE_REQ message
00084 struct lamp_control_enable_req
00085 
00086 {
00087     /// Connection Handle
00088     uint16_t conhdl;
00089     /// Security level
00090     uint8_t sec_lvl;
00091 };
00092 
00093 
00094 /// Parameters of the @ref LAMP_CONTROL_CREATE_DB_REQ message
00095 struct lamp_control_create_db_req
00096 {
00097     /// Indicate if TXPS is supported or not
00098     uint16_t features;   
00099 };
00100 
00101 
00102 /// Parameters of the @ref LAMP_CONTROL_CREATE_DB_CFM message
00103 struct lamp_control_create_db_cfm
00104 {
00105     /// Status
00106     uint8_t status;
00107 };
00108 
00109 
00110 /// Parameters of the @ref LAMP_CONTROL_SET_CHAR_VAL_REQ message - shall be dynamically allocated
00111 struct lamp_control_set_char_val_req
00112 {
00113     /// Characteristic Code
00114     uint8_t char_code;
00115     /// Value length
00116     uint8_t val_len;
00117     /// Value
00118     uint8_t val[4];
00119 };
00120 
00121 
00122 /// Parameters of the @ref LAMP_CONTROL_DISABLE_IND message
00123 struct lamp_control_disable_ind
00124 {
00125     /// Connection Handle
00126     uint16_t conhdl;
00127 };
00128 
00129 /// Parameters of the @ref LAMP_CONTROL_COMMAND_IND message
00130 struct lamp_control_command_ind
00131 {
00132     uint8_t char_code;
00133     uint8_t command;
00134     uint32_t residual_time;
00135 };
00136 
00137 
00138 }//namespace
00139 
00140 /// @} dialog_fota module
00141 #endif // LAMP_CONTROL_TASK_H_