bluetooth.h (143767) | bluetooth.h (181698) |
---|---|
1/* 2 * bluetooth.h 3 * 4 * Copyright (c) 2001-2003 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: bluetooth.h,v 1.5 2003/09/14 23:28:42 max Exp $ | 1/* 2 * bluetooth.h 3 * 4 * Copyright (c) 2001-2003 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: bluetooth.h,v 1.5 2003/09/14 23:28:42 max Exp $ |
29 * $FreeBSD: head/lib/libbluetooth/bluetooth.h 143767 2005-03-17 21:39:44Z emax $ | 29 * $FreeBSD: head/lib/libbluetooth/bluetooth.h 181698 2008-08-13 19:35:31Z emax $ |
30 */ 31 32#ifndef _BLUETOOTH_H_ 33#define _BLUETOOTH_H_ 34 35#include <sys/types.h> 36#include <sys/bitstring.h> 37#include <sys/endian.h> --- 29 unchanged lines hidden (view full) --- 67struct protoent * bt_getprotobynumber (int proto); 68struct protoent * bt_getprotoent (void); 69void bt_setprotoent (int stayopen); 70void bt_endprotoent (void); 71 72char const * bt_ntoa (bdaddr_t const *ba, char *str); 73int bt_aton (char const *str, bdaddr_t *ba); 74 | 30 */ 31 32#ifndef _BLUETOOTH_H_ 33#define _BLUETOOTH_H_ 34 35#include <sys/types.h> 36#include <sys/bitstring.h> 37#include <sys/endian.h> --- 29 unchanged lines hidden (view full) --- 67struct protoent * bt_getprotobynumber (int proto); 68struct protoent * bt_getprotoent (void); 69void bt_setprotoent (int stayopen); 70void bt_endprotoent (void); 71 72char const * bt_ntoa (bdaddr_t const *ba, char *str); 73int bt_aton (char const *str, bdaddr_t *ba); 74 |
75/* 76 * bdaddr utility functions (from NetBSD) 77 */ 78 79static __inline int 80bdaddr_same(const bdaddr_t *a, const bdaddr_t *b) 81{ 82 return (a->b[0] == b->b[0] && a->b[1] == b->b[1] && 83 a->b[2] == b->b[2] && a->b[3] == b->b[3] && 84 a->b[4] == b->b[4] && a->b[5] == b->b[5]); 85} 86 87static __inline int 88bdaddr_any(const bdaddr_t *a) 89{ 90 return (a->b[0] == 0 && a->b[1] == 0 && a->b[2] == 0 && 91 a->b[3] == 0 && a->b[4] == 0 && a->b[5] == 0); 92} 93 94static __inline void 95bdaddr_copy(bdaddr_t *d, const bdaddr_t *s) 96{ 97 d->b[0] = s->b[0]; 98 d->b[1] = s->b[1]; 99 d->b[2] = s->b[2]; 100 d->b[3] = s->b[3]; 101 d->b[4] = s->b[4]; 102 d->b[5] = s->b[5]; 103} 104 |
|
75__END_DECLS 76 77#endif /* ndef _BLUETOOTH_H_ */ 78 | 105__END_DECLS 106 107#endif /* ndef _BLUETOOTH_H_ */ 108 |