Merge development
This commit is contained in:
@@ -73,15 +73,9 @@ do { \
|
||||
#define hwMillis() millis()
|
||||
#define hwRandomNumberInit() randomSeed(analogRead(MY_SIGNING_SOFT_RANDOMSEED_PIN))
|
||||
#define hwReadConfig(__pos) eeprom_read_byte((uint8_t*)(__pos))
|
||||
|
||||
#ifndef eeprom_update_byte
|
||||
#define hwWriteConfig(__loc, __val) if((uint8_t)(__val) != eeprom_read_byte((uint8_t*)(__loc))) { eeprom_write_byte((uint8_t*)(__loc), (__val)); }
|
||||
#else
|
||||
#define hwWriteConfig(__pos, __val) eeprom_update_byte((uint8_t*)(__pos), (__val))
|
||||
#endif
|
||||
|
||||
#define hwWriteConfig(__pos, __val) eeprom_update_byte((uint8_t*)(__pos), (__val))
|
||||
#define hwReadConfigBlock(__buf, __pos, __length) eeprom_read_block((void*)(__buf), (void*)(__pos), (__length))
|
||||
#define hwWriteConfigBlock(__buf, __pos, __length) eeprom_write_block((void*)(__buf), (void*)(__pos), (__length))
|
||||
#define hwWriteConfigBlock(__buf, __pos, __length) eeprom_update_block((void*)(__buf), (void*)(__pos), (__length))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
|
||||
* network topology allowing messages to be routed to nodes.
|
||||
*
|
||||
* Created by Marcelo Aquino <marceloaqno@gmail.org>
|
||||
* Copyright (C) 2016 Marcelo Aquino
|
||||
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
|
||||
* Copyright (C) 2013-2016 Sensnology AB
|
||||
* Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
|
||||
*
|
||||
* Documentation: http://www.mysensors.org
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
|
||||
* network topology allowing messages to be routed to nodes.
|
||||
*
|
||||
* Created by Marcelo Aquino <marceloaqno@gmail.org>
|
||||
* Copyright (C) 2016 Marcelo Aquino
|
||||
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
|
||||
* Copyright (C) 2013-2016 Sensnology AB
|
||||
* Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
|
||||
*
|
||||
* Documentation: http://www.mysensors.org
|
||||
|
||||
+2
-8
@@ -5,8 +5,8 @@
|
||||
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
|
||||
* network topology allowing messages to be routed to nodes.
|
||||
*
|
||||
* Created by Marcelo Aquino <marceloaqno@gmail.org>
|
||||
* Copyright (C) 2016 Marcelo Aquino
|
||||
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
|
||||
* Copyright (C) 2013-2016 Sensnology AB
|
||||
* Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
|
||||
*
|
||||
* Documentation: http://www.mysensors.org
|
||||
@@ -22,17 +22,11 @@
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
#include "SoftEeprom.h"
|
||||
#include "log.h"
|
||||
|
||||
static SoftEeprom eeprom = SoftEeprom(MY_LINUX_CONFIG_FILE, 1024); // ATMega328 has 1024 bytes
|
||||
|
||||
void hwInit()
|
||||
{
|
||||
if (!bcm2835_init()) {
|
||||
logError("Failed to initialized bcm2835.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifdef MY_GATEWAY_SERIAL
|
||||
MY_SERIALDEVICE.begin(MY_BAUD_RATE);
|
||||
#ifdef MY_LINUX_SERIAL_GROUPNAME
|
||||
|
||||
+19
-2
@@ -5,8 +5,8 @@
|
||||
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
|
||||
* network topology allowing messages to be routed to nodes.
|
||||
*
|
||||
* Created by Marcelo Aquino <marceloaqno@gmail.org>
|
||||
* Copyright (C) 2016 Marcelo Aquino
|
||||
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
|
||||
* Copyright (C) 2013-2016 Sensnology AB
|
||||
* Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
|
||||
*
|
||||
* Documentation: http://www.mysensors.org
|
||||
@@ -20,7 +20,24 @@
|
||||
#ifndef MyHwRPi_h
|
||||
#define MyHwRPi_h
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "MyHwLinuxGeneric.h"
|
||||
#include "log.h"
|
||||
#include "bcm2835.h"
|
||||
|
||||
class Bcm2835Init {
|
||||
public:
|
||||
Bcm2835Init() {
|
||||
if (!bcm2835_init()) {
|
||||
logError("Failed to initialized bcm2835.\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
~Bcm2835Init() {
|
||||
bcm2835_close();
|
||||
}
|
||||
};
|
||||
Bcm2835Init bcm2835Init;
|
||||
|
||||
#undef hwDigitalWrite
|
||||
inline void hwDigitalWrite(uint8_t, uint8_t);
|
||||
|
||||
@@ -102,7 +102,7 @@ static int daemonize(void)
|
||||
|
||||
void print_usage()
|
||||
{
|
||||
printf("Usage: mysGateway [options]\n\n" \
|
||||
printf("Usage: mysgw [options]\n\n" \
|
||||
"Options:\n" \
|
||||
" -h, --help Display a short summary of all program options.\n" \
|
||||
" -d, --debug Enable debug.\n" \
|
||||
@@ -154,7 +154,7 @@ void generate_soft_sign_hmac_key()
|
||||
|
||||
print_soft_sign_hmac_key(key);
|
||||
|
||||
printf("To use this key, run mysGateway with:\n"
|
||||
printf("To use this key, run mysgw with:\n"
|
||||
" --set-soft-hmac-key=");
|
||||
for (int i = 0; i < 32; i++) {
|
||||
printf("%02X", key[i]);
|
||||
@@ -226,7 +226,7 @@ void generate_soft_sign_serial_key()
|
||||
|
||||
print_soft_sign_serial_key(key);
|
||||
|
||||
printf("To use this key, run mysGateway with:\n"
|
||||
printf("To use this key, run mysgw with:\n"
|
||||
" --set-soft-serial-key=");
|
||||
for (int i = 0; i < 9; i++) {
|
||||
printf("%02X", key[i]);
|
||||
@@ -298,7 +298,7 @@ void generate_aes_key()
|
||||
|
||||
print_aes_key(key);
|
||||
|
||||
printf("To use this key, run mysGateway with:\n"
|
||||
printf("To use this key, run mysgw with:\n"
|
||||
" --set-aes-key=");
|
||||
for (int i = 0; i < 16; i++) {
|
||||
printf("%02X", key[i]);
|
||||
|
||||
@@ -98,13 +98,13 @@ void stInitUpdate(void) {
|
||||
// GW mode: skip FPAR,ID,UPL states
|
||||
transportSwitchSM(stReady);
|
||||
#else
|
||||
if ((uint8_t)MY_NODE_ID != AUTO) {
|
||||
#if MY_NODE_ID != AUTO
|
||||
TRANSPORT_DEBUG(PSTR("TSM:INIT:STATID=%d\n"),(uint8_t)MY_NODE_ID);
|
||||
// Set static ID
|
||||
_transportConfig.nodeId = (uint8_t)MY_NODE_ID;
|
||||
// Save static ID to eeprom (for bootloader)
|
||||
hwWriteConfig(EEPROM_NODE_ID_ADDRESS, (uint8_t)MY_NODE_ID);
|
||||
}
|
||||
#endif
|
||||
// assign ID if set
|
||||
if (_transportConfig.nodeId == AUTO || transportAssignNodeID(_transportConfig.nodeId)) {
|
||||
// if node ID valid (>0 and <255), proceed to next state
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@
|
||||
#ifndef Version_h
|
||||
#define Version_h
|
||||
|
||||
#define MYSENSORS_LIBRARY_VERSION "2.0.1-beta"
|
||||
#define MYSENSORS_LIBRARY_VERSION "2.1.0-beta"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user