projects
/
proxmark3-svn
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix compile errors on non-Intel CPUs:
[proxmark3-svn]
/
client
/
uart.h
diff --git
a/client/uart.h
b/client/uart.h
index 7b00641fa3d8f52033771f01eb8e06acf5c3b03e..747c0f26a3ee34e0d1fd60c2b6a2bc991e4b2f56 100644
(file)
--- a/
client/uart.h
+++ b/
client/uart.h
@@
-1,7
+1,7
@@
/*
/*
- *
Proxmark3 g
eneric uart / rs232/ serial port library
+ *
G
eneric uart / rs232/ serial port library
*
*
- * Copyright (c) 201
2
, Roel Verdult
+ * Copyright (c) 201
3
, Roel Verdult
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@
-31,8
+31,8
@@
*
*/
*
*/
-#ifndef _
PROXMARK3_
RS232_H_
-#define _
PROXMARK3_
RS232_H_
+#ifndef _RS232_H_
+#define _RS232_H_
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
@@
-53,10
+53,18
@@
typedef unsigned char byte_t;
#include <sys/stat.h>
#include <limits.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <limits.h>
#include <sys/time.h>
+ #include <errno.h>
#else
#include <windows.h>
#endif
#else
#include <windows.h>
#endif
+typedef enum {
+ SP_INVALID = 0x00, // invalid value, error occured
+ SP_NONE = 0x01, // no parity (default)
+ SP_EVEN = 0x02, // even parity
+ SP_ODD = 0x03 // odd parity
+} serial_port_parity;
+
// Define shortcut to types to make code more readable
typedef void* serial_port;
#define INVALID_SERIAL_PORT (void*)(~1)
// Define shortcut to types to make code more readable
typedef void* serial_port;
#define INVALID_SERIAL_PORT (void*)(~1)
@@
-65,9
+73,12
@@
typedef void* serial_port;
serial_port uart_open(const char* pcPortName);
void uart_close(const serial_port sp);
serial_port uart_open(const char* pcPortName);
void uart_close(const serial_port sp);
-
void
uart_set_speed(serial_port sp, const uint32_t uiPortSpeed);
+
bool
uart_set_speed(serial_port sp, const uint32_t uiPortSpeed);
uint32_t uart_get_speed(const serial_port sp);
uint32_t uart_get_speed(const serial_port sp);
+bool uart_set_parity(serial_port sp, serial_port_parity spp);
+serial_port_parity uart_get_parity(const serial_port sp);
+
bool uart_receive(const serial_port sp, byte_t* pbtRx, size_t* pszRxLen);
bool uart_send(const serial_port sp, const byte_t* pbtTx, const size_t szTxLen);
bool uart_receive(const serial_port sp, byte_t* pbtRx, size_t* pszRxLen);
bool uart_send(const serial_port sp, const byte_t* pbtTx, const size_t szTxLen);
Impressum
,
Datenschutz