Hi am looking to add a buzzer to my board to bleep when an incoming message is received. Is it possible to distinguish between packet types of i.e Becon packets, location packets and the one i want to distinguish is the msg packet for the phone user.
Also long term a way to send none encrypted style packet that can send a status byte that the esp32 can use to send and receive input output status of pins
My basic code below edited into PhoneAPI.cpp i fear will bleep on all types of received packets.
/**
- Handle a packet that the phone wants us to send. It is our responsibility to free the packet to the pool
*/
void PhoneAPI::handleToRadioPacket(MeshPacket *p) {}
extern bool BleepOnOff;
/// If the mesh service tells us fromNum has changed, tell the phone
int PhoneAPI::onNotify(uint32_t newValue)
{
checkConnectionTimeout(); // a handy place to check if we've heard from the phone (since the BLE version doesn't call this
// from idle)
if (state == STATE_SEND_PACKETS || state == STATE_LEGACY) {
BleepOnOff=(!BleepOnOff); '// toggle bleeper on and off
DEBUG_MSG("Telling client we have new packets %u\n", newValue);
onNowHasData(newValue);
DEBUG_MSG("BEEP %u%u\n", BleepOnOff, newValue); // debug message to simulate my attached sounder
if (BleepOnOff== true) delay(5000); // delay for on time of bleeper.. is there a smart delay to use to allow other processes
} else
DEBUG_MSG("(Client not yet interested in packets)\n");
return 0;
}