
// other definitions
#define Encrypt           0
#define Decrypt           1
#define FunctionMax       6       // maximum function number available
#define CountersTx        4       // number of TX counters
#define CountersRx        3       // number of RX counters

#define IdRemoteS         0x20    // secure remote controller 
#define GateAddr          0xFF

typedef struct remote {
  uint32_t  serialn;
  uint32_t  counter;  
  uint8_t   command;            // command  KEY or FUNCTION
  uint8_t   battery;            // resolution 10mV, offset -2V, range 2 to 4.55V
  int8_t    temperature;        // resolution 1 degree Celsius
  uint8_t   button;             // button pushed  
  uint8_t   rez[4];
} remotet;


typedef struct base {
  uint8_t     key[16];          // encryption key
  uint32_t    counterTx[CountersTx];  // transmit counter
  uint32_t    serialn;          // serial number  
  uint16_t    counterWindow;    // size of counter window
  uint8_t     type;             // type of this device - remote
  uint8_t     function[30];     // type of this device - remote
} baset;  

baset    base       = { { 0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99,0xaa,0xbb,0xcc,0xdd,0xee,0xff,0x00}, 
                        { 0,1,2,3},   // counters
                         0x01234566,  // serialn
                         4000,        // window size
                         IdRemoteS,   // command group
                         { 0,0,0,0,0,  0,0,0,0,0, 0,0,0,0,0,  0,0,0,0,0, 0,0,0,0,0,  0,0,0,0,0,}  // function
                      } ;
