bluetooth control motor
Dependents: BLE_LED_IDB0XA1_demo MOTOR_BLE_V2 Motor_Ble_v1 Motor_Ble_v10223 ... more
Fork of X_NUCLEO_IDB0XA1 by
Diff: x-nucleo-idb0xa1/BlueNRGGattServer.h
- Revision:
- 242:058b2e731adc
- Parent:
- 205:2b4afe8ce1a0
- Parent:
- 229:9981f62cdb1a
- Child:
- 253:9665a6f8bbdb
--- a/x-nucleo-idb0xa1/BlueNRGGattServer.h Fri Mar 18 12:10:20 2016 +0100 +++ b/x-nucleo-idb0xa1/BlueNRGGattServer.h Mon Jun 20 14:59:06 2016 +0200 @@ -29,9 +29,7 @@ * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2> - */ - -// ANDREA: Changed some types (e.g., tHalUint8 --> uint8_t) + */ #ifndef __BLUENRG_GATT_SERVER_H__ #define __BLUENRG_GATT_SERVER_H__ @@ -46,11 +44,6 @@ #define BLE_TOTAL_CHARACTERISTICS 10 -// If the char has handle 'x', then the value declaration will have the handle 'x+1' -// If the char has handle 'x', then the char descriptor declaration will have the handle 'x+2' -#define CHAR_VALUE_OFFSET 1 -#define CHAR_DESC_OFFSET 2 - using namespace std; class BlueNRGGattServer : public GattServer @@ -68,7 +61,6 @@ }; /* Functions that must be implemented from GattServer */ - // <<<ANDREA>>> virtual ble_error_t addService(GattService &); virtual ble_error_t read(GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP); virtual ble_error_t read(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP); @@ -79,12 +71,13 @@ virtual bool isOnDataReadAvailable() const { return true; } - // <<<ANDREA>>> + + virtual ble_error_t reset(void); /* BlueNRG Functions */ void eventCallback(void); //void hwCallback(void *pckt); - ble_error_t Read_Request_CB(uint16_t handle); + ble_error_t Read_Request_CB(uint16_t attributeHandle); GattCharacteristic* getCharacteristicFromHandle(uint16_t charHandle); void HCIDataWrittenEvent(const GattWriteCallbackParams *params); void HCIDataReadEvent(const GattReadCallbackParams *params); @@ -97,7 +90,7 @@ uint8_t characteristicCount; uint16_t servHandle, charHandle; - std::map<uint16_t, uint16_t> bleCharHanldeMap; // 1st argument is characteristic, 2nd argument is service + std::map<uint16_t, uint16_t> bleCharHandleMap; // 1st argument is characteristic, 2nd argument is service GattCharacteristic *p_characteristics[BLE_TOTAL_CHARACTERISTICS]; uint16_t bleCharacteristicHandles[BLE_TOTAL_CHARACTERISTICS];