forked from attie/libxbee3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conn.h
74 lines (52 loc) · 2.69 KB
/
conn.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef XBEE_CONN_H
#define XBEE_CONN_H
/*
libxbee - a C/C++ library to aid the use of Digi's XBee wireless modules
running in API mode.
Copyright (C) 2009 onwards Attie Grande (attie@attie.co.uk)
libxbee is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
libxbee is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
extern struct xbee_ll_head *conList;
struct xbee_con {
struct xbee *xbee;
struct xbee_ll_head *pktList;
struct xbee_modeConType *conType;
int ending;
int conIdentifier;
struct xbee_interface *iface;
void *userData;
struct xbee_netClientInfo *netClient;
xbee_t_conCallback callback;
struct xbee_threadInfo *callbackThread;
xsys_sem callbackSem;
xsys_mutex txMutex;
unsigned char frameId;
enum xbee_conSleepStates sleepState;
struct xbee_conAddress address;
struct xbee_conInfo info;
struct xbee_conSettings settings;
};
xbee_err xbee_conAlloc(struct xbee_con **nCon);
xbee_err xbee_conFree(struct xbee_con *con);
xbee_err xbee_conWake(struct xbee_con *con);
xbee_err _xbee_conNew(struct xbee *xbee, struct xbee_interface *iface, int allowInternal, struct xbee_con **retCon, const char *type, struct xbee_conAddress *address);
xbee_err xbee_conLink(struct xbee *xbee, struct xbee_modeConType *conType, struct xbee_conAddress *address, struct xbee_con *con);
xbee_err xbee_conUnlink(struct xbee_con *con);
xbee_err xbee_conLogAddress(struct xbee *xbee, int minLogLevel, struct xbee_conAddress *address);
xbee_err xbee_conAddressPrepDefault(struct xbee_conAddress *addr);
xbee_err xbee_conAddressCmpDefault(struct xbee_conAddress *addr1, struct xbee_conAddress *addr2, unsigned char *matchRating);
xbee_err xbee_conAddressTestDefault(const unsigned char *addr, size_t len);
xbee_err xbee_conLocate(struct xbee_ll_head *conList, struct xbee_conAddress *address, struct xbee_con **retCon, enum xbee_conSleepStates alertLevel);
xbee_err _xbee_conLocate(struct xbee_ll_head *conList, struct xbee_conAddress *address, unsigned char *retRating, struct xbee_con **retCon, enum xbee_conSleepStates alertLevel, int needsLLLock);
xbee_err xbee_conLinkPacket(struct xbee_con *con, struct xbee_pkt *pkt);
xbee_err xbee_conCallbackProd(struct xbee_con *con);
#endif /* XBEE_CONN_H */