Skip to content

Commit 0c84a64

Browse files
committed
update ptp.cpp
1 parent 31160f2 commit 0c84a64

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

infinite_sense_core/src/ptp.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ void Ptp::ReceivePtpData(const nlohmann::json &data) {
3232
{"b", offset},
3333
};
3434
std::string out = jsons.dump() + "\n";
35-
if (net_ptr_ != nullptr) {
35+
if (net_ptr_) {
3636
net_ptr_->sendTo(out.data(), out.size(), target_ip_, port_);
3737
updated_t1_t2_ = false;
38-
} else if (serial_ptr_ != nullptr) {
38+
} else if (serial_ptr_) {
3939
serial_ptr_->write(reinterpret_cast<uint8_t *>(out.data()), out.size());
4040
updated_t1_t2_ = false;
4141
}
@@ -53,9 +53,9 @@ void Ptp::SendPtpData() const {
5353
{"a", mark},
5454
};
5555
std::string out = data.dump() + "\n";
56-
if (net_ptr_ != nullptr) {
56+
if (net_ptr_) {
5757
net_ptr_->sendTo(out.data(), out.size(), target_ip_, port_);
58-
} else if (serial_ptr_ != nullptr) {
58+
} else if (serial_ptr_) {
5959
serial_ptr_->write(reinterpret_cast<const uint8_t *>(out.data()), out.size());
6060
}
6161
std::this_thread::sleep_for(std::chrono::milliseconds(100));

0 commit comments

Comments
 (0)