mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
test
This commit is contained in:
4
include/test.h
Normal file
4
include/test.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
void setupTest();
|
||||
void loopTest();
|
||||
21
src/main.cpp
21
src/main.cpp
@@ -1,6 +1,6 @@
|
||||
|
||||
#include <SSDP.h>
|
||||
|
||||
#include "test.h"
|
||||
#include "Class/CallBackTest.h"
|
||||
#include "Class/NotAsinc.h"
|
||||
#include "Class/ScenarioClass.h"
|
||||
@@ -87,22 +87,7 @@ void setup() {
|
||||
just_load = false;
|
||||
initialized = true;
|
||||
|
||||
String buf = "Geeks-for-Geeks";
|
||||
int buf_len = buf.length() + 1;
|
||||
char char_array[buf_len];
|
||||
buf.toCharArray(char_array, buf_len);
|
||||
char* token = strtok(char_array, "-");
|
||||
while (token != NULL) {
|
||||
printf("%s\n", token);
|
||||
token = strtok(NULL, "-");
|
||||
}
|
||||
|
||||
//char str[] = "Geeks for Geeks";
|
||||
//char* token;
|
||||
//char* rest = str;
|
||||
//while ((token = strtok_r(rest, " ", &rest))) {
|
||||
// printf("%s\n", token);
|
||||
//}
|
||||
setupTest();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
@@ -122,7 +107,7 @@ void loop() {
|
||||
MqttClient::loop();
|
||||
mySwitch->loop();
|
||||
myScenario->loop();
|
||||
//loopScenario();
|
||||
loopTest();
|
||||
loopCmd();
|
||||
loopSerial();
|
||||
|
||||
|
||||
28
src/test.cpp
Normal file
28
src/test.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include "Global.h"
|
||||
#include "test.h"
|
||||
|
||||
void setupTest() {
|
||||
//пример выделения подстрок
|
||||
String buf = "Geeks-for-Geeks";
|
||||
int buf_len = buf.length() + 1;
|
||||
char char_array[buf_len];
|
||||
buf.toCharArray(char_array, buf_len);
|
||||
|
||||
char* token = strtok(char_array, "-");
|
||||
|
||||
while (token != NULL) {
|
||||
printf("%s\n", token);
|
||||
token = strtok(NULL, "-");
|
||||
}
|
||||
|
||||
//char str[] = "Geeks for Geeks";
|
||||
//char* token;
|
||||
//char* rest = str;
|
||||
//while ((token = strtok_r(rest, " ", &rest))) {
|
||||
// printf("%s\n", token);
|
||||
//}
|
||||
}
|
||||
|
||||
void loopTest() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user