11/* !
22 * @file ws_offline_pico_v2.h
33 *
4- * This is a driver for using the Raspberry Pi Pi Pico/Pico2
5- * without a network interface with Adafruit IO Wippersnapper.
4+ * This is a stub class for using the RP2040/RP2350 without a network interface
65 *
76 * Adafruit invests time and resources providing this open source code,
87 * please support Adafruit and open-source hardware by purchasing
98 * products from Adafruit!
109 *
11- * Copyright (c) Brent Rubell 2024- 2025 for Adafruit Industries.
10+ * Copyright (c) Brent Rubell 2025 for Adafruit Industries.
1211 *
1312 * MIT license, all text here must be included in any redistribution.
1413 *
2221#define PICO_CONNECT_TIMEOUT_MS 20000 /* !< Connection timeout (in ms) */
2322#define PICO_CONNECT_RETRY_DELAY_MS 200 /* !< delay time between retries. */
2423
25- #include " Wippersnapper_V2.h"
2624#include " Arduino.h"
25+ #include " Wippersnapper_V2.h"
2726
2827extern Wippersnapper_V2 WsV2;
2928
@@ -41,8 +40,7 @@ class ws_offline_pico_v2 : public Wippersnapper_V2 {
4140 */
4241 /* *************************************************************************/
4342 ws_offline_pico_v2 () : Wippersnapper_V2() {
44-
45- // No-op
43+ // Do-nothing
4644 }
4745
4846 /* *************************************************************************/
@@ -51,7 +49,7 @@ class ws_offline_pico_v2 : public Wippersnapper_V2 {
5149 */
5250 /* *************************************************************************/
5351 ~ws_offline_pico_v2 () {
54- // No-op
52+ // Do-nothing - this class has no resources to release
5553 }
5654
5755 /* *******************************************************/
@@ -64,8 +62,8 @@ class ws_offline_pico_v2 : public Wippersnapper_V2 {
6462 */
6563 /* *******************************************************/
6664 void set_ssid_pass (const char *ssid, const char *ssidPassword) {
67- // No-op
68- WS_DEBUG_PRINTLN ( " Code should not get here !" );
65+ WS_DEBUG_PRINTLN ( " [ws_offline_pico] Error: set_ssid_pass() is not "
66+ " supported in this implementation !" );
6967 }
7068
7169 /* *********************************************************/
@@ -74,7 +72,8 @@ class ws_offline_pico_v2 : public Wippersnapper_V2 {
7472 */
7573 /* *********************************************************/
7674 void set_ssid_pass () {
77- WS_DEBUG_PRINTLN (" Code should not get here!" );
75+ WS_DEBUG_PRINTLN (" [ws_offline_pico] Error: set_ssid_pass() is not "
76+ " supported in this implementation!" );
7877 }
7978
8079 /* **********************************************************/
@@ -84,8 +83,9 @@ class ws_offline_pico_v2 : public Wippersnapper_V2 {
8483 */
8584 /* **********************************************************/
8685 bool check_valid_ssid () {
87- WS_DEBUG_PRINTLN (" Code should not get here!" );
88- return false ;
86+ WS_DEBUG_PRINTLN (" [ws_offline_pico] Error: check_valid_ssid() is not "
87+ " supported in this implementation!" );
88+ return false ; // return an invalid value
8989 }
9090
9191 /* *******************************************************/
@@ -95,7 +95,8 @@ class ws_offline_pico_v2 : public Wippersnapper_V2 {
9595 */
9696 /* *******************************************************/
9797 void getMacAddr () {
98- WS_DEBUG_PRINTLN (" Code should not get here!" );
98+ WS_DEBUG_PRINTLN (" [ws_offline_pico] Error: getMacAddr() is not supported "
99+ " in this implementation!" );
99100 }
100101
101102 /* *******************************************************/
@@ -104,9 +105,11 @@ class ws_offline_pico_v2 : public Wippersnapper_V2 {
104105 @return int32_t RSSI value
105106 */
106107 /* *******************************************************/
107- int32_t getRSSI () {
108- WS_DEBUG_PRINTLN (" Code should not get here!" );
109- return 0 ; }
108+ int32_t getRSSI () {
109+ WS_DEBUG_PRINTLN (" [ws_offline_pico] Error: getRSSI() is not supported in "
110+ " this implementation!" );
111+ return -9999 ; // return an invalid value
112+ }
110113
111114 /* *******************************************************/
112115 /* !
@@ -116,8 +119,8 @@ class ws_offline_pico_v2 : public Wippersnapper_V2 {
116119 */
117120 /* *******************************************************/
118121 void setupMQTTClient (const char *clientID) {
119- // No-op
120- WS_DEBUG_PRINTLN ( " Code should not get here !" );
122+ WS_DEBUG_PRINTLN ( " [ws_offline_pico] Error: setupMQTTClient() is not "
123+ " supported in this implementation !" );
121124 }
122125
123126 /* *******************************************************/
@@ -127,8 +130,10 @@ class ws_offline_pico_v2 : public Wippersnapper_V2 {
127130 */
128131 /* *******************************************************/
129132 ws_status_t networkStatus () {
130- WS_DEBUG_PRINTLN (" Code should not get here!" );
131- return WS_NET_DISCONNECTED;
133+ WS_DEBUG_PRINTLN (" [ws_offline_pico] Error: networkStatus() is not "
134+ " supported in this implementation!" );
135+ return WS_NET_DISCONNECTED; // this value is valid, we are not connected to
136+ // a network
132137 }
133138
134139 /* ******************************************************************/
@@ -137,9 +142,11 @@ class ws_offline_pico_v2 : public Wippersnapper_V2 {
137142 @return Pico
138143 */
139144 /* ******************************************************************/
140- const char *connectionType () {
141- WS_DEBUG_PRINTLN (" Code should not get here!" );
142- return " Pico-Nonet-v2" ; }
145+ const char *connectionType () {
146+ WS_DEBUG_PRINTLN (" [ws_offline_pico] Error: connectionType() is not "
147+ " supported in this implementation!" );
148+ return " ws-offline-pico" ;
149+ }
143150
144151protected:
145152 /* *************************************************************************/
@@ -148,8 +155,8 @@ class ws_offline_pico_v2 : public Wippersnapper_V2 {
148155 */
149156 /* *************************************************************************/
150157 void _connect () {
151- // No-op
152- WS_DEBUG_PRINTLN ( " Code should not get here !" );
158+ WS_DEBUG_PRINTLN ( " [ws_offline_pico] Error: _connect() is not supported in "
159+ " this implementation !" );
153160 }
154161
155162 /* *************************************************************************/
@@ -158,8 +165,8 @@ class ws_offline_pico_v2 : public Wippersnapper_V2 {
158165 */
159166 /* *************************************************************************/
160167 void _disconnect () {
161- // No-op
162- WS_DEBUG_PRINTLN ( " Code should not get here !" );
168+ WS_DEBUG_PRINTLN ( " [ws_offline_pico] Error: _disconnect() is not supported "
169+ " in this implementation !" );
163170 }
164171};
165172
0 commit comments