Browse Source

Add NetBIOS support

fastled
Xose Pérez 7 years ago
parent
commit
3c116f45bd
3 changed files with 32 additions and 2 deletions
  1. +6
    -2
      code/espurna/config/general.h
  2. +6
    -0
      code/espurna/espurna.ino
  3. +20
    -0
      code/espurna/netbios.ino

+ 6
- 2
code/espurna/config/general.h View File

@ -328,11 +328,15 @@ PROGMEM const char* const custom_reset_string[] = {
// -----------------------------------------------------------------------------
#ifndef MDNS_SUPPORT
#define MDNS_SUPPORT 1 // Publish services using mDNS by default (1.09Kb)
#define MDNS_SUPPORT 1 // Publish services using mDNS by default (1.84Kb)
#endif
#ifndef LLMNR_SUPPORT
#define LLMNR_SUPPORT 0 // ublish device using LLMNR protocol by default (1.95Kb) - requires 2.4.0
#define LLMNR_SUPPORT 0 // Publish device using LLMNR protocol by default (1.95Kb) - requires 2.4.0
#endif
#ifndef NETBIOS_SUPPORT
#define NETBIOS_SUPPORT 0 // Publish device using NetBIOS protocol by default (1.26Kb) - requires 2.4.0
#endif
// -----------------------------------------------------------------------------


+ 6
- 0
code/espurna/espurna.ino View File

@ -174,6 +174,9 @@ void welcome() {
#if MDNS_SUPPORT
DEBUG_MSG_P(PSTR(" MDNS"));
#endif
#if NETBIOS_SUPPORT
DEBUG_MSG_P(PSTR(" NETBIOS"));
#endif
#if NOFUSS_SUPPORT
DEBUG_MSG_P(PSTR(" NOFUSS"));
#endif
@ -274,6 +277,9 @@ void setup() {
#if LLMNR_SUPPORT
llmnrSetup();
#endif
#if NETBIOS_SUPPORT
netbiosSetup();
#endif
#if NTP_SUPPORT
ntpSetup();
#endif


+ 20
- 0
code/espurna/netbios.ino View File

@ -0,0 +1,20 @@
/*
NETBIOS MODULE
Copyright (C) 2017 by Xose Pérez <xose dot perez at gmail dot com>
*/
#if NETBIOS_SUPPORT
#include <ESP8266NetBIOS.h>
void netbiosSetup() {
static WiFiEventHandler _netbios_wifi_onSTA = WiFi.onStationModeGotIP([](WiFiEventStationModeGotIP ipInfo) {
NBNS.begin(getSetting("hostname").c_str());
DEBUG_MSG_P(PSTR("[NETBIOS] Configured\n"));
});
}
#endif // NETBIOS_SUPPORT

Loading…
Cancel
Save