Okundu Omeni
/
wifi-https-ble-sm-uart-atcmd-5-13-1
this is using the mbed os version 5-13-1
Diff: source/BleManager.cpp
- Branch:
- PassingRegression
- Revision:
- 123:a49e9ffbaca6
- Parent:
- 121:ac4f59839e4f
- Child:
- 124:eae4512b131b
--- a/source/BleManager.cpp Tue Jun 11 20:23:43 2019 +0000 +++ b/source/BleManager.cpp Fri Jun 14 21:13:46 2019 +0000 @@ -605,6 +605,8 @@ sendATresponseBytes(BLE_DISCONNECT_EVENT); } + + void SMDevicePeripheral::processQueues() { dequeueATdataResponse(); @@ -626,6 +628,44 @@ bleCmd = BLE_CMD_NONE; break; } + case BLE_CMD_MAC_ADDR: + { + // send BLE MAC_ADDR + _aT2BleDatamPool->free(data_msg); + at_data_resp = new ble_at_msg_t; + char * respStr = (char *)at_data_resp->buffer; + /* print device address */ + Gap::AddressType_t addr_type; + Gap::Address_t addr; + _ble.gap().getAddress(&addr_type, addr); + //dbg_printf(LOG, "Device address: %02x:%02x:%02x:%02x:%02x:%02x\r\n", + // addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]); + sprintf(respStr, "\r\n%s%d,%02X%02X%02X%02X%02X%02X\r\n", LOCAL_ADDRESS_RESP + , BLE_IF_ID + , addr[5] + , addr[4] + , addr[3] + , addr[2] + , addr[1] + , addr[0] + ); + at_data_resp->dataLen = strlen(respStr); // get bytes total + sendATresponseBytes(AT_BLE_MAC_RESP); + bleCmd = BLE_CMD_NONE; + break; + } + case BLE_CMD_DEVICE_NAME: + { + // send BLE_CMD_DEVICE_NAME + _aT2BleDatamPool->free(data_msg); + at_data_resp = new ble_at_msg_t; + char * respStr = (char *)at_data_resp->buffer; + sprintf(respStr, "\r\n%s%s\r\n", BLE_DEVICE_NAME_RESP, ble_config->deviceName); + at_data_resp->dataLen = strlen(respStr); // get bytes total + sendATresponseBytes(AT_BLE_NAME_RESP); + bleCmd = BLE_CMD_NONE; + break; + } case BLE_CMD_SEND_RX_DATA_2AT: sendATresponseBytes(AT_BLE_RESPONSE); bleCmd = BLE_CMD_NONE;