File tree Expand file tree Collapse file tree 5 files changed +23
-0
lines changed
samples/nrf9160/modem_shell Expand file tree Collapse file tree 5 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ nRF9160 samples
130
130
131
131
* Added a new shell command ``cloud `` for establishing an MQTT connection to nRF Cloud.
132
132
* Removed support for the GPS driver.
133
+ * The LED 1 on the development kit indicates the LTE registration status.
133
134
134
135
* :ref: `http_application_update_sample ` sample:
135
136
Original file line number Diff line number Diff line change @@ -621,6 +621,14 @@ Button 1:
621
621
Button 2:
622
622
Enables or disables the UARTs for power consumption measurements. Toggles between UARTs enabled and disabled.
623
623
624
+ LED indications
625
+ ===============
626
+
627
+ The LEDs have the following functions:
628
+
629
+ LED 1:
630
+ Indicates the LTE registration status.
631
+
624
632
Testing
625
633
=======
626
634
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ CONFIG_MULTICELL_LOCATION_SERVICE_NRF_CLOUD=y
141
141
142
142
# Library for buttons and LEDs
143
143
CONFIG_DK_LIBRARY=y
144
+ CONFIG_DK_LIBRARY_INVERT_LEDS=n
144
145
145
146
# FOTA
146
147
CONFIG_FLASH=y
Original file line number Diff line number Diff line change 17
17
#include <modem/lte_lc.h>
18
18
#include <modem/pdn.h>
19
19
20
+ #include <dk_buttons_and_leds.h>
21
+
20
22
#include <nrf_socket.h>
21
23
22
24
#include "link_settings.h"
@@ -47,6 +49,8 @@ struct pdn_activation_status_info {
47
49
uint8_t cid ;
48
50
};
49
51
52
+ #define REGISTERED_STATUS_LED DK_LED1
53
+
50
54
/* Work for getting the modem info that ain't in lte connection ind: */
51
55
static struct k_work registered_work ;
52
56
@@ -147,6 +151,8 @@ static void link_registered_work(struct k_work *unused)
147
151
148
152
ARG_UNUSED (unused );
149
153
154
+ dk_set_led_on (REGISTERED_STATUS_LED );
155
+
150
156
memset (pdn_act_status_arr , 0 ,
151
157
CONFIG_PDN_CONTEXTS_MAX * sizeof (struct pdn_activation_status_info ));
152
158
@@ -333,6 +339,8 @@ void link_ind_handler(const struct lte_lc_evt *const evt)
333
339
evt -> nw_reg_status == LTE_LC_NW_REG_REGISTERED_HOME ||
334
340
evt -> nw_reg_status == LTE_LC_NW_REG_REGISTERED_ROAMING ) {
335
341
k_work_submit (& registered_work );
342
+ } else {
343
+ dk_set_led_off (REGISTERED_STATUS_LED );
336
344
}
337
345
break ;
338
346
case LTE_LC_EVT_CELL_UPDATE :
Original file line number Diff line number Diff line change @@ -200,6 +200,11 @@ void main(void)
200
200
#endif
201
201
k_poll_signal_init (& mosh_signal );
202
202
203
+ err = dk_leds_init ();
204
+ if (err ) {
205
+ printk ("Cannot initialize LEDs (err: %d)" , err );
206
+ }
207
+
203
208
/* Resize terminal width and height of the shell to have proper command editing. */
204
209
shell_execute_cmd (shell , "resize" );
205
210
/* Run empty command because otherwise "resize" would be set to the command line. */
You can’t perform that action at this time.
0 commit comments