# BLEscan example

**URL:** <https://forum.amebaiot.com/t/blescan-example/1464>\
**Category:** BT\
**Tags:** rtl872xd\
**Created:** [October 8, 2022, 1:38pm UTC](https://forum.amebaiot.com/t/blescan-example/1464 "2022-10-08T13:38:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luke](https://avatars.discourse-cdn.com/v4/letter/l/7ab992/32.png) [@luke](https://forum.amebaiot.com/u/luke)\
**Post date:** [October 8, 2022, 1:38pm UTC](https://forum.amebaiot.com/t/blescan-example/1464/1 "2022-10-08T13:38:07Z")

</div>

Hi, I was wondering if anyone knew the maximum number of BLE signals can be scanned?

I have modified the BLEscan example code to send scan data over I2C to a Raspberry Pi. This requires me to know the largest size buffer needed to store this data and send over I2C. I have looked at several of the source code files hoping to find a macro defined for the maximum number of BLE signals that can be obtained per scan but haven’t yet. My research led me to `gap_scan.h` which lists the function `T_GAP_CAUSE le_scan_start(void)`, however I am unable to find the files that implements this function.

I am looking for something similar to `WL_NETWORKS_LIST_MAXNUM` listed in `wl_definitions.h`. It may be the case that there isn’t a macro defined but I would like to know what the worst case scenario would be for transmitting data so I can allocate my buffer properly.

Thanks!

---

<div class="post-metadata">

**Author:** ![luke](https://avatars.discourse-cdn.com/v4/letter/l/7ab992/32.png) [@luke](https://forum.amebaiot.com/u/luke)\
**Post date:** [October 9, 2022, 7:32pm UTC](https://forum.amebaiot.com/t/blescan-example/1464/2 "2022-10-09T19:32:10Z")

</div>

(couldn’t edit OP so replying with some clarification)

I may have implied that `WL_NETWORKS_LIST_MAXNUM` is the actual maximum number of Wi-Fi signals that can be obtained. However, I do see that the `wifi_scan_networks` function uses the `internal_scan_handler_t` struct that defines `max_ap_size` with an unsigned char thus limiting the retrievable number of signal data to 256 (correct if wrong).

I tried to follow the same logic for finding the BLE class’s maximum number of signals but as I stated above, I am unable to locate the implementation file for `T_GAP_CAUSE le_scan_start(void)`.

---

<div class="post-metadata">

**Author:** ![xidameng](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/xidameng/32/18_2.png) [@xidameng](https://forum.amebaiot.com/u/xidameng)\
**Post date:** [October 10, 2022, 2:14am UTC](https://forum.amebaiot.com/t/blescan-example/1464/3 "2022-10-10T02:14:51Z")

</div>

> [@luke](#):
>
> I am unable to locate the implementation file for `T_GAP_CAUSE le_scan_start(void)`.

Hi , those source files are compiled into libraries and hidden from users. If you could not find the information you need using the [Realtek Standard SDK](https://github.com/ambiot/ambd_sdk), then it is not meant to be released to the public.
