removed debug logging
This commit is contained in:
@@ -15,13 +15,9 @@ void TF_WriteImpl(TinyFrame *tf, const uint8_t *buff, size_t len)
|
|||||||
GexClient *gc = tf->userdata;
|
GexClient *gc = tf->userdata;
|
||||||
assert(gc->acm_fd != 0);
|
assert(gc->acm_fd != 0);
|
||||||
|
|
||||||
hexDump("TF_Write", buff, (uint32_t)len);
|
|
||||||
|
|
||||||
ssize_t rv = write(gc->acm_fd, buff, len);
|
ssize_t rv = write(gc->acm_fd, buff, len);
|
||||||
if (rv != (ssize_t)len) {
|
if (rv != (ssize_t)len) {
|
||||||
fprintf(stderr, "ERROR %d in TF write: %s\n", errno, strerror(errno));
|
fprintf(stderr, "ERROR %d in TF write: %s\n", errno, strerror(errno));
|
||||||
} else {
|
|
||||||
fprintf(stderr, "Written %d bytes.\n", (int)rv);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -198,7 +198,6 @@ void GEX_Poll(GexClient *gex)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
fprintf(stderr,"No more data to read.\n");
|
|
||||||
if (gex->tf->state != 0) {
|
if (gex->tf->state != 0) {
|
||||||
if (cycle < MAX_RETRIES) {
|
if (cycle < MAX_RETRIES) {
|
||||||
cycle++;
|
cycle++;
|
||||||
@@ -211,9 +210,6 @@ void GEX_Poll(GexClient *gex)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fprintf(stderr, "rx %d bytes\n", (int) len);
|
|
||||||
hexDump("TF_Receive", pollbuffer, (uint32_t) len);
|
|
||||||
|
|
||||||
TF_Accept(gex->tf, pollbuffer, (size_t) len);
|
TF_Accept(gex->tf, pollbuffer, (size_t) len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,13 @@ int main(void)
|
|||||||
// the "PING" command
|
// the "PING" command
|
||||||
GexMsg msg;
|
GexMsg msg;
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
// Simple response
|
||||||
|
msg = GEX_Query0(test, 0);
|
||||||
|
assert(msg.type == MSG_SUCCESS);
|
||||||
|
fprintf(stderr, "Cmd \"PING\" OK\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
// Test a echo command that returns back what was sent to it as useful payload
|
// Test a echo command that returns back what was sent to it as useful payload
|
||||||
const char *s = "I am \r\nreturning this otherwise good typing paper to you because someone "
|
const char *s = "I am \r\nreturning this otherwise good typing paper to you because someone "
|
||||||
@@ -60,23 +67,6 @@ int main(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
// Simple response
|
|
||||||
int failures = 0;
|
|
||||||
for(int i=0; i<20; i++) {
|
|
||||||
fprintf(stderr, "\nSending \"PING\" #%d\n", i);
|
|
||||||
msg = GEX_Query0(test, 0);
|
|
||||||
fprintf(stderr, "\"PING\" resp = %d\n", msg.type);
|
|
||||||
if (msg.type != 0) {
|
|
||||||
fprintf(stderr, "---------------------ERRR-------------------\n");
|
|
||||||
if (msg.type == 2) fprintf(stderr, "%.*s\n", msg.len, msg.payload);
|
|
||||||
failures++;
|
|
||||||
}
|
|
||||||
//usleep(20000);
|
|
||||||
}
|
|
||||||
fprintf(stderr, "FAILURES = %d\n", failures);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
// Read the communist manifesto via bulk transfer
|
// Read the communist manifesto via bulk transfer
|
||||||
uint8_t buffr[10000];
|
uint8_t buffr[10000];
|
||||||
GexBulk br = {
|
GexBulk br = {
|
||||||
@@ -91,7 +81,7 @@ int main(void)
|
|||||||
fprintf(stderr, "%.*s", actuallyRead, buffr);
|
fprintf(stderr, "%.*s", actuallyRead, buffr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fprintf(stderr, "ALL done, ending.\n");
|
fprintf(stderr, "\n\nALL done, ending.\n");
|
||||||
GEX_DeInit(gex);
|
GEX_DeInit(gex);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user