BLE Nano Code.Tested with Integrated mDot code
Dependencies: BLE_API mbed nRF51822
Fork of eco_Labs_ble_Client by
Diff: ble_msg_handler.cpp
- Revision:
- 19:c190dd954ff1
- Parent:
- 18:d210f580ff04
- Child:
- 20:5c49ca82a9a1
--- a/ble_msg_handler.cpp Mon Oct 17 14:17:47 2016 +0000 +++ b/ble_msg_handler.cpp Mon Oct 17 16:33:24 2016 +0000 @@ -29,7 +29,7 @@ extern void ble_data_rx_cb_register(ble_data_ready_callback_t data_rx_callback); extern void spi_data_rx_cb_register(spi_data_ready_callback_t data_rx_callback); extern eStatus_t ble_send_data(uint8_t *tx_buf, uint8_t length); -extern void ble_init(void); +extern void ble_init(uint8_t *device_name); extern void spi_slave_tx_data(uint8_t *tx_buf, uint8_t len); /******************************************************************************/ @@ -76,8 +76,9 @@ } else if (rx_data[1] == BLE_SOF_CMD) { switch (rx_data[2]) { case BLE_INIT_CMD: - // TODO: Get the BLE Device name from rx_data and pass it to ble_init - ble_init(); + // TODO: Get the BLE Device name from rx_data and pass it to ble_init + memcpy(tmp_buf, &rx_data[4], rx_data[3]); + ble_init(tmp_buf); toggle_led(); break;