-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
message 1-5 are able to decode in python
git-svn-id: https://cowfish.unh.edu/projects/schwehr/trunk/src/libais@13603 a19cddd1-5311-0410-bb07-9ca93daf0f0b
- Loading branch information
schwehr
committed
May 3, 2010
1 parent
9ca2bcc
commit 1531d7c
Showing
10 changed files
with
766 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
#CXXFLAGS += -O3 -funroll-loops -fexpensive-optimizations -DNDEBUG | ||
#CXXFLAGS += -ffast-math | ||
|
||
CXXFLAGS += -g3 -O0 | ||
CXXFLAGS += -D_GLIBCXX_DEBUG | ||
CXXFLAGS := -Wall | ||
CXXFLAGS += -Wimplicit | ||
CXXFLAGS += -pedantic | ||
CXXFLAGS += -W | ||
CXXFLAGS += -Wredundant-decls | ||
CXXFLAGS += -Werror | ||
|
||
|
||
SRCS:= ais.cpp ais123.cpp ais4_11.cpp ais5.cpp | ||
OBJS:=${SRCS:.cpp=.o} | ||
|
||
# Remove the NDEBUG that python tries to use | ||
default: | ||
CFLAGS="-m32 -O0 -g -D_GLIBCXX_DEBUG -UNDEBUG" /sw/bin/python setup.py build | ||
|
||
libais.a: ${OBJS} | ||
ls ${OBJS} | ||
ar rv $@ $? | ||
ranlib $@ | ||
|
||
clean: | ||
-rm *.o | ||
-rm -rf build | ||
-rm *.a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
* List of things that need to be done for this library. | ||
|
||
- Python error handling | ||
- code all the messages that are around | ||
- build testing infrastructure (nose?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Since Apr 2010 | ||
// g++ ais_pos.cxx -o ais_pos -g -Wall -O3 -Wimplicit -W -Wredundant-decls -pedantic -funroll-loops -fexpensive-optimizations | ||
|
||
#include "ais.h" | ||
|
||
#include <iostream> | ||
#include <bitset> | ||
#include <string> | ||
#include <cassert> | ||
#include <cmath> | ||
//using namespace std; | ||
|
||
std::bitset<6> nmea_ord[128]; | ||
bool nmea_ord_initialized = false; | ||
|
||
void build_nmea_lookup() { | ||
std::cout << "building lut..." << std::endl; | ||
for (int c=0; c < 128; c++) { | ||
int val = c - 48; | ||
if (val>=40) val-= 8; | ||
if (val < 0) continue; | ||
std::bitset<6> bits(val); | ||
bool tmp; | ||
tmp = bits[5]; bits[5] = bits[0]; bits[0] = tmp; | ||
tmp = bits[4]; bits[4] = bits[1]; bits[1] = tmp; | ||
tmp = bits[3]; bits[3] = bits[2]; bits[2] = tmp; | ||
nmea_ord[c] = bits; | ||
} | ||
nmea_ord_initialized = true; | ||
} | ||
|
||
const std::string bits_to_char_tbl="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^- !\"#$%&`()*+,-./0123456789:;<=>?"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.