mbed - A function that should return a struct, how can i print this struct in C++? -
i'm using mbed online compiler write program , upload multitech mdot lora tranceiver. program sending packets of specific size gateway. @ end of program want statistics communication. i've been told use function called getstats(); in 1 of header files (mdot.h). mentioned function mdot.h following:
class mdot { public: typedef struct { uint32_t up; uint32_t down; uint32_t joins; uint32_t joinfails; uint32_t missedacks; } mdot_stats; // current statistics // join attempts, join fails, packets, down packets, missed acks mdot_stats getstats();
so ideas please on how can call function in main.cpp , values (up, down, joins, joinfails , missedacks) printed in consle screen. appreciate need this..
noman
how about:
mdot::mdot_stats stats = dot->getstats(); printf("number of uplink packets %d\n", stats.up);
Comments
Post a Comment