• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiónc08321812daa81a14d7c85d36b0b55ea7a938d98 (tree)
Tiempo2020-11-18 23:05:43
Autorkazuhiro_kondow <simauma.circus@gmai...>
Commiterkazuhiro_kondow

Log Message

コンソールログをFマクロに置き換え

Cambiar Resumen

Diferencia incremental

--- a/LoRa_farme/server_lg01/server_lg01.ino
+++ b/LoRa_farme/server_lg01/server_lg01.ino
@@ -78,7 +78,7 @@ void setup()
7878
7979 void loop()
8080 {
81- Console.println(F("Start Listening "));
81+ Console.println("Start Listening ");
8282 //receive data buffer
8383 uint8_t buf[MAX_DATA_SIZE];
8484 //data buffer length
@@ -98,23 +98,11 @@ void loop()
9898 // Listen Data from LoRa Node
9999 if (rf95.waitAvailableTimeout(2000))
100100 {
101- Console.println(F("Receive LoRa Message"));
101+ Console.println("Receive LoRa Message");
102102 // Check and Store Recive Sensor Data
103103 if (rcvSensorData(buf,&len))
104104 {
105- Console.println(F("Recive success"));
106-
107- // for debug
108- // Console.println(F("recevi data "));
109- // Console.print(F("len:"));
110- // Console.println(len);
111- // Console.println(F("buf:"));
112- // for (int i = 0; i < len; i++)
113- // {
114- // Console.print(buf[i], HEX);
115- // Console.print(",");
116- // }
117- // Console.println("");
105+ Console.println("Recive success");
118106
119107 // set MQTT Topics
120108 int topics_type = 0;
@@ -147,32 +135,32 @@ void loop()
147135 switch(topics_type)
148136 {
149137 case 0:
150- Console.println(F("None matching MQTT Topics!! Stop MQTT Publish."));
138+ Console.println("None matching MQTT Topics!! Stop MQTT Publish.");
151139 break;
152140 case 1:
153- Console.println(F("send MQTT_TOPICS_STANDBY."));
141+ Console.println("send MQTT_TOPICS_STANDBY.");
154142 runMQTTPub(postdata,F(MQTT_TOPICS_STANDBY));
155143 break;
156144 case 2:
157- Console.println(F("send MQTT_TOPICS_ENV."));
145+ Console.println("send MQTT_TOPICS_ENV.");
158146 runMQTTPub(postdata,F(MQTT_TOPICS_ENV));
159147 break;
160148 case 3:
161- Console.println(F("send MQTT_TOPICS_TRAP."));
149+ Console.println("send MQTT_TOPICS_TRAP.");
162150 runMQTTPub(postdata,F(MQTT_TOPICS_TRAP));
163151 break;
164152 case 4:
165- Console.println(F("send MQTT_TOPICS_BOILER."));
153+ Console.println("send MQTT_TOPICS_BOILER.");
166154 runMQTTPub(postdata,F(MQTT_TOPICS_BOILER));
167155 break;
168156 default:
169- Console.println(F("Switch Topics is None matching..."));
157+ Console.println("Switch Topics is None matching...");
170158 break;
171159 }
172160 }
173161 else
174162 {
175- Console.println(F("Recive Failure"));
163+ Console.println("Recive Failure");
176164 }
177165 }
178166 }
@@ -239,8 +227,8 @@ boolean rcvSensorData(uint8_t *buf,uint8_t *len)
239227 }
240228 else
241229 {
242- Console.println(F("Bat CRC"));
243- Console.println(F("Send Reply NAK"));
230+ Console.println("Bat CRC");
231+ Console.println("Send Reply NAK");
244232 result = false;
245233 }
246234
@@ -286,18 +274,18 @@ void runMQTTPub(const char*param,const String & topics)
286274 // Console.println(F("Called runMQTTPub."));
287275
288276 Process process;
289- process.begin(F("mosquitto_pub"));
290- process.addParameter(F("-h"));
291- process.addParameter(F(MQTT_BROKER_URL));
292- process.addParameter(F("-p"));
293- process.addParameter(F(MQTT_BROKER_PORT));
294- process.addParameter(F("-u"));
295- process.addParameter(F(MQTT_USERNAME));
296- process.addParameter(F("-P"));
297- process.addParameter(F(MQTT_PASSWORD));
298- process.addParameter(F("-t"));
277+ process.begin("mosquitto_pub");
278+ process.addParameter("-h");
279+ process.addParameter(MQTT_BROKER_URL);
280+ process.addParameter("-p");
281+ process.addParameter(MQTT_BROKER_PORT);
282+ process.addParameter("-u");
283+ process.addParameter(MQTT_USERNAME);
284+ process.addParameter("-P");
285+ process.addParameter(MQTT_PASSWORD);
286+ process.addParameter("-t");
299287 process.addParameter(topics);
300- process.addParameter(F("-m"));
288+ process.addParameter("-m");
301289 process.addParameter(param);
302290 process.run();
303291
@@ -307,18 +295,18 @@ void runMQTTPub(const char*param,const String & topics)
307295 Console.print(c);
308296 }
309297 Console.println("");
310- Console.println(F("Process is not available!"));
298+ Console.println("Process is not available!");
311299
312300 Console.flush();
313301 }
314302
315303 void runCurl()
316304 {
317- Console.println(F("Called runCurl."));
305+ Console.println("Called runCurl.");
318306
319307 Process process;
320308
321- process.begin(F("curl"));
309+ process.begin("curl");
322310 process.addParameter(F(KickUrl));
323311 process.run();
324312
@@ -328,7 +316,7 @@ void runCurl()
328316 Console.print(c);
329317 }
330318 Console.println("");
331- Console.println(F("Process is not available!"));
319+ Console.println("Process is not available!");
332320
333321 Console.flush();
334322 }
@@ -338,7 +326,7 @@ unsigned long runUnixTimeStamp()
338326 {
339327 Process process;
340328 unsigned long unix_time_stamp_val = 0;
341- process.begin(F("date"));
329+ process.begin("date");
342330 process.addParameter("+%s");
343331 process.run();
344332