re-add namespacing in protobufs. Let's see what i missed. Portduino likely ...

Checking in generated on purpose.
This commit is contained in:
Thomas Göttgens
2023-01-21 18:22:19 +01:00
parent ab3446faed
commit 6fdb93cd16
157 changed files with 2770 additions and 2770 deletions

View File

@@ -27,7 +27,7 @@
#define ASCII_BELL 0x07
RTTTLConfig rtttlConfig;
meshtastic_RTTTLConfig rtttlConfig;
ExternalNotificationModule *externalNotificationModule;
@@ -142,7 +142,7 @@ void ExternalNotificationModule::stopNow()
}
ExternalNotificationModule::ExternalNotificationModule()
: SinglePortModule("ExternalNotificationModule", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread(
: SinglePortModule("ExternalNotificationModule", meshtastic_PortNum_TEXT_MESSAGE_APP), concurrency::OSThread(
"ExternalNotificationModule")
{
/*
@@ -164,7 +164,7 @@ ExternalNotificationModule::ExternalNotificationModule()
// moduleConfig.external_notification.nag_timeout = 300;
if (moduleConfig.external_notification.enabled) {
if (!nodeDB.loadProto(rtttlConfigFile, RTTTLConfig_size, sizeof(RTTTLConfig), &RTTTLConfig_msg, &rtttlConfig)) {
if (!nodeDB.loadProto(rtttlConfigFile, meshtastic_RTTTLConfig_size, sizeof(meshtastic_RTTTLConfig), &meshtastic_RTTTLConfig_msg, &rtttlConfig)) {
memset(rtttlConfig.ringtone, 0, sizeof(rtttlConfig.ringtone));
strncpy(rtttlConfig.ringtone,
"a:d=8,o=5,b=125:4d#6,a#,2d#6,16p,g#,4a#,4d#.,p,16g,16a#,d#6,a#,f6,2d#6,16p,c#.6,16c6,16a#,g#.,2a#",
@@ -205,7 +205,7 @@ ExternalNotificationModule::ExternalNotificationModule()
}
}
ProcessMessage ExternalNotificationModule::handleReceived(const MeshPacket &mp)
ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshPacket &mp)
{
if (moduleConfig.external_notification.enabled) {
@@ -319,19 +319,19 @@ ProcessMessage ExternalNotificationModule::handleReceived(const MeshPacket &mp)
* @return AdminMessageHandleResult HANDLED if message was handled
* HANDLED_WITH_RESULT if a result is also prepared.
*/
AdminMessageHandleResult ExternalNotificationModule::handleAdminMessageForModule(const MeshPacket &mp, AdminMessage *request,
AdminMessage *response)
AdminMessageHandleResult ExternalNotificationModule::handleAdminMessageForModule(const meshtastic_MeshPacket &mp, meshtastic_AdminMessage *request,
meshtastic_AdminMessage *response)
{
AdminMessageHandleResult result;
switch (request->which_payload_variant) {
case AdminMessage_get_ringtone_request_tag:
case meshtastic_AdminMessage_get_ringtone_request_tag:
LOG_INFO("Client is getting ringtone\n");
this->handleGetRingtone(mp, response);
result = AdminMessageHandleResult::HANDLED_WITH_RESPONSE;
break;
case AdminMessage_set_ringtone_message_tag:
case meshtastic_AdminMessage_set_ringtone_message_tag:
LOG_INFO("Client is setting ringtone\n");
this->handleSetRingtone(request->set_canned_message_module_messages);
result = AdminMessageHandleResult::HANDLED;
@@ -344,11 +344,11 @@ AdminMessageHandleResult ExternalNotificationModule::handleAdminMessageForModule
return result;
}
void ExternalNotificationModule::handleGetRingtone(const MeshPacket &req, AdminMessage *response)
void ExternalNotificationModule::handleGetRingtone(const meshtastic_MeshPacket &req, meshtastic_AdminMessage *response)
{
LOG_INFO("*** handleGetRingtone\n");
if (req.decoded.want_response) {
response->which_payload_variant = AdminMessage_get_ringtone_response_tag;
response->which_payload_variant = meshtastic_AdminMessage_get_ringtone_response_tag;
strncpy(response->get_ringtone_response, rtttlConfig.ringtone, sizeof(response->get_ringtone_response));
} // Don't send anything if not instructed to. Better than asserting.
}
@@ -364,6 +364,6 @@ void ExternalNotificationModule::handleSetRingtone(const char *from_msg)
}
if (changed) {
nodeDB.saveProto(rtttlConfigFile, RTTTLConfig_size, &RTTTLConfig_msg, &rtttlConfig);
nodeDB.saveProto(rtttlConfigFile, meshtastic_RTTTLConfig_size, &meshtastic_RTTTLConfig_msg, &rtttlConfig);
}
}