Skip to content

Commit e2c715c

Browse files
author
Yveaux
committed
Fix support for signing. Only software ATSHA204 supported!
1 parent d6cc1b4 commit e2c715c

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

libraries/MySensors/examples/Esp8266Gateway/Esp8266Gateway.ino

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,16 @@
6060
* Inclusion mode button:
6161
* - Connect GPIO5 via switch to GND ('inclusion switch')
6262
*
63-
* * Signing, RF69 radio and a separate SPI flash are not supported yet!
63+
* Hardware SHA204 signing, RF69 radio and a separate SPI flash are not supported!
6464
*
6565
* Make sure to fill in your ssid and WiFi password below for ssid & pass.
6666
*/
6767
#define NO_PORTB_PINCHANGES
6868

6969
#include <SPI.h>
7070

71+
#include <MySigningNone.h>
72+
#include <MySigningAtsha204Soft.h>
7173
#include <MyTransportNRF24.h>
7274
#include <EEPROM.h>
7375
#include <MyHwESP8266.h>
@@ -87,25 +89,36 @@ const char *pass = "MyVerySecretPassword"; //
8789
#define RADIO_CE_PIN 4 // radio chip enable
8890
#define RADIO_SPI_SS_PIN 15 // radio SPI serial select
8991

92+
#ifdef WITH_LEDS_BLINKING
9093
#define RADIO_ERROR_LED_PIN 7 // Error led pin
9194
#define RADIO_RX_LED_PIN 8 // Receive led pin
9295
#define RADIO_TX_LED_PIN 9 // the PCB, on board LED
96+
#endif
9397

9498

9599
// NRFRF24L01 radio driver (set low transmit power by default)
96100
MyTransportNRF24 transport(RADIO_CE_PIN, RADIO_SPI_SS_PIN, RF24_PA_LEVEL_GW);
97101

102+
// Message signing driver (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)
103+
#ifdef MY_SIGNING_FEATURE
104+
MySigningNone signer;
105+
//MySigningAtsha204Soft signer;
106+
#endif
107+
98108
// Hardware profile
99109
MyHwESP8266 hw;
100110

101111
// Construct MySensors library (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)
102112
// To use LEDs blinking, uncomment WITH_LEDS_BLINKING in MyConfig.h
113+
MySensor gw(transport, hw
114+
#ifdef MY_SIGNING_FEATURE
115+
, signer
116+
#endif
103117
#ifdef WITH_LEDS_BLINKING
104-
MySensor gw(transport, hw /*, signer*/, RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN);
105-
#else
106-
MySensor gw(transport, hw /*, signer*/);
118+
, RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN
107119
#endif
108-
120+
);
121+
109122

110123
#define IP_PORT 5003 // The port you want to open
111124

0 commit comments

Comments
 (0)