|
Lines 1-5
Link Here
|
| 1 |
--- DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp.orig 2020-02-14 09:38:32 UTC |
1 |
--- DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp.orig 2025-02-14 17:38:09 UTC |
| 2 |
+++ DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp |
2 |
+++ DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp |
|
|
3 |
@@ -42,7 +42,7 @@ |
| 4 |
|
| 5 |
#include <boost/asio/read.hpp> |
| 6 |
#include <boost/asio/write.hpp> |
| 7 |
-#include <boost/asio/io_service.hpp> |
| 8 |
+#include <boost/asio/io_context.hpp> |
| 9 |
|
| 10 |
#if defined(_WIN32) || defined(_WIN64) |
| 11 |
|
| 12 |
@@ -181,7 +181,7 @@ void UsbCdcIoChannel::createCdcPortList(const uint16_t |
| 13 |
|
| 14 |
for (;;) |
| 15 |
{ |
| 16 |
- io_service_t device = IOIteratorNext(iterator); |
| 17 |
+ io_context_t device = IOIteratorNext(iterator); |
| 18 |
if (device == 0) |
| 19 |
{ |
| 20 |
if (!IOIteratorIsValid(iterator)) |
| 3 |
@@ -310,6 +310,22 @@ void UsbCdcIoChannel::createCdcPortList(const uint16_t |
21 |
@@ -310,6 +310,22 @@ void UsbCdcIoChannel::createCdcPortList(const uint16_t |
| 4 |
} |
22 |
} |
| 5 |
#else |
23 |
#else |
|
Lines 31-33
Link Here
|
| 31 |
const string filename = it->path().filename().string(); |
49 |
const string filename = it->path().filename().string(); |
| 32 |
const string portPath = string("/dev/") + filename; |
50 |
const string portPath = string("/dev/") + filename; |
| 33 |
|
51 |
|
|
|
52 |
@@ -376,7 +393,7 @@ bool UsbCdcIoChannel::openPort() |
| 53 |
|
| 54 |
bool UsbCdcIoChannel::openPort() |
| 55 |
{ |
| 56 |
- ioService = new boost::asio::io_service; |
| 57 |
+ ioService = new boost::asio::io_context; |
| 58 |
port = new boost::asio::serial_port(*ioService); |
| 59 |
timer = new boost::asio::deadline_timer(*ioService); |
| 60 |
|
| 61 |
@@ -542,7 +559,7 @@ size_t UsbCdcIoChannel::read(HalResponse& resp) |
| 62 |
|
| 63 |
boost::system::error_code ec; |
| 64 |
|
| 65 |
- while (ioService->run_one(ec)) |
| 66 |
+ while (ioService->run_one()) |
| 67 |
{ |
| 68 |
if (readEvent) |
| 69 |
{ |
| 70 |
@@ -577,13 +594,13 @@ size_t UsbCdcIoChannel::read(HalResponse& resp) |
| 71 |
|
| 72 |
if (ioService->stopped()) |
| 73 |
{ |
| 74 |
- ioService->reset(); |
| 75 |
+ ioService->restart(); |
| 76 |
} |
| 77 |
} |
| 78 |
|
| 79 |
//Let cancelled tasks finish |
| 80 |
- ioService->run(ec); |
| 81 |
- ioService->reset(); |
| 82 |
+ ioService->run(); |
| 83 |
+ ioService->restart(); |
| 84 |
|
| 85 |
|
| 86 |
if (actSize == expSize) |