* debug changes
This commit is contained in:
parent
5417e8a330
commit
d58fc08526
@ -13,6 +13,8 @@ int socket;
|
|||||||
int pending;
|
int pending;
|
||||||
char * buffer;
|
char * buffer;
|
||||||
|
|
||||||
|
int sendResult = 0;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
buffer = static_cast<char*>(malloc(250));
|
buffer = static_cast<char*>(malloc(250));
|
||||||
DEBUG_STREAM.begin(DEBUG_STREAM_BAUD);
|
DEBUG_STREAM.begin(DEBUG_STREAM_BAUD);
|
||||||
@ -30,21 +32,24 @@ void setup() {
|
|||||||
nbiot.connectSocket();
|
nbiot.connectSocket();
|
||||||
|
|
||||||
socket = nbiot.createSocket(1313);
|
socket = nbiot.createSocket(1313);
|
||||||
DEBUG_STREAM.print("socket: ");
|
|
||||||
DEBUG_STREAM.println(socket);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
DEBUG_STREAM.println("loop() start");
|
DEBUG_STREAM.println(F(__FILE__":loop() start"));
|
||||||
nbiot.sendSocket(socket, "87.229.111.223", 1111, "asdf", 4);
|
sendResult = nbiot.sendSocket(socket, "87.229.111.223", 1111, "asdf", 4);
|
||||||
|
DEBUG_STREAM.print(F(__FILE__":loop() sent:"));
|
||||||
|
DEBUG_STREAM.println(sendResult);
|
||||||
|
|
||||||
|
delay(2000);
|
||||||
|
|
||||||
pending = nbiot.socketBytesPending(socket);
|
pending = nbiot.socketBytesPending(socket);
|
||||||
if(pending > 0) {
|
if(pending > 0) {
|
||||||
|
DEBUG_STREAM.println(F(__FILE__":loop() got pending"));
|
||||||
nbiot.socketReceive(socket, buffer, pending);
|
nbiot.socketReceive(socket, buffer, pending);
|
||||||
DEBUG_STREAM.println(buffer);
|
DEBUG_STREAM.println(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_STREAM.println("loop() delay");
|
DEBUG_STREAM.println(F(__FILE__":modem_teszt.ino:loop() delay"));
|
||||||
delay(5000);
|
delay(2000);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user