* debug changes

This commit is contained in:
Danyi Dávid 2017-10-18 00:58:21 +02:00
parent 5417e8a330
commit d58fc08526

View File

@ -13,6 +13,8 @@ int socket;
int pending;
char * buffer;
int sendResult = 0;
void setup() {
buffer = static_cast<char*>(malloc(250));
DEBUG_STREAM.begin(DEBUG_STREAM_BAUD);
@ -30,21 +32,24 @@ void setup() {
nbiot.connectSocket();
socket = nbiot.createSocket(1313);
DEBUG_STREAM.print("socket: ");
DEBUG_STREAM.println(socket);
}
void loop() {
DEBUG_STREAM.println("loop() start");
nbiot.sendSocket(socket, "87.229.111.223", 1111, "asdf", 4);
DEBUG_STREAM.println(F(__FILE__":loop() start"));
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);
if(pending > 0) {
DEBUG_STREAM.println(F(__FILE__":loop() got pending"));
nbiot.socketReceive(socket, buffer, pending);
DEBUG_STREAM.println(buffer);
}
DEBUG_STREAM.println("loop() delay");
delay(5000);
DEBUG_STREAM.println(F(__FILE__":modem_teszt.ino:loop() delay"));
delay(2000);
}