diff --git a/proto b/proto index 25998410..a76ceb15 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 25998410668a1ff1b092512439ec0e7089f91ce9 +Subproject commit a76ceb1509b2ec3d844af0378e998e7d4737492c diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 6f022943..853cdc29 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -201,7 +201,7 @@ static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state // the max length of this buffer is much longer than we can possibly print static char tempBuf[96]; - assert(mp.decoded.which_payload == SubPacket_data_tag); + assert(mp.decoded.which_payloadVariant == SubPacket_data_tag); snprintf(tempBuf, sizeof(tempBuf), " %s", mp.decoded.data.payload.bytes); display->drawStringMaxWidth(4 + x, 10 + y, SCREEN_WIDTH - (6 + x), tempBuf); diff --git a/src/mesh/DSRRouter.cpp b/src/mesh/DSRRouter.cpp index ad41afdd..8b1e6f67 100644 --- a/src/mesh/DSRRouter.cpp +++ b/src/mesh/DSRRouter.cpp @@ -72,7 +72,7 @@ void DSRRouter::sniffReceived(const MeshPacket *p) addRoute(p->from, p->from, 0); // We are adjacent with zero hops } - switch (p->decoded.which_payload) { + switch (p->decoded.which_payloadVariant) { case SubPacket_route_request_tag: // Handle route discovery packets (will be a broadcast message) // FIXME - always start request with the senders nodenum @@ -139,7 +139,7 @@ void DSRRouter::sniffReceived(const MeshPacket *p) // handle naks - convert them to route error packets // All naks are generated locally, because we failed resending the packet too many times - PacketId nakId = p->decoded.which_ack == SubPacket_fail_id_tag ? p->decoded.ack.fail_id : 0; + PacketId nakId = p->decoded.which_ackVariant == SubPacket_fail_id_tag ? p->decoded.ackVariant.fail_id : 0; if (nakId) { auto pending = findPendingPacket(p->to, nakId); if (pending && pending->packet->decoded.source) { // if source not set, this was not a multihop packet, just ignore diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index 073c4814..1629b16e 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -176,7 +176,7 @@ void MeshService::sendToMesh(MeshPacket *p) // Strip out any time information before sending packets to other nodes - to keep the wire size small (and because other // nodes shouldn't trust it anyways) Note: we allow a device with a local GPS to include the time, so that gpsless // devices can get time. - if (p->which_payload == MeshPacket_decoded_tag && p->decoded.which_payload == SubPacket_position_tag && + if (p->which_payloadVariant == MeshPacket_decoded_tag && p->decoded.which_payloadVariant == SubPacket_position_tag && p->decoded.position.time) { if (getRTCQuality() < RTCQualityGPS) { DEBUG_MSG("Stripping time %u from position send\n", p->decoded.position.time); diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index dc27276a..18e07f56 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -525,7 +525,7 @@ void NodeDB::updateUser(uint32_t nodeId, const User &p) /// we updateGUI and updateGUIforNode if we think our this change is big enough for a redraw void NodeDB::updateFrom(const MeshPacket &mp) { - if (mp.which_payload == MeshPacket_decoded_tag) { + if (mp.which_payloadVariant == MeshPacket_decoded_tag) { const SubPacket &p = mp.decoded; DEBUG_MSG("Update DB node 0x%x, rx_time=%u\n", mp.from, mp.rx_time); @@ -538,7 +538,7 @@ void NodeDB::updateFrom(const MeshPacket &mp) info->snr = mp.rx_snr; // keep the most recent SNR we received for this node. - switch (p.which_payload) { + switch (p.which_payloadVariant) { case SubPacket_position_tag: { // handle a legacy position packet DEBUG_MSG("WARNING: Processing a (deprecated) position packet from %d\n", mp.from); diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 48898f16..fa10e20f 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -59,15 +59,15 @@ void PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength) // return (lastContactMsec != 0) && if (pb_decode_from_bytes(buf, bufLength, ToRadio_fields, &toRadioScratch)) { - switch (toRadioScratch.which_variant) { + switch (toRadioScratch.which_payloadVariant) { case ToRadio_packet_tag: { - MeshPacket &p = toRadioScratch.variant.packet; + MeshPacket &p = toRadioScratch.packet; printPacket("PACKET FROM PHONE", &p); service.handleToRadio(p); break; } case ToRadio_want_config_id_tag: - config_nonce = toRadioScratch.variant.want_config_id; + config_nonce = toRadioScratch.want_config_id; DEBUG_MSG("Client wants config, nonce=%u\n", config_nonce); state = STATE_SEND_MY_INFO; @@ -79,12 +79,12 @@ void PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength) case ToRadio_set_owner_tag: DEBUG_MSG("Client is setting owner\n"); - handleSetOwner(toRadioScratch.variant.set_owner); + handleSetOwner(toRadioScratch.set_owner); break; case ToRadio_set_radio_tag: DEBUG_MSG("Client is setting radio\n"); - handleSetRadio(toRadioScratch.variant.set_radio); + handleSetRadio(toRadioScratch.set_radio); break; default: @@ -131,22 +131,22 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) myNodeInfo.has_gps = (radioConfig.preferences.location_share == LocationSharing_LocDisabled) ? true : (gps && gps->isConnected()); // Update with latest GPS connect info - fromRadioScratch.which_variant = FromRadio_my_info_tag; - fromRadioScratch.variant.my_info = myNodeInfo; + fromRadioScratch.which_payloadVariant = FromRadio_my_info_tag; + fromRadioScratch.my_info = myNodeInfo; state = STATE_SEND_RADIO; service.refreshMyNodeInfo(); // Update my NodeInfo because the client will be asking for it soon. break; case STATE_SEND_RADIO: - fromRadioScratch.which_variant = FromRadio_radio_tag; + fromRadioScratch.which_payloadVariant = FromRadio_radio_tag; - fromRadioScratch.variant.radio = radioConfig; + fromRadioScratch.radio = radioConfig; // NOTE: The phone app needs to know the ls_secs value so it can properly expect sleep behavior. // So even if we internally use 0 to represent 'use default' we still need to send the value we are // using to the app (so that even old phone apps work with new device loads). - fromRadioScratch.variant.radio.preferences.ls_secs = getPref_ls_secs(); + fromRadioScratch.radio.preferences.ls_secs = getPref_ls_secs(); state = STATE_SEND_NODEINFO; break; @@ -158,8 +158,8 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) if (info) { DEBUG_MSG("Sending nodeinfo: num=0x%x, lastseen=%u, id=%s, name=%s\n", info->num, info->position.time, info->user.id, info->user.long_name); - fromRadioScratch.which_variant = FromRadio_node_info_tag; - fromRadioScratch.variant.node_info = *info; + fromRadioScratch.which_payloadVariant = FromRadio_node_info_tag; + fromRadioScratch.node_info = *info; // Stay in current state until done sending nodeinfos } else { DEBUG_MSG("Done sending nodeinfos\n"); @@ -171,8 +171,8 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) } case STATE_SEND_COMPLETE_ID: - fromRadioScratch.which_variant = FromRadio_config_complete_id_tag; - fromRadioScratch.variant.config_complete_id = config_nonce; + fromRadioScratch.which_payloadVariant = FromRadio_config_complete_id_tag; + fromRadioScratch.config_complete_id = config_nonce; config_nonce = 0; state = STATE_SEND_PACKETS; break; @@ -185,8 +185,8 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) printPacket("phone downloaded packet", packetForPhone); // Encapsulate as a FromRadio packet - fromRadioScratch.which_variant = FromRadio_packet_tag; - fromRadioScratch.variant.packet = *packetForPhone; + fromRadioScratch.which_payloadVariant = FromRadio_packet_tag; + fromRadioScratch.packet = *packetForPhone; service.releaseToPool(packetForPhone); // we just copied the bytes, so don't need this buffer anymore packetForPhone = NULL; @@ -198,9 +198,9 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) } // Do we have a message from the mesh? - if (fromRadioScratch.which_variant != 0) { + if (fromRadioScratch.which_payloadVariant != 0) { // Encapsulate as a FromRadio packet - DEBUG_MSG("encoding toPhone packet to phone variant=%d", fromRadioScratch.which_variant); + DEBUG_MSG("encoding toPhone packet to phone variant=%d", fromRadioScratch.which_payloadVariant); size_t numbytes = pb_encode_to_bytes(buf, FromRadio_size, FromRadio_fields, &fromRadioScratch); DEBUG_MSG(", %d bytes\n", numbytes); return numbytes; diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index b1aa807b..34e04298 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -83,7 +83,7 @@ uint32_t RadioInterface::getPacketTime(uint32_t pl) uint32_t RadioInterface::getPacketTime(MeshPacket *p) { - assert(p->which_payload == MeshPacket_encrypted_tag); // It should have already been encoded by now + assert(p->which_payloadVariant == MeshPacket_encrypted_tag); // It should have already been encoded by now uint32_t pl = p->encrypted.size + sizeof(PacketHeader); return getPacketTime(pl); @@ -119,9 +119,9 @@ void printPacket(const char *prefix, const MeshPacket *p) { DEBUG_MSG("%s (id=0x%08x Fr0x%02x To0x%02x, WantAck%d, HopLim%d", prefix, p->id, p->from & 0xff, p->to & 0xff, p->want_ack, p->hop_limit); - if (p->which_payload == MeshPacket_decoded_tag) { + if (p->which_payloadVariant == MeshPacket_decoded_tag) { auto &s = p->decoded; - switch (s.which_payload) { + switch (s.which_payloadVariant) { case SubPacket_data_tag: DEBUG_MSG(" Portnum=%d", s.data.portnum); break; @@ -135,7 +135,7 @@ void printPacket(const char *prefix, const MeshPacket *p) DEBUG_MSG(" Payload:None"); break; default: - DEBUG_MSG(" Payload:%d", s.which_payload); + DEBUG_MSG(" Payload:%d", s.which_payloadVariant); break; } if (s.want_response) @@ -147,10 +147,10 @@ void printPacket(const char *prefix, const MeshPacket *p) if (s.dest != 0) DEBUG_MSG(" dest=%08x", s.dest); - if (s.which_ack == SubPacket_success_id_tag) - DEBUG_MSG(" successId=%08x", s.ack.success_id); - else if (s.which_ack == SubPacket_fail_id_tag) - DEBUG_MSG(" failId=%08x", s.ack.fail_id); + if (s.which_ackVariant == SubPacket_success_id_tag) + DEBUG_MSG(" successId=%08x", s.ackVariant.success_id); + else if (s.which_ackVariant == SubPacket_fail_id_tag) + DEBUG_MSG(" failId=%08x", s.ackVariant.fail_id); } else { DEBUG_MSG(" encrypted"); } @@ -315,7 +315,7 @@ size_t RadioInterface::beginSending(MeshPacket *p) assert(!sendingPacket); // DEBUG_MSG("sending queued packet on mesh (txGood=%d,rxGood=%d,rxBad=%d)\n", rf95.txGood(), rf95.rxGood(), rf95.rxBad()); - assert(p->which_payload == MeshPacket_encrypted_tag); // It should have already been encoded by now + assert(p->which_payloadVariant == MeshPacket_encrypted_tag); // It should have already been encoded by now lastTxStart = millis(); diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index f2fafef7..27e767bf 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -264,7 +264,7 @@ void RadioLibInterface::handleReceiveInterrupt() addReceiveMetadata(mp); - mp->which_payload = MeshPacket_encrypted_tag; // Mark that the payload is still encrypted at this point + mp->which_payloadVariant = MeshPacket_encrypted_tag; // Mark that the payload is still encrypted at this point assert(((uint32_t) payloadLen) <= sizeof(mp->encrypted.bytes)); memcpy(mp->encrypted.bytes, payload, payloadLen); mp->encrypted.size = payloadLen; diff --git a/src/mesh/ReliableRouter.cpp b/src/mesh/ReliableRouter.cpp index 6060b1f0..3bc8bfde 100644 --- a/src/mesh/ReliableRouter.cpp +++ b/src/mesh/ReliableRouter.cpp @@ -65,8 +65,8 @@ void ReliableRouter::sniffReceived(const MeshPacket *p) // If the payload is valid, look for ack/nak - PacketId ackId = p->decoded.which_ack == SubPacket_success_id_tag ? p->decoded.ack.success_id : 0; - PacketId nakId = p->decoded.which_ack == SubPacket_fail_id_tag ? p->decoded.ack.fail_id : 0; + PacketId ackId = p->decoded.which_ackVariant == SubPacket_success_id_tag ? p->decoded.ackVariant.success_id : 0; + PacketId nakId = p->decoded.which_ackVariant == SubPacket_fail_id_tag ? p->decoded.ackVariant.fail_id : 0; // We intentionally don't check wasSeenRecently, because it is harmless to delete non existent retransmission records if (ackId || nakId) { diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index c3a34552..3ea6e913 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -88,7 +88,7 @@ MeshPacket *Router::allocForSending() { MeshPacket *p = packetPool.allocZeroed(); - p->which_payload = MeshPacket_decoded_tag; // Assume payload is decoded at start. + p->which_payloadVariant = MeshPacket_decoded_tag; // Assume payload is decoded at start. p->from = nodeDB.getNodeNum(); p->to = NODENUM_BROADCAST; p->hop_limit = HOP_RELIABLE; @@ -110,14 +110,14 @@ void Router::sendAckNak(ErrorReason err, NodeNum to, PacketId idFrom) DEBUG_MSG("Sending an err=%d,to=0x%x,idFrom=0x%x,id=0x%x\n", err, to, idFrom, p->id); if (!err) { - p->decoded.ack.success_id = idFrom; - p->decoded.which_ack = SubPacket_success_id_tag; + p->decoded.ackVariant.success_id = idFrom; + p->decoded.which_ackVariant = SubPacket_success_id_tag; } else { - p->decoded.ack.fail_id = idFrom; - p->decoded.which_ack = SubPacket_fail_id_tag; + p->decoded.ackVariant.fail_id = idFrom; + p->decoded.which_ackVariant = SubPacket_fail_id_tag; // Also send back the error reason - p->decoded.which_payload = SubPacket_error_reason_tag; + p->decoded.which_payloadVariant = SubPacket_error_reason_tag; p->decoded.error_reason = err; } @@ -160,7 +160,7 @@ ErrorCode Router::send(MeshPacket *p) { assert(p->to != nodeDB.getNodeNum()); // should have already been handled by sendLocal - PacketId nakId = p->decoded.which_ack == SubPacket_fail_id_tag ? p->decoded.ack.fail_id : 0; + PacketId nakId = p->decoded.which_ackVariant == SubPacket_fail_id_tag ? p->decoded.ackVariant.fail_id : 0; assert( !nakId); // I don't think we ever send 0hop naks over the wire (other than to the phone), test that assumption with assert @@ -170,11 +170,11 @@ ErrorCode Router::send(MeshPacket *p) // If the packet hasn't yet been encrypted, do so now (it might already be encrypted if we are just forwarding it) - assert(p->which_payload == MeshPacket_encrypted_tag || - p->which_payload == MeshPacket_decoded_tag); // I _think_ all packets should have a payload by now + assert(p->which_payloadVariant == MeshPacket_encrypted_tag || + p->which_payloadVariant == MeshPacket_decoded_tag); // I _think_ all packets should have a payload by now // First convert from protobufs to raw bytes - if (p->which_payload == MeshPacket_decoded_tag) { + if (p->which_payloadVariant == MeshPacket_decoded_tag) { static uint8_t bytes[MAX_RHPACKETLEN]; // we have to use a scratch buffer because a union size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), SubPacket_fields, &p->decoded); @@ -185,7 +185,7 @@ ErrorCode Router::send(MeshPacket *p) // Copy back into the packet and set the variant type memcpy(p->encrypted.bytes, bytes, numbytes); p->encrypted.size = numbytes; - p->which_payload = MeshPacket_encrypted_tag; + p->which_payloadVariant = MeshPacket_encrypted_tag; } assert(iface); // This should have been detected already in sendLocal (or we just received a packet from outside) @@ -211,10 +211,10 @@ void Router::sniffReceived(const MeshPacket *p) bool Router::perhapsDecode(MeshPacket *p) { - if (p->which_payload == MeshPacket_decoded_tag) + if (p->which_payloadVariant == MeshPacket_decoded_tag) return true; // If packet was already decoded just return - assert(p->which_payload == MeshPacket_encrypted_tag); + assert(p->which_payloadVariant == MeshPacket_encrypted_tag); // FIXME - someday don't send routing packets encrypted. That would allow us to route for other channels without // being able to decrypt their data. @@ -230,7 +230,7 @@ bool Router::perhapsDecode(MeshPacket *p) return false; } else { // parsing was successful - p->which_payload = MeshPacket_decoded_tag; + p->which_payloadVariant = MeshPacket_decoded_tag; return true; } } diff --git a/src/mesh/SinglePortPlugin.h b/src/mesh/SinglePortPlugin.h index 01ee1963..d182579b 100644 --- a/src/mesh/SinglePortPlugin.h +++ b/src/mesh/SinglePortPlugin.h @@ -32,7 +32,7 @@ class SinglePortPlugin : public MeshPlugin { // Update our local node info with our position (even if we don't decide to update anyone else) MeshPacket *p = router->allocForSending(); - p->decoded.which_payload = SubPacket_data_tag; + p->decoded.which_payloadVariant = SubPacket_data_tag; p->decoded.data.portnum = ourPortNum; return p; diff --git a/src/mesh/StreamAPI.cpp b/src/mesh/StreamAPI.cpp index 06b80b2f..8015b951 100644 --- a/src/mesh/StreamAPI.cpp +++ b/src/mesh/StreamAPI.cpp @@ -84,8 +84,8 @@ void StreamAPI::emitRebooted() { // In case we send a FromRadio packet memset(&fromRadioScratch, 0, sizeof(fromRadioScratch)); - fromRadioScratch.which_variant = FromRadio_rebooted_tag; - fromRadioScratch.variant.rebooted = true; + fromRadioScratch.which_payloadVariant = FromRadio_rebooted_tag; + fromRadioScratch.rebooted = true; DEBUG_MSG("Emitting reboot packet for serial shell\n"); emitTxBuffer(pb_encode_to_bytes(txBuf + HEADER_LEN, FromRadio_size, FromRadio_fields, &fromRadioScratch)); diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 5968850a..b9de66a9 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -238,7 +238,7 @@ typedef struct _SubPacket { RouteDiscovery route_request; RouteDiscovery route_reply; ErrorReason error_reason; - } payloadVariant; + }; uint32_t original_id; bool want_response; uint32_t dest; @@ -258,7 +258,7 @@ typedef struct _MeshPacket { union { SubPacket decoded; MeshPacket_encrypted_t encrypted; - } payloadVariant; + }; uint32_t channel_index; uint32_t id; float rx_snr; @@ -279,7 +279,7 @@ typedef struct _FromRadio { uint32_t config_complete_id; bool rebooted; ChannelSettings channel; - } payloadVariant; + }; } FromRadio; typedef struct _ToRadio { @@ -290,7 +290,7 @@ typedef struct _ToRadio { RadioConfig set_radio; User set_owner; ChannelSettings set_channel; - } payloadVariant; + }; } ToRadio; @@ -524,12 +524,12 @@ X(a, STATIC, REPEATED, INT32, route, 2) #define RouteDiscovery_DEFAULT NULL #define SubPacket_FIELDLIST(X, a) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,position,payloadVariant.position), 1) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,data,payloadVariant.data), 3) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,user,payloadVariant.user), 4) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,route_request,payloadVariant.route_request), 6) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,route_reply,payloadVariant.route_reply), 7) \ -X(a, STATIC, ONEOF, UENUM, (payloadVariant,error_reason,payloadVariant.error_reason), 13) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,position,position), 1) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,data,data), 3) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,user,user), 4) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,route_request,route_request), 6) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,route_reply,route_reply), 7) \ +X(a, STATIC, ONEOF, UENUM, (payloadVariant,error_reason,error_reason), 13) \ X(a, STATIC, SINGULAR, UINT32, original_id, 2) \ X(a, STATIC, SINGULAR, BOOL, want_response, 5) \ X(a, STATIC, SINGULAR, UINT32, dest, 9) \ @@ -547,8 +547,8 @@ X(a, STATIC, SINGULAR, UINT32, source, 12) #define MeshPacket_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, from, 1) \ X(a, STATIC, SINGULAR, UINT32, to, 2) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,decoded,payloadVariant.decoded), 3) \ -X(a, STATIC, ONEOF, BYTES, (payloadVariant,encrypted,payloadVariant.encrypted), 8) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,decoded,decoded), 3) \ +X(a, STATIC, ONEOF, BYTES, (payloadVariant,encrypted,encrypted), 8) \ X(a, STATIC, SINGULAR, UINT32, channel_index, 4) \ X(a, STATIC, SINGULAR, UINT32, id, 6) \ X(a, STATIC, SINGULAR, FLOAT, rx_snr, 7) \ @@ -667,14 +667,14 @@ X(a, STATIC, SINGULAR, UENUM, level, 4) #define FromRadio_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, num, 1) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,packet,payloadVariant.packet), 2) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,my_info,payloadVariant.my_info), 3) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,node_info,payloadVariant.node_info), 4) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,radio,payloadVariant.radio), 6) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,log_record,payloadVariant.log_record), 7) \ -X(a, STATIC, ONEOF, UINT32, (payloadVariant,config_complete_id,payloadVariant.config_complete_id), 8) \ -X(a, STATIC, ONEOF, BOOL, (payloadVariant,rebooted,payloadVariant.rebooted), 9) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,channel,payloadVariant.channel), 10) +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,packet,packet), 2) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,my_info,my_info), 3) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,node_info,node_info), 4) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,radio,radio), 6) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,log_record,log_record), 7) \ +X(a, STATIC, ONEOF, UINT32, (payloadVariant,config_complete_id,config_complete_id), 8) \ +X(a, STATIC, ONEOF, BOOL, (payloadVariant,rebooted,rebooted), 9) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,channel,channel), 10) #define FromRadio_CALLBACK NULL #define FromRadio_DEFAULT NULL #define FromRadio_payloadVariant_packet_MSGTYPE MeshPacket @@ -685,11 +685,11 @@ X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,channel,payloadVariant.channe #define FromRadio_payloadVariant_channel_MSGTYPE ChannelSettings #define ToRadio_FIELDLIST(X, a) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,packet,payloadVariant.packet), 1) \ -X(a, STATIC, ONEOF, UINT32, (payloadVariant,want_config_id,payloadVariant.want_config_id), 100) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,set_radio,payloadVariant.set_radio), 101) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,set_owner,payloadVariant.set_owner), 102) \ -X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,set_channel,payloadVariant.set_channel), 103) +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,packet,packet), 1) \ +X(a, STATIC, ONEOF, UINT32, (payloadVariant,want_config_id,want_config_id), 100) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,set_radio,set_radio), 101) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,set_owner,set_owner), 102) \ +X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,set_channel,set_channel), 103) #define ToRadio_CALLBACK NULL #define ToRadio_DEFAULT NULL #define ToRadio_payloadVariant_packet_MSGTYPE MeshPacket