File tree 2 files changed +19
-0
lines changed
libraries/ESP8266WiFi/src
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,23 @@ WiFiPhyMode_t ESP8266WiFiGenericClass::getPhyMode() {
124
124
return (WiFiPhyMode_t) wifi_get_phy_mode ();
125
125
}
126
126
127
+ /* *
128
+ * set the output power of WiFi
129
+ * @param dBm max: +20.5dBm min: 0dBm
130
+ */
131
+ void ESP8266WiFiGenericClass::setOutputPower (float_t dBm) {
132
+
133
+ if (dBm > 20.5 ) {
134
+ dBm = 20.5 ;
135
+ } else if (dBm < 0 ) {
136
+ dBm = 0 ;
137
+ }
138
+
139
+ uint8_t val = (dBm*4 .0f );
140
+ system_phy_set_max_tpw (val);
141
+ }
142
+
143
+
127
144
/* *
128
145
* store WiFi config in SDK flash area
129
146
* @param persistent
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ class ESP8266WiFiGenericClass {
46
46
bool setPhyMode (WiFiPhyMode_t mode);
47
47
WiFiPhyMode_t getPhyMode ();
48
48
49
+ void setOutputPower (float_t dBm);
50
+
49
51
void persistent (bool persistent);
50
52
51
53
bool mode (WiFiMode_t);
You can’t perform that action at this time.
0 commit comments