# Obtaining neighbors cell MCC and MNC

**URL:** <https://forum.legato.io/t/obtaining-neighbors-cell-mcc-and-mnc/5135>\
**Category:** Legato Application Framework\
**Created:** [April 3, 2020, 2:46pm UTC](https://forum.legato.io/t/obtaining-neighbors-cell-mcc-and-mnc/5135 "2020-04-03T14:46:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [April 3, 2020, 2:46pm UTC](https://forum.legato.io/t/obtaining-neighbors-cell-mcc-and-mnc/5135/1 "2020-04-03T14:46:22Z")

</div>

Hello,

Legato version: 18.06  
Module: WP76xx

I am using [le\_mrc\_NeighborCellsRef\_t](https://docs.legato.io/14_04_1/le__mrc_8h.html#a672ea94ad892bb95f43836b5fbd24188) api and I am interested in knowing if the neighbor cell towers obtained through use of this API on legato **18.06.03** can be of different MCC and MNC than the connection that is currently being used?

So the clear up things, I establish a connection to a network, I then call the function in order to obtain info like _cell id_ and _location code_ but I would also like to know the MNC and MCC codes for that cell, is that possible?

The only thing that I saw was

# PCI Network Scan

The PCI scan is not supported by all platforms. The table below indicates on which platform the fature is available. Also, only LTE PCI scan is supported.

| | AR755x | AR758x | AR759x | AR8652 | WP750x | WP76xx | WP77xx | WP8548 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| LTE PCI scan feature | | X | X | | | X | | |

In order to perform an LTE PCI scan, ensure that only LE\_MRC\_BITMASK\_RAT\_LTE is enabled in the RAT preference settings before starting the scan. The configuration can be done using:

- AT command: AT!SELRAT=06
- CM tool: cm radio rat LTE
- Legato API: le\_mrc\_SetRatPreferences(LE\_MRC\_BITMASK\_RAT\_LTE).

**But I am interested in knowing if this is possible for connections other than LTE because I need to support other technologies available on my WP76xx other than LTE also.**

---

<div class="post-metadata">

**Author:** ![plu](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@plu](https://forum.legato.io/u/plu)\
**Post date:** [April 9, 2020, 10:24am UTC](https://forum.legato.io/t/obtaining-neighbors-cell-mcc-and-mnc/5135/2 "2020-04-09T10:24:31Z")

</div>

hi @lazzox,  
yes you’re right, PCI network scan is only supported for LTE Rat;  
but I think you can try using the API le\_mrc\_PerformCellularNetworkScan()  
for example you can see [Sample code for Network Scan - Legato Docs](https://docs.legato.io/latest/c_mrcNetworkScan.html)  
BR

---

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [April 9, 2020, 10:41am UTC](https://forum.legato.io/t/obtaining-neighbors-cell-mcc-and-mnc/5135/3 "2020-04-09T10:41:37Z")

</div>

Can I use PCI network scan if my RAT is set to ALL and I am connected to a network using LTE?

{  
“cellTowers”: [  
{  
“cellId”: 42,  
“locationAreaCode”: 415,  
“mobileCountryCode”: 310,  
“mobileNetworkCode”: 410,  
}  
]  
}

This is the data I need to get from Neighbours cells, mcc, mnc, locAreacode and cellId.  
The thing is that I don’t want to limit my device to LTE only, but I’d like to get the PCI network scan if possible, if not then I’m good with the data I’ve gathered for the currently running cell (the one Im connected to).

---

<div class="post-metadata">

**Author:** ![plu](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@plu](https://forum.legato.io/u/plu)\
**Post date:** [April 9, 2020, 10:47am UTC](https://forum.legato.io/t/obtaining-neighbors-cell-mcc-and-mnc/5135/4 "2020-04-09T10:47:16Z")

</div>

hi @lazzox,  
no it won’t work, as written in the document you indicated, the RAT should be set to LTE.  
unless the scan won’t be performed properly or you won’t have any result.  
BR

---

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [April 9, 2020, 3:24pm UTC](https://forum.legato.io/t/obtaining-neighbors-cell-mcc-and-mnc/5135/5 "2020-04-09T15:24:25Z")

</div>

@plu I understand, thank you for the information.

I have another question, is it possible to somehow determine if neighbor celltower belongs the same network that I’m connected to? Because that way I would know the mnc and mcc of the tower. I saw that I can’t obtain neighbors provider string (name of the provider) so I am uncertain if there is a way to connect these two?

---

<div class="post-metadata">

**Author:** ![plu](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@plu](https://forum.legato.io/u/plu)\
**Post date:** [April 14, 2020, 12:22pm UTC](https://forum.legato.io/t/obtaining-neighbors-cell-mcc-and-mnc/5135/6 "2020-04-14T12:22:57Z")

</div>

hi @lazzox,  
I’m not sure to understand what you mean exactly.  
with le\_mrc\_PerformCellularNetworkScan() API you can retrieve the MNC/MCC for each scanned network.  
normally we talk about the neighbor cells of a serving cell or main cell, and it is usually on the one the device is registered.  
so the MNC/MCC is the same for all that cells.  
Best Regards

---

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [April 14, 2020, 2:15pm UTC](https://forum.legato.io/t/obtaining-neighbors-cell-mcc-and-mnc/5135/7 "2020-04-14T14:15:10Z")

</div>

Just so I can confirm what you told me, when I use this API:

[le\_mrc\_NeighborCellsRef\_t](https://docs.legato.io/18_05/le __mrc__ interface_8h.html#a672ea94ad892bb95f43836b5fbd24188) [le\_mrc\_GetNeighborCellsInfo](https://docs.legato.io/18_05/le __mrc__ interface_8h.html#a8d44fe46e61f3399c5e0dd6002b042ae) (void)

all Neighbor cells present here are on the same network as the serving cell (the one currently used)? If this is correct then this solves my issue.

---

<div class="post-metadata">

**Author:** ![plu](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@plu](https://forum.legato.io/u/plu)\
**Post date:** [April 14, 2020, 2:42pm UTC](https://forum.legato.io/t/obtaining-neighbors-cell-mcc-and-mnc/5135/8 "2020-04-14T14:42:29Z")

</div>

hi @lazzox,  
yes this is correct.  
BR

---

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [April 14, 2020, 2:42pm UTC](https://forum.legato.io/t/obtaining-neighbors-cell-mcc-and-mnc/5135/9 "2020-04-14T14:42:58Z")

</div>

Thank you for your support.
