Can BleServDisc_FindService be uses in a Peripheral device ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Can BleServDisc_FindService be uses in a Peripheral device ?

594件の閲覧回数
xl_xmu
Contributor I

Hi,

In the sample project Wireless Uart, there is a section of code in wireless_uart.c like this:

//-------------------------

void BleApp_StateMachineHandler(deviceId_t peerDeviceId, uint8_t event)
{
uint16_t tempMtu = 0;

/* invalid client information */
if(gInvalidDeviceId_c == maPeerInformation[peerDeviceId].deviceId)
{
return;
}

switch (maPeerInformation[peerDeviceId].appState)
{
case mAppIdle_c:
{
if (event == mAppEvt_PeerConnected_c)
{
/* Let the central device initiate the Exchange MTU procedure*/
if (mGapRole == gGapCentral_c)
{
/* Moving to Exchange MTU State */
maPeerInformation[peerDeviceId].appState = mAppExchangeMtu_c;
GattClient_ExchangeMtu(peerDeviceId);
}
else
{
/* Moving to Service Discovery State*/
maPeerInformation[peerDeviceId].appState = mAppServiceDisc_c;

/* Start Service Discovery*/
BleServDisc_FindService(peerDeviceId,
gBleUuidType128_c,
(bleUuid_t*) &uuid_service_wireless_uart);
}
}
}
break;

//-------------------

It shows if the device is a Peripheral device, BleServDisc_FindService needs to be called. But from my point of view, BleServDisc_FindService is a API for Central device, not for Peripheral. 

So, why BleServDisc_FindService needs to be called here ?

B.R

Daniel Xiao

ラベル(2)
0 件の賞賛
1 返信

508件の閲覧回数
estephania_mart
NXP TechSupport
NXP TechSupport

Hello, 

The example has the capabilities to set the device as a central or as a peripheral, you can connect two boards and one can act as a central and one as a peripheral, that it's the reason why both capabilities are added. 

Regards ,
Estephania 

0 件の賞賛