Deleted Added
full compact
send_recv.c (121054) send_recv.c (126643)
1/*
2 * send_recv.c
3 *
4 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 12 unchanged lines hidden (view full) ---

21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $Id: send_recv.c,v 1.2 2003/05/21 22:40:30 max Exp $
1/*
2 * send_recv.c
3 *
4 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 12 unchanged lines hidden (view full) ---

21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $Id: send_recv.c,v 1.2 2003/05/21 22:40:30 max Exp $
29 * $FreeBSD: head/usr.sbin/bluetooth/hccontrol/send_recv.c 121054 2003-10-12 22:04:24Z emax $
29 * $FreeBSD: head/usr.sbin/bluetooth/hccontrol/send_recv.c 126643 2004-03-05 08:10:19Z markm $
30 */
31
32#include <sys/types.h>
33#include <sys/socket.h>
34#include <sys/time.h>
35#include <sys/endian.h>
36#include <assert.h>
37#include <errno.h>

--- 7 unchanged lines hidden (view full) ---

45hci_request(int s, int opcode, char const *cp, int cp_size, char *rp, int *rp_size)
46{
47 char buffer[512];
48 int n;
49 ng_hci_cmd_pkt_t *c = (ng_hci_cmd_pkt_t *) buffer;
50 ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) buffer;
51
52 assert(rp != NULL);
30 */
31
32#include <sys/types.h>
33#include <sys/socket.h>
34#include <sys/time.h>
35#include <sys/endian.h>
36#include <assert.h>
37#include <errno.h>

--- 7 unchanged lines hidden (view full) ---

45hci_request(int s, int opcode, char const *cp, int cp_size, char *rp, int *rp_size)
46{
47 char buffer[512];
48 int n;
49 ng_hci_cmd_pkt_t *c = (ng_hci_cmd_pkt_t *) buffer;
50 ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) buffer;
51
52 assert(rp != NULL);
53 assert(*rp_size != NULL);
53 assert(rp_size != NULL);
54 assert(*rp_size > 0);
55
56 c->type = NG_HCI_CMD_PKT;
57 c->opcode = (u_int16_t) opcode;
58 c->opcode = htole16(c->opcode);
59
60 if (cp != NULL) {
61 assert(0 < cp_size && cp_size <= NG_HCI_CMD_PKT_SIZE);

--- 123 unchanged lines hidden ---
54 assert(*rp_size > 0);
55
56 c->type = NG_HCI_CMD_PKT;
57 c->opcode = (u_int16_t) opcode;
58 c->opcode = htole16(c->opcode);
59
60 if (cp != NULL) {
61 assert(0 < cp_size && cp_size <= NG_HCI_CMD_PKT_SIZE);

--- 123 unchanged lines hidden ---