this is using the mbed os version 5-13-1
Diff: source/BleManager.h
- Branch:
- PassingRegression
- Revision:
- 119:8d939a902333
- Parent:
- 118:8df0e9c2ee3f
- Child:
- 120:779b74689747
--- a/source/BleManager.h Sat May 25 16:25:42 2019 +0000
+++ b/source/BleManager.h Mon May 27 12:34:58 2019 +0000
@@ -95,6 +95,7 @@
protected:
// connection status
bool isConnected;
+ char buffer[MAX_BLE_PACKET_SIZE];
private:
/** Override to start chosen activity when initialisation completes */
virtual void start() = 0;
@@ -123,6 +124,13 @@
void reportGapState();
+
+ // application virtual methods called by peripheral
+ virtual bool queueBleDataResponse(ble_at_msg_t at_resp) = 0;
+ virtual bool dequeueATdataResponse() = 0;
+ virtual void sendATresponseBytes(at_cmd_resp_t at_cmd, const uint8_t * buf, int len) = 0;
+ virtual bool setNextCommand(ble_cmd_t cmd) = 0;
+ virtual void processQueues() = 0;
/**
* This callback allows the LEDService to receive updates to the ledState Characteristic.
@@ -134,8 +142,14 @@
//void passkeyDisplayCallback(Gap::Handle_t handle, const SecurityManager::Passkey_t passkey);
//void securitySetupCompletedCallback(Gap::Handle_t handle, SecurityManager::SecurityCompletionStatus_t status);
-private:
- DigitalOut _led1;
+protected:
+ BLE &_ble;
+ events::EventQueue &_event_queue;
+ BLEProtocol::AddressBytes_t &_peer_address;
+ ble_cmd_t bleCmd;
+ at_ble_msg_t *data_msg;
+ ble_at_msg_t *at_data_resp;
+protected:
/* Queue and memory pool for AT to BLE data */
MemoryPool<at_ble_msg_t, PQDSZ_BLE> *_aT2BleDatamPool;
Queue<at_ble_msg_t, PQDSZ_BLE> *_aT2BleDataQueue;
@@ -144,14 +158,11 @@
/* Queue and memory pool for BLE to AT data */
MemoryPool<ble_at_msg_t, PQDSZ_BLE> *_ble2ATDatamPool;
Queue<ble_at_msg_t, PQDSZ_BLE> *_ble2ATDataQueue;
-
-protected:
- BLE &_ble;
ble_config_t *ble_config;
- events::EventQueue &_event_queue;
- BLEProtocol::AddressBytes_t &_peer_address;
ble::connection_handle_t _handle;
bool _is_connecting;
+private:
+ DigitalOut _led1;
};
/** A peripheral device will advertise, accept the connection and request
@@ -173,6 +184,11 @@
virtual void on_connect(const Gap::ConnectionCallbackParams_t *connection_event);
void stopAdvertising();
void startAdvertising();
+ virtual bool queueBleDataResponse(ble_at_msg_t at_resp);
+ virtual bool dequeueATdataResponse();
+ virtual void sendATresponseBytes(at_cmd_resp_t at_cmd, const uint8_t * buf, int len);
+ virtual bool setNextCommand(ble_cmd_t cmd);
+ virtual void processQueues();
};