24. nqLte
The nqLte object is a built-in object for obtaining LTE connection information.
Functional overview:
- Provides the function to acquire the LTE connection information.
- Provides the function to acquire the unique information of the LTE module.
- Provides the function to indicate the antenna level status using the system LED.
Limitations:
- Available only for the Spresense LTE-M configuration.
nqLte Global object
| Methods()/Properties | Summary | Version | Note |
|---|---|---|---|
| nqLte.getSignalQuality() | Gets LTE signal quality information. | 01.03.00+ | |
| nqLte.getIDs() | Gets LTE module identification information. | 01.03.00+ | |
| nqLte.setAntennaLed() | Sets the antenna level indication. | 01.03.00+ | |
| nqLte.set() | Sets the parameters related to the given argument. | 01.03.00+ | |
| nqLte.get() | Gets the parameters related to the given argument. | 01.03.00+ | |
| nqLte.on() | Registers an event handler. | 01.03.00+ | |
| nqLte.isConnected() | Gets the LTE communication status. | 02.00.00+ |
Details
nqLte.getSignalQuality(callback)
Gets LTE signal quality information.
| Name | Type | M/O | Summary | Note |
|---|---|---|---|---|
| callback(sq) | function | mandatory | Executes callback processing when information acquisition is completed. sq : {SignalQuality} LTE signal quality information | |
| return | undefined | - | - |
{SignalQuality}
| Name | Type | Summary | Note |
|---|---|---|---|
| .time | number | Updated date and time (Unixtime) | |
| .registered | number | Registration status of the serving cell 0: Not registered 1: Registered If acquisition fails, it will be 0. | |
| .signal | number | Antenna level Range: 0 - 5 If acquisition fails, it will be 0. | |
| .service | number | Out of service area status 0: Out of service area 1: Within service area If acquisition fails, it will be 0. | |
| .roaming | number | Roaming state 0: Home 1: Roaming If acquisition fails, it will be 0. | When roaming connection, it will be 1. |
| .rssi | number | RSSI [dBm] Range: -113 - -51 -255: Unknown If acquisition fails, it will be -255. | |
| .ber | number | BER Range: 0 - 7, 99 If acquisition fails, it will be 99. | Not use. |
| .sysmode | number | System mode 0: NOSERVICE 7: CAT-1 8: CAT-M1 9: CAT-NB1 If acquisition fails, it will be 0. | |
| .rsrp | number | RSRP [dBm] Range: -141 - -44 -255: Unknown If acquisition fails, it will be -255. | |
| .rsrq | number | RSRQ [dB] Range: -20 - -3 -255: Unknown If acquisition fails, it will be -255. | |
| .sinr | number | SINR [dB] Range: -20 - 30 -21: Unknown If acquisition fails, it will be -21. | |
| .tac | number | TAC (Tracking Area Code) | *Not supported; Always returns 0. |
| .ci | number | CI (Cell ID) | *Not supported; Always returns 0. |
| .mcc | number | MCC (Mobile Country Code) If acquisition fails, it will be 0. | This value is valid when 'registered' is 1. |
| .mnc | number | MNC (Mobile Network Code) If acquisition fails, it will be 0. | This value is valid when 'registered' is 1. |
nqLte.getIDs()
Gets LTE module identification information.
| Name | Type | M/O | Summary | Note |
|---|---|---|---|---|
| return | {LteID} | - | {LteID} : LTE module identification information |
{LteID}
| Name | Type | Summary | Note |
|---|---|---|---|
| .imei | string | IMEI (International Mobile Equipment Identity) It will be a 15-digit character string. | |
| .imsi | string | IMSI (International Mobile Subscriber Identity) It will be a 15-digit character string. If SIM is not detected, it will be blank. | |
| .msisdn | string | MSISDN (Mobile Station International Subscriber Directory Number) If SIM is not detected, it will be blank. | |
| .iccid | string | ICCID (IC Card ID) It will be a 19-20 digit character string. If SIM is not detected, it will be blank. | |
| .model | string | LTE module model name'1250'If the module is not started, it will be blank. |
nqLte.setAntennaLed(ctl)
Sets the antenna level indication.
Use the system LED to indicate the antenna level status.
| Name | Type | M/O | Summary | Note |
|---|---|---|---|---|
| ctl | boolean | mandatory | LED antenna level indication setting true: The LED indicates the antenna level. false: Normal operation Default value is false. | For LED display patterns, please refer to System LED Indications. |
| return | undefined | - | - |
nqLte.set(name[,args...])
Sets the parameters related to the given argument.
| Name | Type | M/O | Summary | Note |
|---|---|---|---|---|
| name | string | mandatory | The name of the parameter to set Names that can be used are: ooswatchdog | |
| args | string, number | optional | Arguments used when setting the value | |
| return | undefined | - | - |
nqLte.set(’ooswatchdog’,timer)
Sets the out-of-service watchdog timer.
This timer starts when it detects out-of-service and stops when it detects within-service.
If out-of-service continues and a timer expired, only the LTE modem will restart.
Attempts to recover from a continuous loss of communication due to an unexpected LTE modem failure.
| Name | Type | M/O | Summary | Note |
|---|---|---|---|---|
| ’ooswatchdog’ | string | mandatory | Name for setting the out-of-service watchdog timer | |
| timer | number | mandatory | The out-of-service watchdog timer value Range: 0 - 24 [hour] If 0 is specified, it becomes disabled. The default value is 0. | |
| return | undefined | - | - |
nqLte.get(name[,args...])
Gets the parameters related to the given argument.
| Name | Type | M/O | Summary | Note |
|---|---|---|---|---|
| name | string | mandatory | The name of the parameter to get Names that can be used are: ooswatchdog | |
| args | string, number | optional | Arguments used when getting the value | |
| return | string, number, undefined | - | string : The requested string data number : The requested number data undefined : Failure due to request error |
nqLte.get(’ooswatchdog’)
Gets the out-of-service watchdog timer settings.
| Name | Type | M/O | Summary | Note |
|---|---|---|---|---|
| ’ooswatchdog’ | string | mandatory | Name to get the out-of-service watchdog timer value | |
| return | number | - | The out-of-service watchdog timer value |
nqLte.on(event,callback)
Registers an event handler.
| Name | Type | M/O | Summary | Note |
|---|---|---|---|---|
| event | string | mandatory | Event name Names that can be used are: reboot | |
| callback() | function | mandatory | Executes callback processing when an event occurs. | |
| return | undefined | - | - |
event : ’reboot’
Executes callback when the LTE module is reboot due to out-of-service watchdog or failure detection, and when returning from the reboot.
The arguments for the callback are as follows:
| Arguments | Type | Summary | Note |
|---|---|---|---|
| cause | number | cause is the cause of reboot. 0: recovery 1: failure 2: ooswatchdog |
nqLte.isConnected()
Gets the LTE communication status.
| Name | Type | M/O | Summary | Note |
|---|---|---|---|---|
| return | boolean | - | LTE communication status true: Available for communication false: Not available for communication |
Object Usage Examples
Sample 1
This is a sample that acquires and displays signal quality information and identification information.
var ids = nqLte.getIDs();
print('imei: '+ids.imei);
print('imsi: '+ids.imsi);
print('msisdn: '+ids.msisdn);
print('iccid: '+ids.iccid);
print('model: '+ids.model);
nqLte.getSignalQuality(function(sq){
print('registered: '+sq.registered.toString());
print('signal: '+sq.signal.toString());
print('service: '+sq.service.toString());
print('roaming: '+sq.roaming.toString());
print('rssi: '+sq.rssi.toString());
print('sysmode: '+sq.sysmode.toString());
print('rsrp: '+sq.rsrp.toString());
print('rsrq: '+sq.rsrq.toString());
print('sinr: '+sq.sinr.toString());
print('tac: '+sq.tac.toString());
print('ci: '+sq.ci.toString());
print('mcc: '+sq.mcc.toString());
print('mnc: '+sq.mnc.toString());
});
