beremiz

use pregenerated CRC32 lookup tables for retain on Win32 and GNU/Linux

This code could be possible reused on low-end targets with limited RAM.

code to generate lookup table:
[---------------------------------------------------------------------]

/* CRC lookup table and initial state. */
uint32_t crc32_table[256];

/* Generate CRC32 lookup table. */
void GenerateCRC32Table(void)
{
unsigned int i, j;
/* Use CRC-32-IEEE 802.3 polynomial 0x04C11DB7 (bit reflected). */
uint32_t poly = 0xEDB88320;

for (i = 0; i <= 0xFF; i++)
{
uint32_t c = i;
for (j = 0 ; j < 8 ; j++)
c = (c & 1) ? (c >> 1 ) ^ poly : (c >> 1);
crc32_table[i] = c;
}
}

void main(void)
{
GenerateCRC32Table();
int j=0;
for(int i=0; i<256; i++) {
printf("0x%08X, ", crc32_table[i]);
if (++j >= 8) {
j = 0;
printf("\n");
}
}
}
[---------------------------------------------------------------------]
/* This project contains wamp client config to be loaded at runtime startup. */
./project_files/wampconf.json
wampconf.json is in "Project Files", so it is copied to runtime's working directory, and then loaded after program transfer + runtime restart.
Otherwise, wamp config file path can be forced :
./Beremiz_service.py -c /path/to/my/wampconf.json /working/dir
/* Crossbar install */
#sudo apt-get update
#sudo apt-get -y dist-upgrade
sudo apt-get -y install build-essential libssl-dev libffi-dev libreadline-dev libbz2-dev libsqlite3-dev libncurses5dev
sudo apt-get -y install python3-pip
sudo python3 -m pip install -U pip
sudo pip3 install crossbar
crossbar version
/* Start Crossbar command: */
crossbar start
/* Crossbar test router configuration is available in .crossbar directory. */
Tested on version:
:::::::::::::::::
::::: _____ __
::::: : ::::: / ___/____ ___ ___ ___ / / ___ _ ____
::::::: ::::::: / /__ / __// _ \ (_-< (_-< / _ \/ _ `// __/
::::: : ::::: \___//_/ \___//___//___//_.__/\_,_//_/
:::::
::::::::::::::::: Crossbar v18.7.2
Copyright (c) 2013-2018 Crossbar.io Technologies GmbH, licensed under AGPL 3.0.
Crossbar.io : 18.7.2
Autobahn : 18.7.1
Twisted : 18.7.0-EPollReactor
LMDB : 0.94/lmdb-0.9.22
Python : 3.6.6/CPython
Frozen executable : no
Operating system : Linux-4.16.0-2-rt-amd64-x86_64-with-debian-buster-sid
Host machine : x86_64
Release key : RWS9T4NltFjmKSMbEtETnOMxRjLhOEZ6e80T5MYzTTh/+NP9Jk20sJmA