Skip to content

Commit 031fa1e

Browse files
committed
Changed uint to a uint8_t
1 parent f5a56c5 commit 031fa1e

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

examples/simple_repeater/MyMesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ void MyMesh::onPeerDataRecv(mesh::Packet *packet, uint8_t type, int sender_idx,
541541
} else if (type == PAYLOAD_TYPE_TXT_MSG && len > 5 && client->isAdmin()) { // a CLI command
542542
uint32_t sender_timestamp;
543543
memcpy(&sender_timestamp, data, 4); // timestamp (by sender's RTC clock - which could be wrong)
544-
uint flags = (data[4] >> 2); // message attempt number, and other flags
544+
uint8_t flags = (data[4] >> 2); // message attempt number, and other flags
545545

546546
if (!(flags == TXT_TYPE_PLAIN || flags == TXT_TYPE_CLI_DATA)) {
547547
MESH_DEBUG_PRINTLN("onPeerDataRecv: unsupported text type received: flags=%02x", (uint32_t)flags);

examples/simple_room_server/MyMesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ void MyMesh::onPeerDataRecv(mesh::Packet *packet, uint8_t type, int sender_idx,
394394
if (type == PAYLOAD_TYPE_TXT_MSG && len > 5) { // a CLI command or new Post
395395
uint32_t sender_timestamp;
396396
memcpy(&sender_timestamp, data, 4); // timestamp (by sender's RTC clock - which could be wrong)
397-
uint flags = (data[4] >> 2); // message attempt number, and other flags
397+
uint8_t flags = (data[4] >> 2); // message attempt number, and other flags
398398

399399
if (!(flags == TXT_TYPE_PLAIN || flags == TXT_TYPE_CLI_DATA)) {
400400
MESH_DEBUG_PRINTLN("onPeerDataRecv: unsupported command flags received: flags=%02x", (uint32_t)flags);

examples/simple_sensor/SensorMesh.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ void SensorMesh::onPeerDataRecv(mesh::Packet* packet, uint8_t type, int sender_i
550550
} else if (type == PAYLOAD_TYPE_TXT_MSG && len > 5 && from->isAdmin()) { // a CLI command
551551
uint32_t sender_timestamp;
552552
memcpy(&sender_timestamp, data, 4); // timestamp (by sender's RTC clock - which could be wrong)
553-
uint flags = (data[4] >> 2); // message attempt number, and other flags
553+
uint8_t flags = (data[4] >> 2); // message attempt number, and other flags
554554

555555
if (sender_timestamp > from->last_timestamp) { // prevent replay attacks
556556
if (flags == TXT_TYPE_PLAIN) {
@@ -608,7 +608,7 @@ void SensorMesh::onPeerDataRecv(mesh::Packet* packet, uint8_t type, int sender_i
608608
}
609609
}
610610

611-
bool SensorMesh::handleIncomingMsg(ClientInfo& from, uint32_t timestamp, uint8_t* data, uint flags, size_t len) {
611+
bool SensorMesh::handleIncomingMsg(ClientInfo& from, uint32_t timestamp, uint8_t* data, uint8_t flags, size_t len) {
612612
MESH_DEBUG_PRINT("handleIncomingMsg: unhandled msg from ");
613613
#ifdef MESH_DEBUG
614614
mesh::Utils::printHex(Serial, from.id.pub_key, PUB_KEY_SIZE);

examples/simple_sensor/SensorMesh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class SensorMesh : public mesh::Mesh, public CommonCLICallbacks {
127127
bool onPeerPathRecv(mesh::Packet* packet, int sender_idx, const uint8_t* secret, uint8_t* path, uint8_t path_len, uint8_t extra_type, uint8_t* extra, uint8_t extra_len) override;
128128
void onControlDataRecv(mesh::Packet* packet) override;
129129
void onAckRecv(mesh::Packet* packet, uint32_t ack_crc) override;
130-
virtual bool handleIncomingMsg(ClientInfo& from, uint32_t timestamp, uint8_t* data, uint flags, size_t len);
130+
virtual bool handleIncomingMsg(ClientInfo& from, uint32_t timestamp, uint8_t* data, uint8_t flags, size_t len);
131131
void sendAckTo(const ClientInfo& dest, uint32_t ack_hash);
132132
private:
133133
FILESYSTEM* _fs;

src/helpers/BaseChatMesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void BaseChatMesh::onPeerDataRecv(mesh::Packet* packet, uint8_t type, int sender
166166
if (type == PAYLOAD_TYPE_TXT_MSG && len > 5) {
167167
uint32_t timestamp;
168168
memcpy(&timestamp, data, 4); // timestamp (by sender's RTC clock - which could be wrong)
169-
uint flags = data[4] >> 2; // message attempt number, and other flags
169+
uint8_t flags = data[4] >> 2; // message attempt number, and other flags
170170

171171
// len can be > original length, but 'text' will be padded with zeroes
172172
data[len] = 0; // need to make a C string again, with null terminator

0 commit comments

Comments
 (0)