send_recv.c (126643) | send_recv.c (128079) |
---|---|
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 126643 2004-03-05 08:10:19Z markm $ | 29 * $FreeBSD: head/usr.sbin/bluetooth/hccontrol/send_recv.c 128079 2004-04-09 23:58:53Z emax $ |
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> --- 11 unchanged lines hidden (view full) --- 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); 54 assert(*rp_size > 0); 55 56 c->type = NG_HCI_CMD_PKT; | 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> --- 11 unchanged lines hidden (view full) --- 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); 54 assert(*rp_size > 0); 55 56 c->type = NG_HCI_CMD_PKT; |
57 c->opcode = (u_int16_t) opcode; | 57 c->opcode = (uint16_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); 62 | 58 c->opcode = htole16(c->opcode); 59 60 if (cp != NULL) { 61 assert(0 < cp_size && cp_size <= NG_HCI_CMD_PKT_SIZE); 62 |
63 c->length = (u_int8_t) cp_size; | 63 c->length = (uint8_t) cp_size; |
64 memcpy(buffer + sizeof(*c), cp, cp_size); 65 } else 66 c->length = 0; 67 68 if (hci_send(s, buffer, sizeof(*c) + cp_size) == ERROR) 69 return (ERROR); 70 71again: --- 113 unchanged lines hidden --- | 64 memcpy(buffer + sizeof(*c), cp, cp_size); 65 } else 66 c->length = 0; 67 68 if (hci_send(s, buffer, sizeof(*c) + cp_size) == ERROR) 69 return (ERROR); 70 71again: --- 113 unchanged lines hidden --- |