mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-14 17:12:08 +00:00
lockdown plugins that touch hardware
This commit is contained in:
parent
6813a31895
commit
c0ac457cad
@ -4,9 +4,13 @@ You probably don't care about this section - skip to the next one.
|
|||||||
|
|
||||||
## 1.2 cleanup & multichannel support:
|
## 1.2 cleanup & multichannel support:
|
||||||
|
|
||||||
|
* cleanup the external notification and serial plugins
|
||||||
|
* non ack version of stress test fails sometimes!
|
||||||
* timestamps on oled screen are wrong - don't seem to be updating based on message rx
|
* timestamps on oled screen are wrong - don't seem to be updating based on message rx
|
||||||
* luxon bug report - seeing rx acks for nodes that are not on the network
|
* luxon bug report - seeing rx acks for nodes that are not on the network
|
||||||
* channel hash suffixes are wrong on android
|
* channel hash suffixes are wrong on android
|
||||||
|
* tx fault test has a bug #734
|
||||||
|
|
||||||
* cdcacm bug on nrf52: emittx thinks it emitted but client sees nothing. works again later
|
* cdcacm bug on nrf52: emittx thinks it emitted but client sees nothing. works again later
|
||||||
* nrf52: segger logs have errors in formatting that should be impossible (because not going through serial, try stalling on segger)
|
* nrf52: segger logs have errors in formatting that should be impossible (because not going through serial, try stalling on segger)
|
||||||
* DONE call RouterPlugin for *all* packets - not just Router packets
|
* DONE call RouterPlugin for *all* packets - not just Router packets
|
||||||
|
@ -10,6 +10,10 @@ static const uint8_t defaultpsk[] = {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0
|
|||||||
|
|
||||||
Channels channels;
|
Channels channels;
|
||||||
|
|
||||||
|
const char *Channels::adminChannel = "admin";
|
||||||
|
const char *Channels::gpioChannel = "gpio";
|
||||||
|
const char *Channels::serialChannel = "serial";
|
||||||
|
|
||||||
uint8_t xorHash(const uint8_t *p, size_t len)
|
uint8_t xorHash(const uint8_t *p, size_t len)
|
||||||
{
|
{
|
||||||
uint8_t code = 0;
|
uint8_t code = 0;
|
||||||
|
@ -29,6 +29,10 @@ class Channels
|
|||||||
int16_t hashes[MAX_NUM_CHANNELS];
|
int16_t hashes[MAX_NUM_CHANNELS];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/// Well known channel names
|
||||||
|
static const char *adminChannel, *gpioChannel, *serialChannel;
|
||||||
|
|
||||||
const ChannelSettings &getPrimary() { return getByIndex(getPrimaryIndex()).settings; }
|
const ChannelSettings &getPrimary() { return getByIndex(getPrimaryIndex()).settings; }
|
||||||
|
|
||||||
/** Return the Channel for a specified index */
|
/** Return the Channel for a specified index */
|
||||||
|
@ -126,5 +126,5 @@ MeshPacket *AdminPlugin::allocReply()
|
|||||||
AdminPlugin::AdminPlugin() : ProtobufPlugin("Admin", PortNum_ADMIN_APP, AdminMessage_fields)
|
AdminPlugin::AdminPlugin() : ProtobufPlugin("Admin", PortNum_ADMIN_APP, AdminMessage_fields)
|
||||||
{
|
{
|
||||||
// restrict to the admin channel for rx
|
// restrict to the admin channel for rx
|
||||||
boundChannel = "admin";
|
boundChannel = Channels::adminChannel;
|
||||||
}
|
}
|
||||||
|
@ -140,6 +140,11 @@ void ExternalNotificationPlugin::setExternalOff()
|
|||||||
|
|
||||||
// --------
|
// --------
|
||||||
|
|
||||||
|
ExternalNotificationPluginRadio::ExternalNotificationPluginRadio() : SinglePortPlugin("ExternalNotificationPluginRadio", PortNum_TEXT_MESSAGE_APP) {
|
||||||
|
// restrict to the admin channel for rx
|
||||||
|
boundChannel = Channels::gpioChannel;
|
||||||
|
}
|
||||||
|
|
||||||
bool ExternalNotificationPluginRadio::handleReceived(const MeshPacket &mp)
|
bool ExternalNotificationPluginRadio::handleReceived(const MeshPacket &mp)
|
||||||
{
|
{
|
||||||
#ifndef NO_ESP32
|
#ifndef NO_ESP32
|
||||||
|
@ -32,7 +32,7 @@ class ExternalNotificationPluginRadio : public SinglePortPlugin
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ExternalNotificationPluginRadio() : SinglePortPlugin("ExternalNotificationPluginRadio", PortNum_TEXT_MESSAGE_APP) {}
|
ExternalNotificationPluginRadio();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//virtual MeshPacket *allocReply();
|
//virtual MeshPacket *allocReply();
|
||||||
|
@ -69,7 +69,8 @@ bool RemoteHardwarePlugin::handleReceivedProtobuf(const MeshPacket &req, const H
|
|||||||
|
|
||||||
case HardwareMessage_Type_READ_GPIOS: {
|
case HardwareMessage_Type_READ_GPIOS: {
|
||||||
// Print notification to LCD screen
|
// Print notification to LCD screen
|
||||||
screen->print("Read GPIOs\n");
|
if(screen)
|
||||||
|
screen->print("Read GPIOs\n");
|
||||||
|
|
||||||
uint64_t res = digitalReads(p.gpio_mask);
|
uint64_t res = digitalReads(p.gpio_mask);
|
||||||
|
|
||||||
|
@ -61,6 +61,12 @@ SerialPlugin::SerialPlugin() : concurrency::OSThread("SerialPlugin") {}
|
|||||||
|
|
||||||
char serialStringChar[Constants_DATA_PAYLOAD_LEN];
|
char serialStringChar[Constants_DATA_PAYLOAD_LEN];
|
||||||
|
|
||||||
|
SerialPluginRadio::SerialPluginRadio() : SinglePortPlugin("SerialPluginRadio", PortNum_SERIAL_APP)
|
||||||
|
{
|
||||||
|
// restrict to the admin channel for rx
|
||||||
|
boundChannel = Channels::serialChannel;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t SerialPlugin::runOnce()
|
int32_t SerialPlugin::runOnce()
|
||||||
{
|
{
|
||||||
#ifndef NO_ESP32
|
#ifndef NO_ESP32
|
||||||
|
@ -33,8 +33,7 @@ class SerialPluginRadio : public SinglePortPlugin
|
|||||||
from the main code.
|
from the main code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// SerialPluginRadio() : SinglePortPlugin("SerialPluginRadio", PortNum_TEXT_MESSAGE_APP) {}
|
SerialPluginRadio();
|
||||||
SerialPluginRadio() : SinglePortPlugin("SerialPluginRadio", PortNum_SERIAL_APP) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send our payload into the mesh
|
* Send our payload into the mesh
|
||||||
|
Loading…
Reference in New Issue
Block a user