Hi ,
i have test the glucose demo with Android app(like nrf conenct), it works fine.
but with the wireless uart demo, the connection will immediately terminated when the connection established.
when using the iphone, the log from lightblue shows the service are all discovered. the disconnect request is send by the kw36.
here is the log from kw36 uart:
----------------------------------------------------------------------------------- serial port log -----------------------------------------
Wireless UART starting as GAP Central, press the role switch to change it.
Switched role to GAP Peripheral.
Advertising...
Connected to device 0 as slave.
Disconnected from device 0.
Advertising...
Connected to device 0 as slave.
Disconnected from device 0.
Advertising...
Connected to device 0 as slave.
Disconnected from device 0.
Advertising...
Connected to device 0 as slave.
Disconnected from device 0.
Advertising...
Connected to device 0 as slave.
Disconnected from device 0.
Advertising...
----------------------------------------------------------------------------------------------
attention: i have tested 5 times, as log shows
so the problem is absolutely connection issue, not the state/button setting of the kw36.
i have a TI sniffer log, but it seems no use。
Regards,
Hi Ziv,
You are using nrf connect app to connect wirelss uart app, right?
If yes, that is expected.
you can see the reason in the function void BleApp_StateMachineHandler(deviceId_t peerDeviceId, appEvent_t event) implement,
case mAppExchangeMtu_c:
{
if (event == mAppEvt_GattProcComplete_c)
{
/* update stream length with minimum of maximum MTU's of connected devices */
(void)Gatt_GetMtu(peerDeviceId, &tempMtu);
tempMtu = gAttMaxWriteDataSize_d(tempMtu);
mAppUartBufferSize = mAppUartBufferSize <= tempMtu ? mAppUartBufferSize : tempMtu;
/* Moving to Service Discovery State*/
maPeerInformation[peerDeviceId].appState = mAppServiceDisc_c;
/* Start Service Discovery*/
(void)BleServDisc_FindService(peerDeviceId,
gBleUuidType128_c,
temp.pUuidObj);
}
else
{
if (event == mAppEvt_GattProcError_c)
{
(void)Gap_Disconnect(peerDeviceId);
}
}
}
The board will start to find uart service from your cell phone after connect and exchange MTU, which means you need to add a wireless uart service with proper 128 bit UUID on your phone like attached picture.
Hi Jingsai,
very thanks. :smileyhappy:
i have searched the "Gap_Disconnect" and found the course. for i found the Iot toolbox (iphone version) is working fine, just others have this issue.
Regards,
Ziv
Hi Ziv,
We are working on this issue, could you please confirm the gapPairingParameters_t that you have?
Did you set bonding and paring flag as 1?
Do you set gSecurityMode_1_Level_4_c and Secure connections as TRUE?
Regards,
Mario
Hi Mario,
thanks for your response.
what i am using is the original demo code from the sdk.
actually i have doubted the connection parameters request from the app(iphone/ android), once i have sniffered a log that
the app send the request, but have not found the accept message from slave. and then disconnected.
the above code segment is from BleConnManager_GapPeripheralEvent.
besides, there should be a problem in function BleConnManager_GapCentralEvent:
in the central role, if the gConnUpdateAlwaysAccept_d is set to 0 and the connection interval min = 6, then the result is false. the judgement of the value logic need to check.
Regards,
Ziv