Merge branch 'master' into neighborinfo

This commit is contained in:
Ben Meadors
2023-07-22 08:46:27 -05:00
committed by GitHub
43 changed files with 1209 additions and 66 deletions

View File

@@ -187,7 +187,7 @@ void NodeDB::installDefaultConfig()
// FIXME: Default to bluetooth capability of platform as default
config.bluetooth.enabled = true;
config.bluetooth.fixed_pin = defaultBLEPin;
#if defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER)
#if defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7789_CS)
bool hasScreen = true;
#else
bool hasScreen = screen_found.port != ScanI2C::I2CPort::NO_I2C;

View File

@@ -70,12 +70,25 @@ template <typename T> bool SX126xInterface<T>::init()
#endif
#if defined(SX126X_TXEN) && (SX126X_TXEN != RADIOLIB_NC)
// lora.begin sets Dio2 as RF switch control, which is not true if we are manually controlling RX and TX
// If SX126X_TXEN is connected to the MCU, we are manually controlling RX and TX.
// But lora.begin (called above) sets Dio2 as RF switch control, which is not true here, so set it back to false.
if (res == RADIOLIB_ERR_NONE) {
LOG_DEBUG("SX126X_TX/RX EN pins defined. Setting RF Switch: RXEN=%i, TXEN=%i\n", SX126X_RXEN, SX126X_TXEN);
LOG_DEBUG("SX126X_TXEN pin defined. Setting RF Switch: RXEN=%i, TXEN=%i\n", SX126X_RXEN, SX126X_TXEN);
res = lora.setDio2AsRfSwitch(false);
lora.setRfSwitchPins(SX126X_RXEN, SX126X_TXEN);
}
#elif defined(SX126X_RXEN) && (SX126X_RXEN != RADIOLIB_NC && defined(E22_TXEN_CONNECTED_TO_DIO2))
// Otherwise, if SX126X_RXEN is connected to the MCU, and E22_TXEN_CONNECTED_TO_DIO2 is defined, we are letting the
// E22 control RX and TX via DIO2. In this configuration, the E22's TXEN and DIO2 pins are connected to each other,
// but not to the MCU.
// However, we must still connect the E22's RXEN pin to the MCU, define SX126X_RXEN accordingly, and then call
// setRfSwitchPins, otherwise RX sensitivity (observed via RSSI) is greatly diminished.
LOG_DEBUG("SX126X_RXEN and E22_TXEN_CONNECTED_TO_DIO2 are defined; value of res: %d", res);
if (res == RADIOLIB_ERR_NONE) {
LOG_DEBUG("SX126X_TXEN is RADIOLIB_NC, but SX126X_RXEN and E22_TXEN_CONNECTED_TO_DIO2 are both defined; calling "
"lora.setRfSwitchPins.");
lora.setRfSwitchPins(SX126X_RXEN, SX126X_TXEN);
}
#endif
if (config.lora.sx126x_rx_boosted_gain) {
@@ -299,4 +312,4 @@ template <typename T> bool SX126xInterface<T>::sleep()
#endif
return true;
}
}

View File

@@ -81,7 +81,7 @@ typedef struct _meshtastic_ChannelSettings {
a table of well known IDs.
(see Well Known Channels FIXME) */
uint32_t id;
/* If true, messages on the mesh will be sent to the *public* internet by any gateway node */
/* If true, messages on the mesh will be sent to the *public* internet by any gateway ndoe */
bool uplink_enabled;
/* If true, messages seen on the internet will be forwarded to the local mesh. */
bool downlink_enabled;

View File

@@ -215,7 +215,7 @@ typedef enum _meshtastic_Config_BluetoothConfig_PairingMode {
typedef struct _meshtastic_Config_DeviceConfig {
/* Sets the role of node */
meshtastic_Config_DeviceConfig_Role role;
/* Disabling this will disable the SerialConsole by not initializing the StreamAPI */
/* Disabling this will disable the SerialConsole by not initilizing the StreamAPI */
bool serial_enabled;
/* By default we turn off logging as soon as an API client connects (to keep shared serial link quiet).
Set this to true to leave the debug log outputting even when API is active. */
@@ -269,7 +269,7 @@ typedef struct _meshtastic_Config_PositionConfig {
uint32_t tx_gpio;
/* The minimum distance in meters traveled (since the last send) before we can send a position to the mesh if position_broadcast_smart_enabled */
uint32_t broadcast_smart_minimum_distance;
/* The minimum number of seconds (since the last send) before we can send a position to the mesh if position_broadcast_smart_enabled */
/* The minumum number of seconds (since the last send) before we can send a position to the mesh if position_broadcast_smart_enabled */
uint32_t broadcast_smart_minimum_interval_secs;
} meshtastic_Config_PositionConfig;
@@ -363,7 +363,7 @@ typedef struct _meshtastic_Config_DisplayConfig {
bool compass_north_top;
/* Flip screen vertically, for cases that mount the screen upside down */
bool flip_screen;
/* Preferred display units */
/* Perferred display units */
meshtastic_Config_DisplayConfig_DisplayUnits units;
/* Override auto-detect in screen */
meshtastic_Config_DisplayConfig_OledType oled;

View File

@@ -147,7 +147,7 @@ typedef enum _meshtastic_CriticalErrorCode {
/* Radio transmit hardware failure. We sent data to the radio chip, but it didn't
reply with an interrupt. */
meshtastic_CriticalErrorCode_TRANSMIT_FAILED = 8,
/* We detected that the main CPU voltage dropped below the minimum acceptable value */
/* We detected that the main CPU voltage dropped below the minumum acceptable value */
meshtastic_CriticalErrorCode_BROWNOUT = 9,
/* Selftest of SX1262 radio chip failed */
meshtastic_CriticalErrorCode_SX1262_FAILURE = 10,
@@ -371,7 +371,7 @@ typedef struct _meshtastic_Position {
0 through 3 - for future use */
typedef struct _meshtastic_User {
/* A globally unique ID string for this user.
In the case of Signal that would mean +16504442323, for the default macaddr derived id it would be !<8 hexadecimal bytes>.
In the case of Signal that would mean +16504442323, for the default macaddr derived id it would be !<8 hexidecimal bytes>.
Note: app developers are encouraged to also use the following standard
node IDs "^all" (for broadcast), "^local" (for the locally connected node) */
char id[16];
@@ -418,7 +418,7 @@ typedef struct _meshtastic_Routing {
typedef PB_BYTES_ARRAY_T(237) meshtastic_Data_payload_t;
/* (Formerly called SubPacket)
The payload portion for a packet, this is the actual bytes that are sent
The payload portion fo a packet, this is the actual bytes that are sent
inside a radio packet (because from/to are broken out by the comms library) */
typedef struct _meshtastic_Data {
/* Formerly named typ and of type Type */
@@ -552,7 +552,7 @@ typedef struct _meshtastic_MeshPacket {
/* The priority of this message for sending.
See MeshPacket.Priority description for more details. */
meshtastic_MeshPacket_Priority priority;
/* rssi of received packet. Only sent to phone for display purposes. */
/* rssi of received packet. Only sent to phone for dispay purposes. */
int32_t rx_rssi;
/* Describe if this message is delayed */
meshtastic_MeshPacket_Delayed delayed;

View File

@@ -17,7 +17,7 @@
PortNums should be assigned in the following range:
0-63 Core Meshtastic use, do not use for third party apps
64-127 Registered 3rd party apps, send in a pull request that adds a new entry to portnums.proto to register your application
256-511 Use one of these portnums for your private applications that you don't want to register publicly
256-511 Use one of these portnums for your private applications that you don't want to register publically
All other values are reserved.
Note: This was formerly a Type enum named 'typ' with the same id #
We have change to this 'portnum' based scheme for specifying app handlers for particular payloads.

View File

@@ -63,7 +63,7 @@ typedef struct _meshtastic_EnvironmentMetrics {
float relative_humidity;
/* Barometric pressure in hPA measured */
float barometric_pressure;
/* Gas resistance in mOhm measured */
/* Gas resistance in MOhm measured */
float gas_resistance;
/* Voltage measured */
float voltage;