BLE_DEMO_SPI_HARDCODE

Dependencies:   BLE_API mbed nRF51822

Fork of BLE_Central_Light_Demo_23 by HM_IOT_Demo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers hm_config.h Source File

hm_config.h

00001 
00002 
00003 #ifndef __HM_CONFIG_H__
00004 #define __HM_CONFIG_H__
00005 
00006 #include "mbed.h"
00007 #include "ble/BLE.h"
00008 #include "ble/DiscoveredCharacteristic.h"
00009 #include "ble/DiscoveredService.h"
00010 #include "ble/Gap.h"
00011 
00012 #define MAX_SERVICES 4
00013 //class Magic_Light{
00014 static bool connect_status;
00015 bool charDiscover;
00016 //uint8_t pre_write_data[16];
00017 static ble_error_t error_status;
00018 bool serviceDiscover = true;
00019 bool first_on=true;
00020 //int spiRX[8];
00021 uint8_t bufferSize;
00022 //uint8_t write_data[16]; //[8] = {0x00,};//={0x56,0x00,0xff,0x00,0x00,0xf0,0xaa};
00023 
00024 void AddCharNodes(DiscoveredCharacteristic light_Characteristic);
00025 void light_actions(int service_char[]);
00026 
00027 //public:
00028 typedef enum light_action_e{
00029     TURN_OFF=0, 
00030     TURN_ON,
00031     COLOR,
00032     INVAILD
00033 }light_action;
00034 
00035 typedef enum light_color_e{
00036     RED=0,
00037     GREEN,
00038     BLUE,
00039     YELLOW,
00040     CYAN,
00041     MAGENTA,
00042     MAX_COLOR
00043 }light_color;
00044 
00045 /*
00046 uint8_t lightColor[MAX_COLOR][3] = {{0xFF,0x00,0x00},{0x00,0xFF,0x00},
00047                                     {0x00,0x00,0xFF},{0xFF,0xFF,0x00},
00048                                     {0x00,0xFF,0xFF},{0xFF,0x00,0xFF}
00049                                    };
00050 */
00051 struct lightCharacteristic_t{
00052     uint8_t u_characteristicID;
00053     Gap::Handle_t connHandle;
00054     GattAttribute::Handle_t valueHandle;
00055     //struct lightCharacteristic_t *nextChar;
00056 };
00057 
00058 typedef struct _serviceinfo 
00059 {
00060     lightCharacteristic_t * services_Char[MAX_SERVICES];
00061 
00062 }s_serviceInfo;
00063 
00064 //};
00065 
00066 #endif /* ifndef __BLE_H__ */