Skip to content
This repository has been archived by the owner on May 16, 2019. It is now read-only.

Added XBEE_2_STOP_BITS option to enable the use of 2 stopbits #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions make/default/arm920t.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ CLINKS+= -march=armv4t -mtune=arm920t
#OPTIONS+= XBEE_DISABLE_LOGGING

### use for more precise logging options
#OPTIONS+= XBEE_2_STOP_BITS
#OPTIONS+= XBEE_LOG_LEVEL=100
#OPTIONS+= XBEE_LOG_NO_COLOR
#OPTIONS+= XBEE_LOG_NO_RX
Expand Down
60 changes: 60 additions & 0 deletions make/default/armhf.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
### libxbee configuration options:

### system install directories
SYS_ROOT?=
SYS_LIBDIR:= $(SYS_ROOT)/usr/lib
SYS_INCDIR:= $(SYS_ROOT)/usr/include
SYS_MANDIR:= $(SYS_ROOT)/usr/share/man
SYS_GROUP:= root
SYS_USER:= root

### using this can create a smaller binary, by removing modes you won't use
#MODELIST:= xbee1 xbee2 xbee3 xbee5 xbee6b xbeeZB net debug

### to use the 'install_html' rule, you must specify where to install the files to
#SYS_HTMLDIR:= /var/www/libxbee.doc

### setup a cross-compile toolchain (either here, or in the environment)
# use the CodeSourcery 2011.03-41 toolchain (v4.5.2)
CROSS_COMPILE?= arm-linux-gnueabihf-
#CFLAGS+=
#CLINKS+=

### un-comment to remove ALL logging (smaller & faster binary)
#OPTIONS+= XBEE_DISABLE_LOGGING

### use for more precise logging options
#OPTIONS+= XBEE_2_STOP_BITS
#OPTIONS+= XBEE_LOG_LEVEL=100
#OPTIONS+= XBEE_LOG_NO_COLOR
#OPTIONS+= XBEE_LOG_NO_RX
#OPTIONS+= XBEE_LOG_NO_TX
#OPTIONS+= XBEE_LOG_RX_DEFAULT_OFF
#OPTIONS+= XBEE_LOG_TX_DEFAULT_OFF

### un-comment to disable strict objects (xbee/con/pkt pointers are usually checked inside functions)
### this may give increased execution speed, but will be more suseptible to incorrect parameters
#OPTIONS+= XBEE_DISABLE_STRICT_OBJECTS

### un-comment to remove network server functionality
#OPTIONS+= XBEE_NO_NET_SERVER
#OPTIONS+= XBEE_NO_NET_STRICT_VERSIONS

### un-comment to turn off hardware flow control
#OPTIONS+= XBEE_NO_RTSCTS

### un-comment to allow arbitrary baud rates - drivers may still reject them
#OPTIONS+= XBEE_ALLOW_ARB_BAUD

### un-comment to use API mode 2
#OPTIONS+= XBEE_API2
#OPTIONS+= XBEE_API2_DEBUG
#OPTIONS+= XBEE_API2_IGNORE_CHKSUM
#OPTIONS+= XBEE_API2_SAFE_ESCAPE

### useful for debugging the core of libxbee
#OPTIONS+= XBEE_NO_FINI

### manually start and end the library's global state (be careful!)
#OPTIONS+= XBEE_MANUAL_INIT
#OPTIONS+= XBEE_MANUAL_FINI
1 change: 1 addition & 0 deletions make/default/darwin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ SYS_USER:= root
#OPTIONS+= XBEE_DISABLE_LOGGING

### use for more precise logging options
#OPTIONS+= XBEE_2_STOP_BITS
#OPTIONS+= XBEE_LOG_LEVEL=100
#OPTIONS+= XBEE_LOG_NO_COLOR
#OPTIONS+= XBEE_LOG_NO_RX
Expand Down
1 change: 1 addition & 0 deletions make/default/freebsd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ SYS_USER:= root
#OPTIONS+= XBEE_DISABLE_LOGGING

### use for more precise logging options
#OPTIONS+= XBEE_2_STOP_BITS
#OPTIONS+= XBEE_LOG_LEVEL=100
#OPTIONS+= XBEE_LOG_NO_COLOR
#OPTIONS+= XBEE_LOG_NO_RX
Expand Down
1 change: 1 addition & 0 deletions make/default/linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ SYS_USER:= root
#OPTIONS+= XBEE_DISABLE_LOGGING

### use for more precise logging options
#OPTIONS+= XBEE_2_STOP_BITS
#OPTIONS+= XBEE_LOG_LEVEL=100
#OPTIONS+= XBEE_LOG_NO_COLOR
#OPTIONS+= XBEE_LOG_NO_RX
Expand Down
6 changes: 3 additions & 3 deletions xsys_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ int xsys_serialSetup(struct xbee_serialInfo *info) {
tc.c_cflag |= CLOCAL; /* prevent changing ownership */
tc.c_cflag |= CREAD; /* enable reciever */
tc.c_cflag &= ~ PARENB; /* disable parity */
if (info->baudrate >= 115200) {
#ifdef XBEE_2_STOP_BITS
tc.c_cflag |= CSTOPB; /* enable 2 stop bits for the high baudrate */
} else {
#else
tc.c_cflag &= ~ CSTOPB; /* disable 2 stop bits */
}
#endif
tc.c_cflag &= ~ CSIZE; /* remove size flag... */
tc.c_cflag |= CS8; /* ...enable 8 bit characters */
tc.c_cflag |= HUPCL; /* enable lower control lines on close - hang up */
Expand Down