zeroSquitto – Rev 1
?pathlinks?
/*
* Length of an integer - used to allocate buffers (not elegant).
* CHAR_BIT * sizeof(int) - number of bits to store an integer
* -1 - 1 bit for sign
* /3 - 3 bits for 1 decimal digit.
*/
#define MAX_INTEGER_LENGTH ((CHAR_BIT * sizeof(int) - 1) / 3 + 2)
// Message sent to server to retrieve data.
#define PULL_METHOD "PULL"
// Limit the length of the retrieved message.
#define DATA_LENGTH_LIMIT 5
// For extra bling points!
#define SERVER_BANNER \
"\n\
\n\
███████╗███╗ ███╗ ██████╗ ███████╗\n\
â•šâ•â•â–ˆâ–ˆâ–ˆâ•”â•â–ˆâ–ˆâ–ˆâ–ˆâ•— ████║██╔â•â•â•â–ˆâ–ˆâ•— ██╔â•â•â•â•â•\n\
███╔╠██╔████╔██║██║ ██║ █████╗ ███████╗\n\
███╔╠██║╚██╔â•â–ˆâ–ˆâ•‘██║▄▄ ██║ â•šâ•â•â•â•â• â•šâ•â•â•â•â–ˆâ–ˆâ•‘\n\
███████╗██║ â•šâ•â• ██║╚██████╔╠███████║\n\
â•šâ•â•â•â•â•â•â•â•šâ•â• â•šâ•â• â•šâ•â•â–€â–€â•â• â•šâ•â•â•â•â•â•â•\n\
"
#define CLIENT_BANNER \
"\n\
\n\
███████╗███╗ ███╗ ██████╗ ██████╗\n\
â•šâ•â•â–ˆâ–ˆâ–ˆâ•”â•â–ˆâ–ˆâ–ˆâ–ˆâ•— ████║██╔â•â•â•â–ˆâ–ˆâ•— ██╔â•â•â•â•â•\n\
███╔╠██╔████╔██║██║ ██║ █████╗ ██║ \n\
███╔╠██║╚██╔â•â–ˆâ–ˆâ•‘██║▄▄ ██║ â•šâ•â•â•â•â• ██║ \n\
███████╗██║ â•šâ•â• ██║╚██████╔╠╚██████╗\n\
â•šâ•â•â•â•â•â•â•â•šâ•â• â•šâ•â• â•šâ•â•â–€â–€â•â• â•šâ•â•â•â•â•â•\n\
"
#define MOSQUITTO_BANNER \
"\n\
\n\
███╗ ███╗███╗ ███╗ ██████╗ ██████╗\n\
████╗ ████║████╗ ████║██╔â•â•â•â–ˆâ–ˆâ•— ██╔â•â•â•â•â•\n\
██╔████╔██║██╔████╔██║██║ ██║█████╗██║ \n\
██║╚██╔â•â–ˆâ–ˆâ•‘██║╚██╔â•â–ˆâ–ˆâ•‘██║▄▄ ██║╚â•â•â•â•â•â–ˆâ–ˆâ•‘ \n\
██║ â•šâ•â• ██║██║ â•šâ•â• ██║╚██████╔╠╚██████╗\n\
â•šâ•â• â•šâ•â•â•šâ•â• â•šâ•â• â•šâ•â•â–€â–€â•â• â•šâ•â•â•â•â•â•\n\
"
#define ZEROSQUITO_BANNER \
"\n\
\n\
███████╗███████╗ ██████╗ ███████╗\n\
â•šâ•â•â–ˆâ–ˆâ–ˆâ•”â•â–ˆâ–ˆâ•”â•â•â•â•â•â–ˆâ–ˆâ•”â•â•â•â–ˆâ–ˆâ•— ██╔â•â•â•â•â•\n\
███╔╠███████╗██║ ██║█████╗███████╗\n\
███╔╠╚â•â•â•â•â–ˆâ–ˆâ•‘██║▄▄ ██║╚â•â•â•â•â•â•šâ•â•â•â•â–ˆâ–ˆâ•‘\n\
███████╗███████║╚██████╔╠███████║\n\
â•šâ•â•â•â•â•â•â•â•šâ•â•â•â•â•â•â• â•šâ•â•â–€â–€â•â• â•šâ•â•â•â•â•â•â•\n\
"
#define LOGGING_BANNER \
"\n\
\n\
██╗ ██████╗ ██████╗ ███████╗\n\
██║ ██╔â•â•â•â–ˆâ–ˆâ•—██╔â•â•â•â•â• ██╔â•â•â•â•â•\n\
██║ ██║ ██║██║ ███╗█████╗███████╗\n\
██║ ██║ ██║██║ ██║╚â•â•â•â•â•â•šâ•â•â•â•â–ˆâ–ˆâ•‘\n\
███████╗╚██████╔â•â•šâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ–ˆâ•”╠███████║\n\
â•šâ•â•â•â•â•â•â• â•šâ•â•â•â•â•â• â•šâ•â•â•â•â•â• â•šâ•â•â•â•â•â•â•\n\
"
// The socket linger time in milliseconds for timely shutdown.
#define ZMQ_LINGER_TIME 1000
// Mosquitto publisher topic.
#define DEFAULT_MOSQUITTO_TOPIC "temperature"
// How many TCP connections to allow queueing.
#define LOG_SERVER_TCP_LISTEN_QUEUE 10
// The buffer size for received data.
#define LOG_MAX_RECV_BYTES 1024
// The buffer size for sending data.
#define LOG_MAX_SEND_BYTES 1024