Rodrigo Miguez / Mbed 2 deprecated i2c_acelerometro

Dependencies:   BLE_API mbed nRF51822 circular_buffer

AccelService.h

Committer:
agufal
Date:
2016-05-25
Revision:
13:e4c3b3e00e3d
Parent:
10:8c5a246b9045

File content as of revision 13:e4c3b3e00e3d:

#ifndef ACCELSERVICE_H
#define ACCELSERVICE_H

#include "BLE.h"
#include "Vector.h"

#define SERVICE_UUID 0xA000
#define CHARACTERISTIC_UUID 0xA001
#define CALIBRATION_UUID 0xA002

class AccelService {
    
public:
    AccelService();
    void updateAccelState(Vector v);
      
private:
    GattCharacteristic _accelState;
    uint8_t _values[6]; // 3 ejes * 2 bytes por eje
    
    static void disconnectionCallback(const Gap::DisconnectionCallbackParams_t *params){
    
        BLE::Instance().gap().startAdvertising();
        
    }
    
    static void connectionCallback(const Gap::ConnectionCallbackParams_t *params){
    
        BLE::Instance().gap().stopAdvertising();
        
    }  
};

#endif //#ifndef ACCELSERVICE_H