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 gattc_task.h Source File

gattc_task.h

00001 /**
00002  * @file gapm_task.h
00003  * @brief GATTC TASK Header.
00004  * Copyright 2015 SEVENCORE Co., Ltd.
00005  *
00006  * @author HyeongJun Kim 
00007  * @version 1.0.0  
00008  * @date 2015-08-29
00009 */
00010 #ifndef GATTC_TASK_H
00011 #define GATTC_TASK_H
00012 /**
00013  ****************************************************************************************
00014  * @addtogroup dialog_fota module
00015  * @brief GATTC TASK Header.
00016  *
00017  * @{
00018  ****************************************************************************************
00019  */
00020 namespace sevencore_fota{
00021  
00022  /// GATT Task messages
00023 enum gattc_msg_id
00024 {
00025     /* Default event */
00026     /// Command Complete event
00027     GATTC_CMP_EVT = TASK_GATTC*1024,
00028 
00029     /* ATTRIBUTE CLIENT */
00030     /// Server configuration request
00031     GATTC_EXC_MTU_CMD,
00032 
00033     /*Discover All Services */
00034     /*Discover Services by Service UUID*/
00035     /*Find Included Services*/
00036     /*Discover Characteristics by UUID*/
00037     /*Discover All Characteristics of a Service*/
00038     /*Discover All Characteristic Descriptors*/
00039     /// Discovery command
00040     GATTC_DISC_CMD,
00041     /* GATT -> HL: Events to Upper layer */
00042     /*Discover All Services*/
00043     /// Discovery services indication
00044     GATTC_DISC_SVC_IND,
00045     /*Find Included Services*/
00046     /// Discover included services indication
00047     GATTC_DISC_SVC_INCL_IND,
00048     /*Discover All Characteristics of a Service*/
00049     /// Discover characteristic indication
00050     GATTC_DISC_CHAR_IND,
00051     /*Discover All Characteristic Descriptors*/
00052     /// Discovery characteristic descriptor indication
00053     GATTC_DISC_CHAR_DESC_IND,
00054 
00055     /*Read Value*/
00056     /*Read Using UUID*/
00057     /*Read Long Value*/
00058     /*Read Multiple Values*/
00059     /// Read command
00060     GATTC_READ_CMD,
00061     /// Read response
00062     GATTC_READ_IND,
00063 
00064     /*Write without response*/
00065     /*Write without response with Authentication*/
00066     /*Write Characteristic Value*/
00067     /*Signed Write Characteristic Value*/
00068     /*Write Long Characteristic Value*/
00069     /*Characteristic Value Reliable Write*/
00070     /*Write Characteristic Descriptors*/
00071     /*Write Long Characteristic Descriptors*/
00072     /*Characteristic Value Reliable Write*/
00073     /// Write command request
00074     GATTC_WRITE_CMD,
00075 
00076     /* Cancel / Execute pending write operations */
00077     /// Execute write characteristic request
00078     GATTC_EXECUTE_WRITE_CMD,
00079 
00080     /* Reception of an indication or notification from peer device. */
00081     /// peer device triggers an event (indication or notification)
00082     GATTC_EVENT_IND,
00083 
00084     /// Registration to peer device events (Indication/Notification).
00085     GATTC_REG_TO_PEER_EVT_CMD,
00086 
00087     /* ATTRIBUTE SERVER */
00088     /*Notify Characteristic*/
00089     /*Indicate Characteristic*/
00090     /// send an event to peer device
00091     GATTC_SEND_EVT_CMD,
00092 
00093     /* Indicate that write operation is requested. */
00094     /// Write command indicated to upper layers.
00095     GATTC_WRITE_CMD_IND,
00096 
00097     /* Service Changed Characteristic Indication */
00098     /**
00099      * Send a Service Changed indication to a device
00100      * (message structure is struct gattm_svc_changed_ind_req)
00101      */
00102     GATTC_SEND_SVC_CHANGED_CMD,
00103     /**
00104      * Inform the application when sending of Service Changed indications has been
00105      * enabled or disabled
00106      */
00107     GATTC_SVC_CHANGED_CFG_IND,
00108 
00109     /* Confirm write command execution. */
00110     /// Write command confirmation from upper layers.
00111     GATTC_WRITE_CMD_CFM,
00112     
00113     /* Indicate that a read operation is requested. */
00114     /// Read command indicated to upper layers.
00115     GATTC_READ_CMD_IND,
00116 };  
00117 
00118 /// Write peer attribute value command
00119 struct gattc_write_cmd
00120 {
00121     /// Request type
00122     uint8_t req_type;
00123     /// Perform automatic execution
00124     /// (if false, an ATT Prepare Write will be used this shall be use for reliable write)
00125     bool auto_execute;
00126     /// Attribute handle
00127     uint16_t handle;
00128     /// Write offset
00129     uint16_t offset;
00130     /// Write length
00131     uint16_t length;
00132     /// Internal write cursor shall be initialized to 0
00133     uint16_t cursor;
00134     /// Value to write
00135     uint8_t value[4];
00136 };
00137  
00138     
00139     
00140 }//namespace
00141 
00142 /// @} dialog_fota module
00143 #endif