mirror of
https://github.com/apache/nuttx.git
synced 2026-08-31 06:03:12 +00:00
arch/arm/nrf91: add support for LTE_CMDID_GETCELL
add support for LTE_CMDID_GETCELL ioctl call Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
parent
78682572af
commit
1b600bd282
1 changed files with 32 additions and 0 deletions
|
|
@ -848,6 +848,38 @@ static int nrf91_ioctl_ltecmd(int fd, int cmd, unsigned long arg)
|
|||
break;
|
||||
}
|
||||
|
||||
case LTE_CMDID_GETCELL:
|
||||
{
|
||||
lte_cellinfo_t **cell =
|
||||
(lte_cellinfo_t **)(ltecmd->outparam + 1);
|
||||
int band = 0;
|
||||
|
||||
(*cell)->valid = false;
|
||||
(*cell)->phycell_id = 0;
|
||||
(*cell)->earfcn = 0;
|
||||
(*cell)->option = 0;
|
||||
(*cell)->nr_neighbor = 0;
|
||||
|
||||
/* The modem AT set does not expose the raw EARFCN in a form the
|
||||
* scanf parser here can extract from AT%XMONITOR (quoted fields), so
|
||||
* report the serving band number via AT%XCBAND in the earfcn field.
|
||||
*/
|
||||
|
||||
ret = nrf_modem_at_scanf("AT%XCBAND", "%%XCBAND: %d", &band);
|
||||
if (ret > 0)
|
||||
{
|
||||
(*cell)->earfcn = (uint32_t)band;
|
||||
(*cell)->valid = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
nerr("AT%%XCBAND failed %d\n", ret);
|
||||
}
|
||||
|
||||
ret = OK;
|
||||
break;
|
||||
}
|
||||
|
||||
case LTE_CMDID_SETPSM:
|
||||
{
|
||||
lte_psm_setting_t **psm =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue