57 throw std::invalid_argument(
"Error initialising UART_OW");
73 throw std::invalid_argument(
"Error initialising UART");
88 throw std::invalid_argument(
"Invalid UART_OW context");
124 throw std::invalid_argument(
"Unknown UART_OW error");
126 return (uint8_t) res;
142 throw std::invalid_argument(
"Unknown UART_OW error");
144 return (uint8_t) res;
161 throw std::invalid_argument(
"Unknown UART_OW error");
163 return ((res) ?
true :
false);
254 if (
id.size() != 8) {
256 throw std::invalid_argument(std::string(__FUNCTION__) +
257 ": id must be 8 bytes only");
271 crc8(uint8_t* buffer, uint16_t length)
uint8_t crc8(std::string buffer)
Definition: uart_ow.hpp:284
mraa::Result reset()
Definition: uart_ow.hpp:172
mraa::Result search(bool start, uint8_t *id)
Definition: uart_ow.hpp:190
Result
Definition: types.hpp:204
uint8_t crc8(uint8_t *buffer, uint16_t length)
Definition: uart_ow.hpp:271
mraa_uart_ow_context mraa_uart_ow_init_raw(const char *path)
mraa::Result command(uint8_t command, std::string id)
Definition: uart_ow.hpp:249
API for UART One Wire.
Definition: uart_ow.hpp:42
std::string search(bool start)
Definition: uart_ow.hpp:207
UartOW(std::string path)
Definition: uart_ow.hpp:68
mraa_result_t mraa_uart_ow_rom_search(mraa_uart_ow_context dev, mraa_boolean_t start, uint8_t *id)
int mraa_uart_ow_read_byte(mraa_uart_ow_context dev)
mraa_uart_ow_context mraa_uart_ow_init(int uart)
const char * mraa_uart_ow_get_dev_path(mraa_uart_ow_context dev)
struct _mraa_uart_ow * mraa_uart_ow_context
uint8_t writeByte(uint8_t byte)
Definition: uart_ow.hpp:138
UartOW(int uart)
Definition: uart_ow.hpp:52
uint8_t readByte()
Definition: uart_ow.hpp:120
uint8_t mraa_uart_ow_crc8(uint8_t *buffer, uint16_t length)
mraa::Result command(uint8_t command, uint8_t *id)
Definition: uart_ow.hpp:233
int mraa_uart_ow_write_byte(mraa_uart_ow_context dev, uint8_t byte)
int mraa_uart_ow_bit(mraa_uart_ow_context dev, uint8_t bit)
mraa_result_t mraa_uart_ow_command(mraa_uart_ow_context dev, uint8_t command, uint8_t *id)
mraa_result_t
Definition: types.h:209
#define MRAA_UART_OW_ROMCODE_SIZE
Definition: uart_ow.h:68
std::string getDevicePath()
Definition: uart_ow.hpp:107
UartOW(void *uart_ow_context)
Definition: uart_ow.hpp:83
mraa_result_t mraa_uart_ow_reset(mraa_uart_ow_context dev)
mraa_result_t mraa_uart_ow_stop(mraa_uart_ow_context dev)
~UartOW()
Definition: uart_ow.hpp:95
bool writeBit(bool bit)
Definition: uart_ow.hpp:157