- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to set a peripheral device cannott allow be paired with center(Smart phone)
in my progarm, I call
lesmp_setPairingParam(
LESMP_IO_CAP_DISP_ONLY,
LESMP_OOB_AUTH_DATA_NOT_PRESENT,
LESMP_AUTH_FLAG_NO_BONDING,
LESMP_MAX_KEY_SIZE,
LESMP_KEY_DISTRIBUTION_ENC_KEY
| LESMP_KEY_DISTRIBUTION_ID_KEY
| LESMP_KEY_DISTRIBUTION_SIGN_KEY,
LESMP_KEY_DISTRIBUTION_ENC_KEY
| LESMP_KEY_DISTRIBUTION_ID_KEY
| LESMP_KEY_DISTRIBUTION_SIGN_KEY
);
but device can be paired with center.
How should I set the parameter of lesmp_setPairingParam to refuse to be paired with center ?
or
Which API I should call to to refuse to be paired with center ?
Solved! Go to Solution.
- Labels:
-
SDK 2.X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
void hello_sensor_create(void)
{
...
lel2cap_regConnLessHandler(6, hello_client_l2cap_smp_data_handler);
...
}
void hello_client_l2cap_smp_data_handler(UINT8 *l2capHdr)
{
// if (*(l2capHdr + 4) == LESMP_CODE_PAIRING_RSP )
if (*(l2capHdr + 4) == LESMP_CODE_PAIRING_REQ )
{
// lesmpapi_pairingFailed();
lesmp_sendPairingFailed(LESMP_PAIRING_FAILED_REASON_OOB_NOT_AVAIL);
return;
}
lesmp_l2capHandler(l2capHdr);
}
reference:
~\bleapp\lestack\smp\lesmp_const.h
~\bleapp\lestack\smp\lesmpapi.h
~\bleapp\lestack\smp\lesmp.h
~\bleapp\lestack\l2cap\lel2cap.h
Core_V4.0.pdf, p1958, p1959, p2009-Fig5.10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
not sure i get your question... Does "undirected and not connectable" advertisement able to meet your requirement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to set a slave device that is no support pairing.
I cannot sure "undirected and not connectable" advertisement be able to meet it.
ref. Core_v4.1
( BLUETOOTH SPECIFICATION Version 4.1 [Vol 3] page 660 of 668)
5.3.5.1 Pairing Not Supported by Slave
If the slave device does not support pairing or pairing cannot be performed the
slave can reject the request from the master
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
void hello_sensor_create(void)
{
...
lel2cap_regConnLessHandler(6, hello_client_l2cap_smp_data_handler);
...
}
void hello_client_l2cap_smp_data_handler(UINT8 *l2capHdr)
{
// if (*(l2capHdr + 4) == LESMP_CODE_PAIRING_RSP )
if (*(l2capHdr + 4) == LESMP_CODE_PAIRING_REQ )
{
// lesmpapi_pairingFailed();
lesmp_sendPairingFailed(LESMP_PAIRING_FAILED_REASON_OOB_NOT_AVAIL);
return;
}
lesmp_l2capHandler(l2capHdr);
}
reference:
~\bleapp\lestack\smp\lesmp_const.h
~\bleapp\lestack\smp\lesmpapi.h
~\bleapp\lestack\smp\lesmp.h
~\bleapp\lestack\l2cap\lel2cap.h
Core_V4.0.pdf, p1958, p1959, p2009-Fig5.10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But any one can answer what's different between lesmpapi_pairingFailed() and lesmp_sendPairingFailed(int) ?
They should be used in different stage?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
change from LESMP_PAIRING_FAILED_REASON_OOB_NOT_AVAIL to LESMP_PAIRING_FAILED_REASON_PAIRING_NOT_SUPPORTED