API Document for lesmp_ series function?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi BCM support,

Since the OOB issue, we are reviewing all the example and headers, but we can not find any document talk about them. Please kindly provide useful document for the lesmp_ APIs.

I also check the post : Is there a document which describes the lesmp_ type function parameters?

It seems you did some doc for the APIs last year, where can I find them?

Thanks.

0 Likes
1 Solution

The following optional patch will allow multiple key storage over 5(the default) by overwriting the oldest. This is a required patch if pairing with more than one host is required.

------------------------------------------------------------------

smp_multi_key_storage

------------------------------------------------------------------

We also have a set of functions to detect the bonded table filling. You can use lesmpkeys_numOfBondedDevice() to get the number of bonded devices, and lesmpkeys_maxNumOfBondedDevice() to check the default max.

View solution in original post

0 Likes
10 Replies
Anonymous
Not applicable

Hello Henry,

All of the lesmp API's are internal API's and are not documented.

There are a few in the OOB pairing and passkey pairing used in hello_sensor.

#if defined OOB_PAIRING || defined PASSKEY_PAIRING

   // setup the pairing parameters.

#ifdef OOB_PAIRING

  LESMP_OOB_AUTH_DATA_FROM_REMOTE_PRESENT,// OOBDataFlag,

  LESMP_OOB_AUTH_DATA_NOT_PRESENT,  // OOBDataFlag,

#ifdef PASSKEY_PAIRING

  LESMP_AUTH_FLAG_BONDING // AuthReq,

  LESMP_AUTH_FLAG_BONDING, // AuthReq,

  LESMP_MAX_KEY_SIZE,  // MaxEncKeySize,

   // InitiatorKeyDistrib,

   // ResponderKeyDistrib

These are the only ones that the App should be using

Hope this helps,

JT

0 Likes
Anonymous
Not applicable

Hi j.t,

Thanks. I knew that, it can be traced in example code. For me, I just want the know how such like the below discussion:

How to set peripheral device to refuse to be paired with center

Is there also some document to talk about the lel2cap_series API? Or just some black magics again? How did he know to use such kind of API under such kind of condition? Just guess and test?

0 Likes
Anonymous
Not applicable

Hello Henry,

Many of the functions that you are inquiring about are the exact names within the BLE Spec

The thread that you viewed shows an Apps Engineer from EDOM and you should contact them,

Thanks.

JT

0 Likes
Anonymous
Not applicable

Hi j.t and forrest.chien,

Ok. so I just ask what I want to know.

Here comes one--

I found there is a API "lesmpkeys_removeAllBondInfo()" which can remove all the bonding info.

1. The bonding info also store in NV area, right?

2. What is the maximum bonding info it can store?

3. If I just want to remove 1 bonding info in the bonding info pool. How should I do? Just call "lesmpkeys_deleteBondInfo()"? Then what is the "adrType" in param?

Thanks.

0 Likes

Hello forrest.chien, can you get Jim Hsieh to comment on this?

jimhsieh

0 Likes
Anonymous
Not applicable

Hi forrest.chien​, jimhsieh​ and boont​,

Did you have any more update about my question?

0 Likes
Anonymous
Not applicable

From my experiments:

1) The bonding info is definitely stored in the NV area.

2) The default setting is 5 bonds which is defined in lesmpkeys.h.  You can also use lesmpkeys_maxNumOfBondedDevice().  However, this is also limited to how much NV area you have.  Their NV storage mechanism is key based and is allocated on demand, so if you allocate too many things, you may not even be able to store a single bond.

3) You can use the lesmpkeys_deleteBondInfo() API and the adrType is either 0-Public or 1-Random

But I am having some issues though regarding bonding.  It seems that when you go beyond the max number of bonded devices, I'm unable to do additional parings even if I try to remove a specific address using the lesmpkeys_deleteBondInfo() command.  Only the lesmpkeys_removeAllBondInfo() seems to recover from that.  And in some scenarios, this doesn't even recover it unless you can erase the NV area.

I would really like to know if it is possible to automatically throw out the oldest bond when the max bonded devices have been reached and you just want to bond with a new device? 

Or is it possible to only cache the bonds (i.e. not write it to memory) for a scenario that rebonding is o.k. for the power cycle scenario.

Anonymous
Not applicable

Hi Howard,

Unfortunately, it is not possible to automatically throw out the oldest bond to bond with a new device. You could try to have your application do that manually.

0 Likes
Anonymous
Not applicable

Hi Lucyli,

Thanks for the response.  Just one more question, what is the behavior after all the bond keys have been taken used up?

0 Likes

The following optional patch will allow multiple key storage over 5(the default) by overwriting the oldest. This is a required patch if pairing with more than one host is required.

------------------------------------------------------------------

smp_multi_key_storage

------------------------------------------------------------------

We also have a set of functions to detect the bonded table filling. You can use lesmpkeys_numOfBondedDevice() to get the number of bonded devices, and lesmpkeys_maxNumOfBondedDevice() to check the default max.

0 Likes