Skip to content

Commit

Permalink
Update main_pub.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
MelamudMichael authored Feb 29, 2024
1 parent 6b0c879 commit 488b0c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pubsub/src/main_pub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ std::uint8_t* getTime() {
}

std::uint8_t* getRandom() {

int32_t val = std::rand();
static std::uint8_t buf[4];
std::memcpy(buf, &val, sizeof(val));
Expand All @@ -73,6 +74,7 @@ std::uint8_t* getRandom() {
}

std::uint8_t* getCounter() {

static std::uint8_t counter = 0;
++counter;

Expand Down

0 comments on commit 488b0c5

Please sign in to comment.