Skip to content

Instantly share code, notes, and snippets.

@paladini
Created May 4, 2016 20:52
Show Gist options
  • Save paladini/6b7dabcb5a508e4f5b61565fb5d78857 to your computer and use it in GitHub Desktop.
Save paladini/6b7dabcb5a508e4f5b61565fb5d78857 to your computer and use it in GitHub Desktop.
Small application to print TSTP sizes.
#include <network.h>
#include <utility/ostream.h>
using namespace EPOS;
OStream cout;
int main()
{
while(true) {
Alarm::delay(2000000);
// EPOS
cout << "===================================" << endl;
cout << endl;
cout << ">>>> EPOS Sizes <<<<" << endl;
cout << "Int: " << sizeof(int) << " byte(s)" << endl;
cout << "Char: " << sizeof(char) << " byte(s)" << endl;
cout << endl;
// TSTP
cout << ">>>> TSTP Sizes <<<<" << endl;
// TSTP - Header
cout << "[ Header - " << sizeof(TSTP::Header) <<" bytes ]" << endl;
cout << "Local_Address: " << sizeof(TSTP::Local_Address) << " byte(s)" << endl;
cout << "Time: " << sizeof(TSTP::Time) << " byte(s)" << endl;
cout << endl;
// TSTP - Data Message
cout << "[ Data Message - " << sizeof(TSTP::Data_Message) << " bytes ]" << endl;
cout << "Sec_MAC: " << sizeof(TSTP::Sec_MAC) << " byte(s)" << endl;
cout << "Unit: " << sizeof(TSTP::Unit) << " byte(s)" << endl;
cout << "Data: " << sizeof(TSTP::MAX_DATA_SIZE) << " byte(s)" << endl;
cout << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment