-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactores Error Translation, resolves #9
See - #33 (comment) - #48
- Loading branch information
1 parent
5f59ea8
commit c206bfa
Showing
10 changed files
with
285 additions
and
625 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef SWEEP_ERROR_1E0FA029CE94_HPP | ||
#define SWEEP_ERROR_1E0FA029CE94_HPP | ||
|
||
/* | ||
* Internal base error sub-system errors inherit from. | ||
* Implementation detail; not exported. | ||
*/ | ||
|
||
#include <stdexcept> | ||
|
||
namespace sweep { | ||
namespace error { | ||
|
||
struct error : std::runtime_error { | ||
using base = std::runtime_error; | ||
using base::base; | ||
}; | ||
|
||
} // ns errors | ||
} // ns sweep | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef SWEEP_SERIAL_575F0FB571D1_HPP | ||
#define SWEEP_SERIAL_575F0FB571D1_HPP | ||
|
||
/* | ||
* Communication with serial devices. | ||
* Implementation detail; not exported. | ||
*/ | ||
|
||
#include "error.hpp" | ||
|
||
#include "sweep.h" | ||
|
||
#include <stdint.h> | ||
|
||
namespace sweep { | ||
namespace serial { | ||
|
||
struct error : sweep::error::error { | ||
using base = sweep::error::error; | ||
using base::base; | ||
}; | ||
|
||
typedef struct device* device_s; | ||
|
||
device_s device_construct(const char* port, int32_t bitrate); | ||
void device_destruct(device_s serial); | ||
|
||
void device_read(device_s serial, void* to, int32_t len); | ||
void device_write(device_s serial, const void* from, int32_t len); | ||
void device_flush(device_s serial); | ||
|
||
} // ns serial | ||
} // ns sweep | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.