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
130130
131131 * Added a new shell command ``cloud `` for establishing an MQTT connection to nRF Cloud.
132132 * Removed support for the GPS driver.
133+ * The LED 1 on the development kit indicates the LTE registration status.
133134
134135* :ref: `http_application_update_sample ` sample:
135136
Original file line number Diff line number Diff line change @@ -621,6 +621,14 @@ Button 1:
621621Button 2:
622622 Enables or disables the UARTs for power consumption measurements. Toggles between UARTs enabled and disabled.
623623
624+ LED indications
625+ ===============
626+
627+ The LEDs have the following functions:
628+
629+ LED 1:
630+ Indicates the LTE registration status.
631+
624632Testing
625633=======
626634
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ CONFIG_MULTICELL_LOCATION_SERVICE_NRF_CLOUD=y
141141
142142# Library for buttons and LEDs
143143CONFIG_DK_LIBRARY=y
144+ CONFIG_DK_LIBRARY_INVERT_LEDS=n
144145
145146# FOTA
146147CONFIG_FLASH=y
Original file line number Diff line number Diff line change 1717#include <modem/lte_lc.h>
1818#include <modem/pdn.h>
1919
20+ #include <dk_buttons_and_leds.h>
21+
2022#include <nrf_socket.h>
2123
2224#include "link_settings.h"
@@ -47,6 +49,8 @@ struct pdn_activation_status_info {
4749 uint8_t cid ;
4850};
4951
52+ #define REGISTERED_STATUS_LED DK_LED1
53+
5054/* Work for getting the modem info that ain't in lte connection ind: */
5155static struct k_work registered_work ;
5256
@@ -147,6 +151,8 @@ static void link_registered_work(struct k_work *unused)
147151
148152 ARG_UNUSED (unused );
149153
154+ dk_set_led_on (REGISTERED_STATUS_LED );
155+
150156 memset (pdn_act_status_arr , 0 ,
151157 CONFIG_PDN_CONTEXTS_MAX * sizeof (struct pdn_activation_status_info ));
152158
@@ -333,6 +339,8 @@ void link_ind_handler(const struct lte_lc_evt *const evt)
333339 evt -> nw_reg_status == LTE_LC_NW_REG_REGISTERED_HOME ||
334340 evt -> nw_reg_status == LTE_LC_NW_REG_REGISTERED_ROAMING ) {
335341 k_work_submit (& registered_work );
342+ } else {
343+ dk_set_led_off (REGISTERED_STATUS_LED );
336344 }
337345 break ;
338346 case LTE_LC_EVT_CELL_UPDATE :
Original file line number Diff line number Diff line change @@ -200,6 +200,11 @@ void main(void)
200200#endif
201201 k_poll_signal_init (& mosh_signal );
202202
203+ err = dk_leds_init ();
204+ if (err ) {
205+ printk ("Cannot initialize LEDs (err: %d)" , err );
206+ }
207+
203208 /* Resize terminal width and height of the shell to have proper command editing. */
204209 shell_execute_cmd (shell , "resize" );
205210 /* 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