A way to list bonded devices

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

cross mob
Anonymous
Not applicable

Hello,

I know that lesmpkeys_numOfBondedDevice() returns number of bonded devices. but is there a way to get a list of those devices addresses ?

Thanks

0 Likes
1 Solution
Anonymous
Not applicable
#if 0
//This will override BondedInfo with last index.
//This should not be called unless debugging purpose
        {
            LESMPKEYS_BOND_IDX *bondedIndexBlock;

            extern UINT8 lesmpkeys_maxBondedDevices;

            //lesmp_logBytes("\rFind Bonded Info:", bdAddr, 6);
            bondedIndexBlock = (LESMPKEYS_BOND_IDX*)lesmpkeys_getBondedInfoIdx();

            if (bondedIndexBlock)
            {
                LESMPKEYS_BOND_IDX *curPtr = bondedIndexBlock;

                for (i = 0;i < lesmpkeys_maxBondedDevices; i++)
                {
                    ble_trace3("index:%d, adrType:%d, idx :%02x", i, curPtr->adrType, curPtr->idx);
                    ble_tracen(curPtr->address, 6);

                    // move to next block.
                    curPtr ++;
                }

                //
                cfa_mm_Free(bondedIndexBlock);
            }
        }
#endif

Please take a look at this code.  it can be found wiced-smart->bleapp->app->blebgm.c->L1340

-Kevin

View solution in original post

3 Replies
Anonymous
Not applicable
#if 0
//This will override BondedInfo with last index.
//This should not be called unless debugging purpose
        {
            LESMPKEYS_BOND_IDX *bondedIndexBlock;

            extern UINT8 lesmpkeys_maxBondedDevices;

            //lesmp_logBytes("\rFind Bonded Info:", bdAddr, 6);
            bondedIndexBlock = (LESMPKEYS_BOND_IDX*)lesmpkeys_getBondedInfoIdx();

            if (bondedIndexBlock)
            {
                LESMPKEYS_BOND_IDX *curPtr = bondedIndexBlock;

                for (i = 0;i < lesmpkeys_maxBondedDevices; i++)
                {
                    ble_trace3("index:%d, adrType:%d, idx :%02x", i, curPtr->adrType, curPtr->idx);
                    ble_tracen(curPtr->address, 6);

                    // move to next block.
                    curPtr ++;
                }

                //
                cfa_mm_Free(bondedIndexBlock);
            }
        }
#endif

Please take a look at this code.  it can be found wiced-smart->bleapp->app->blebgm.c->L1340

-Kevin

Anonymous
Not applicable

Hi sheref.younan

Have you had a chance to try the code?

-Kevin

0 Likes
Anonymous
Not applicable

Hello kwang,

Well,  actually I didn't try it. seeing the warning in the comment and since my code will be a production code delivered to customers I didn't want to add any unknown side effects.

0 Likes