Fan Control Demo

Dependencies:   mbed-rtos mbed

Fork of mbed_fota by KIM HyoengJun

Revision:
12:e3d3676753cc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dialog_fota/gattc_task.h	Wed Sep 02 07:44:29 2015 +0000
@@ -0,0 +1,143 @@
+/**
+ * @file gapm_task.h
+ * @brief GATTC TASK Header.
+ * Copyright 2015 SEVENCORE Co., Ltd.
+ *
+ * @author HyeongJun Kim 
+ * @version 1.0.0  
+ * @date 2015-08-29
+*/
+#ifndef GATTC_TASK_H
+#define GATTC_TASK_H
+/**
+ ****************************************************************************************
+ * @addtogroup dialog_fota module
+ * @brief GATTC TASK Header.
+ *
+ * @{
+ ****************************************************************************************
+ */
+namespace sevencore_fota{
+ 
+ /// GATT Task messages
+enum gattc_msg_id
+{
+    /* Default event */
+    /// Command Complete event
+    GATTC_CMP_EVT = TASK_GATTC*1024,
+
+    /* ATTRIBUTE CLIENT */
+    /// Server configuration request
+    GATTC_EXC_MTU_CMD,
+
+    /*Discover All Services */
+    /*Discover Services by Service UUID*/
+    /*Find Included Services*/
+    /*Discover Characteristics by UUID*/
+    /*Discover All Characteristics of a Service*/
+    /*Discover All Characteristic Descriptors*/
+    /// Discovery command
+    GATTC_DISC_CMD,
+    /* GATT -> HL: Events to Upper layer */
+    /*Discover All Services*/
+    /// Discovery services indication
+    GATTC_DISC_SVC_IND,
+    /*Find Included Services*/
+    /// Discover included services indication
+    GATTC_DISC_SVC_INCL_IND,
+    /*Discover All Characteristics of a Service*/
+    /// Discover characteristic indication
+    GATTC_DISC_CHAR_IND,
+    /*Discover All Characteristic Descriptors*/
+    /// Discovery characteristic descriptor indication
+    GATTC_DISC_CHAR_DESC_IND,
+
+    /*Read Value*/
+    /*Read Using UUID*/
+    /*Read Long Value*/
+    /*Read Multiple Values*/
+    /// Read command
+    GATTC_READ_CMD,
+    /// Read response
+    GATTC_READ_IND,
+
+    /*Write without response*/
+    /*Write without response with Authentication*/
+    /*Write Characteristic Value*/
+    /*Signed Write Characteristic Value*/
+    /*Write Long Characteristic Value*/
+    /*Characteristic Value Reliable Write*/
+    /*Write Characteristic Descriptors*/
+    /*Write Long Characteristic Descriptors*/
+    /*Characteristic Value Reliable Write*/
+    /// Write command request
+    GATTC_WRITE_CMD,
+
+    /* Cancel / Execute pending write operations */
+    /// Execute write characteristic request
+    GATTC_EXECUTE_WRITE_CMD,
+
+    /* Reception of an indication or notification from peer device. */
+    /// peer device triggers an event (indication or notification)
+    GATTC_EVENT_IND,
+
+    /// Registration to peer device events (Indication/Notification).
+    GATTC_REG_TO_PEER_EVT_CMD,
+
+    /* ATTRIBUTE SERVER */
+    /*Notify Characteristic*/
+    /*Indicate Characteristic*/
+    /// send an event to peer device
+    GATTC_SEND_EVT_CMD,
+
+    /* Indicate that write operation is requested. */
+    /// Write command indicated to upper layers.
+    GATTC_WRITE_CMD_IND,
+
+    /* Service Changed Characteristic Indication */
+    /**
+     * Send a Service Changed indication to a device
+     * (message structure is struct gattm_svc_changed_ind_req)
+     */
+    GATTC_SEND_SVC_CHANGED_CMD,
+    /**
+     * Inform the application when sending of Service Changed indications has been
+     * enabled or disabled
+     */
+    GATTC_SVC_CHANGED_CFG_IND,
+
+    /* Confirm write command execution. */
+    /// Write command confirmation from upper layers.
+    GATTC_WRITE_CMD_CFM,
+    
+    /* Indicate that a read operation is requested. */
+    /// Read command indicated to upper layers.
+    GATTC_READ_CMD_IND,
+};  
+
+/// Write peer attribute value command
+struct gattc_write_cmd
+{
+    /// Request type
+    uint8_t req_type;
+    /// Perform automatic execution
+    /// (if false, an ATT Prepare Write will be used this shall be use for reliable write)
+    bool auto_execute;
+    /// Attribute handle
+    uint16_t handle;
+    /// Write offset
+    uint16_t offset;
+    /// Write length
+    uint16_t length;
+    /// Internal write cursor shall be initialized to 0
+    uint16_t cursor;
+    /// Value to write
+    uint8_t value[4];
+};
+ 
+    
+    
+}//namespace
+
+/// @} dialog_fota module
+#endif
\ No newline at end of file