Cannot launch second characteristic of one service after launching first characteristic

06 Mar 2017

have another question. Is there only one service with one characteristic that the central can launch ?

The peripheral has one service with two characteristics. The central can discover the first one characteristic but can't discover the second one at the same time.

In the connectionCallBack callback function described as above,ble can launch the service with RX characteristic and it works well but it can't launch the service with TX characteristic Please help. Thank you !

My code is as follows:

include the mbed library with this snippet

_#define TXRX_BUF_LEN                      30_
uint8_t tx_value[TXRX_BUF_LEN] = {0,};
uint8_t rx_value[TXRX_BUF_LEN] = {0,};
GattCharacteristic characteristic1(UARTServiceTXCharacteristicUUID, tx_value, 1, TXRX_BUF_LEN, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE);
GattCharacteristic characteristic2(UARTServiceRXCharacteristicUUID, rx_value, 1, TXRX_BUF_LEN, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY);
GattCharacteristic *uartChars[] = {&characteristic1, &characteristic2};
GattService     uartService(UARTServiceUUID, uartChars, sizeof(uartChars) / sizeof(GattCharacteristic *));

void connectionCallBack( const Gap::ConnectionCallbackParams_t *params )
{
ble.gattClient().launchServiceDiscovery(params->handle, ServiceCallBack, CharacteristicCallBack, UARTServiceUUID, UARTServiceRXCharacteristicUUID);

ble.gattClient().launchServiceDiscovery(params->handle, ServiceCallBack_new, CharacteristicCallBack_new, UARTServiceUUID, UARTServiceTXCharacteristicUUID);
}