3,4c3,6
< *
< * Copyright (c) 2004 Maksim Yevmenkin <m_evmenkin@yahoo.com>
---
> */
>
> /*-
> * Copyright (c) 2006 Maksim Yevmenkin <m_evmenkin@yahoo.com>
28,29c30,31
< * $Id: client.c,v 1.6 2004/02/26 21:57:55 max Exp $
< * $FreeBSD: head/usr.sbin/bluetooth/bthidd/client.c 156784 2006-03-16 18:26:54Z emax $
---
> * $Id: client.c,v 1.7 2006/09/07 21:06:53 max Exp $
> * $FreeBSD: head/usr.sbin/bluetooth/bthidd/client.c 162128 2006-09-07 21:47:49Z emax $
43d44
< #include "bthidd.h"
44a46
> #include "bthidd.h"
46c48
< static int client_socket(bdaddr_p bdaddr, int psm);
---
> static int32_t client_socket(bdaddr_p bdaddr, int32_t psm);
56c58
< static int connect_in_progress = 0;
---
> static int32_t connect_in_progress = 0;
58c60
< int
---
> int32_t
61,62c63,64
< static hid_device_p d = NULL;
< bthid_session_p s = NULL;
---
> static hid_device_p d;
> bthid_session_p s;
85,87c87,89
< if ((s = session_open(srv, &d->bdaddr)) == NULL) {
< syslog(LOG_CRIT, "Could not open outbound session for %s. " \
< "Not enough memory", bt_ntoa(&d->bdaddr, NULL));
---
> if ((s = session_open(srv, d)) == NULL) {
> syslog(LOG_CRIT, "Could not create outbound session for %s",
> bt_ntoa(&d->bdaddr, NULL));
115,116c117,118
< int
< client_connect(bthid_server_p srv, int fd)
---
> int32_t
> client_connect(bthid_server_p srv, int32_t fd)
118,120c120,122
< bthid_session_p s = NULL;
< hid_device_p d = NULL;
< int error, len;
---
> bthid_session_p s;
> hid_device_p d;
> int32_t error, len;
183a186,194
>
> /* Register session's vkbd descriptor (if any) for read */
> if (s->state == OPEN && d->keyboard) {
> assert(s->vkbd != -1);
>
> FD_SET(s->vkbd, &srv->rfdset);
> if (s->vkbd > srv->maxfd)
> srv->maxfd = s->vkbd;
> }
203c214
< client_socket(bdaddr_p bdaddr, int psm)
---
> client_socket(bdaddr_p bdaddr, int32_t psm)
206c217
< int s, m;
---
> int32_t s, m;
225c236
< memcpy(&l2addr.l2cap_bdaddr, NG_HCI_BDADDR_ANY, sizeof(l2addr.l2cap_bdaddr));
---
> memset(&l2addr.l2cap_bdaddr, 0, sizeof(l2addr.l2cap_bdaddr));
234c245
< l2addr.l2cap_psm = htole16(psm);
---
> l2addr.l2cap_psm = psm;
< *
< * Copyright (c) 2004 Maksim Yevmenkin <m_evmenkin@yahoo.com>
---
> */
>
> /*-
> * Copyright (c) 2006 Maksim Yevmenkin <m_evmenkin@yahoo.com>
28,29c30,31
< * $Id: client.c,v 1.6 2004/02/26 21:57:55 max Exp $
< * $FreeBSD: head/usr.sbin/bluetooth/bthidd/client.c 156784 2006-03-16 18:26:54Z emax $
---
> * $Id: client.c,v 1.7 2006/09/07 21:06:53 max Exp $
> * $FreeBSD: head/usr.sbin/bluetooth/bthidd/client.c 162128 2006-09-07 21:47:49Z emax $
43d44
< #include "bthidd.h"
44a46
> #include "bthidd.h"
46c48
< static int client_socket(bdaddr_p bdaddr, int psm);
---
> static int32_t client_socket(bdaddr_p bdaddr, int32_t psm);
56c58
< static int connect_in_progress = 0;
---
> static int32_t connect_in_progress = 0;
58c60
< int
---
> int32_t
61,62c63,64
< static hid_device_p d = NULL;
< bthid_session_p s = NULL;
---
> static hid_device_p d;
> bthid_session_p s;
85,87c87,89
< if ((s = session_open(srv, &d->bdaddr)) == NULL) {
< syslog(LOG_CRIT, "Could not open outbound session for %s. " \
< "Not enough memory", bt_ntoa(&d->bdaddr, NULL));
---
> if ((s = session_open(srv, d)) == NULL) {
> syslog(LOG_CRIT, "Could not create outbound session for %s",
> bt_ntoa(&d->bdaddr, NULL));
115,116c117,118
< int
< client_connect(bthid_server_p srv, int fd)
---
> int32_t
> client_connect(bthid_server_p srv, int32_t fd)
118,120c120,122
< bthid_session_p s = NULL;
< hid_device_p d = NULL;
< int error, len;
---
> bthid_session_p s;
> hid_device_p d;
> int32_t error, len;
183a186,194
>
> /* Register session's vkbd descriptor (if any) for read */
> if (s->state == OPEN && d->keyboard) {
> assert(s->vkbd != -1);
>
> FD_SET(s->vkbd, &srv->rfdset);
> if (s->vkbd > srv->maxfd)
> srv->maxfd = s->vkbd;
> }
203c214
< client_socket(bdaddr_p bdaddr, int psm)
---
> client_socket(bdaddr_p bdaddr, int32_t psm)
206c217
< int s, m;
---
> int32_t s, m;
225c236
< memcpy(&l2addr.l2cap_bdaddr, NG_HCI_BDADDR_ANY, sizeof(l2addr.l2cap_bdaddr));
---
> memset(&l2addr.l2cap_bdaddr, 0, sizeof(l2addr.l2cap_bdaddr));
234c245
< l2addr.l2cap_psm = htole16(psm);
---
> l2addr.l2cap_psm = psm;