#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
+#include <sys/endian.h>
+#include <sys/uio.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#define HCIUARTGETPROTO _IOR('U', 201, int)
#define HCIUARTGETDEVICE _IOR('U', 202, int)
-#define HCI_UART_H4 0
+#define HCI_UART_H4 0
#define HCI_UART_BCSP 1
#define HCI_UART_3WIRE 2
#define HCI_UART_H4DS 3
+#define HCI_UART_LL 4
struct uart_t {
char *type;
static int set_speed(int fd, struct termios *ti, int speed)
{
cfsetospeed(ti, uart_speed(speed));
+ cfsetispeed(ti, uart_speed(speed));
return tcsetattr(fd, TCSANOW, ti);
}
/*
* Read an HCI event from the given file descriptor.
*/
-static int read_hci_event(int fd, unsigned char* buf, int size)
+int read_hci_event(int fd, unsigned char* buf, int size)
{
int remain, r;
int count = 0;
return 0;
}
+extern int texasalt_init(int fd, int speed);
+
+int texasalt(int fd, struct uart_t *u, struct termios *ti) {
+ texasalt_init(fd, u->speed);
+}
+
static int read_check(int fd, void *buf, int count)
{
int res;
{ "any", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, NULL, NULL },
{ "ericsson", 0x0000, 0x0000, HCI_UART_H4, 57600, 115200, FLOW_CTL, NULL, ericsson },
{ "digi", 0x0000, 0x0000, HCI_UART_H4, 9600, 115200, FLOW_CTL, NULL, digi },
- { "texas", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, NULL, texas },
+ { "texas", 0x0000, 0x0000, HCI_UART_LL, 115200, 115200, FLOW_CTL, NULL, texasalt },
{ "bcsp", 0x0000, 0x0000, HCI_UART_BCSP, 115200, 115200, 0, NULL, bcsp },
while (!__io_canceled) {
p.revents = 0;
- err = poll(&p, 1, 500);
+ err = poll(&p, 1, 5000); // 5 seconds
if (err < 0 && errno == EINTR)
continue;
if (err)