Skip to content
Browse files

Merge branch 'master' of github.com:alexlee188/ghpsdr3-alex into iw0hdv

  • Loading branch information...
2 parents 7f73d23 + e5d7a53 commit a2df8322df7dce666c62236598ee72607819fb82 @amontefusco amontefusco committed
Showing with 79 additions and 10 deletions.
  1. +11 −0 configure.ac
  2. +2 −0 trunk/src/QtRadio/UI.cpp
  3. +1 −1 trunk/src/dspserver/main.c
  4. +58 −4 trunk/src/server/metis.c
  5. +2 −0 trunk/src/server/metis.h
  6. +5 −5 trunk/src/server/ozy.c
View
11 configure.ac
@@ -152,6 +152,9 @@ AC_SEARCH_LIBS([src_new], [samplerate],[have_samplerate=yes])
have_ortp=no
AC_SEARCH_LIBS([ortp_init], [ortp],[have_ortp=yes])
+have_gomp=no
+AC_SEARCH_LIBS([omp_get_active_level], [gomp],[have_gomp=yes])
+
# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/timeb.h unistd.h])
@@ -332,6 +335,14 @@ if test "x${have_ortp}" = xno; then
fi
+if test "x${have_gomp}" = xno; then
+ AC_MSG_ERROR([
+-----------------------------------
+ The gomp library required to build ghpsdr3.
+-----------------------------------])
+
+fi
+
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_TYPE_MODE_T
View
2 trunk/src/QtRadio/UI.cpp
@@ -2090,7 +2090,9 @@ void UI::printWindowTitle(QString message)
}
setWindowTitle("QtRadio - Server: " + servername + " " + configure.getHost() + "(Rx "
+ QString::number(configure.getReceiver()) +") .. "
+
+ getversionstring() + message + " master 14 Oct 2012");
+
lastmessage = message;
}
View
2 trunk/src/dspserver/main.c
@@ -79,7 +79,7 @@
*
*/
-const char *version = "20121021;-iw0hdv"; //YYYYMMDD; text desc
+const char *version = "20121021;-master"; //YYYYMMDD; text desc
// main.c
View
62 trunk/src/server/metis.c
@@ -213,6 +213,22 @@ char* metis_mac_address(int entry) {
return NULL;
}
+/*
+ Start Command
+
+ Metis will start sending UDP/IP data to the ‘from port’, IP address and MAC address of a
+ PC that sends a Start Command. The Start Command is a UDP/IP frame sent to the
+ Ethernet address assigned to the Metis card and port 1024. The command has the
+ following format:
+
+ <0xEFFE><0x04><Command>< 60 bytes of 0x00>
+
+ where
+
+ Command = 1 byte (bit [0] set starts I&Q + Mic data and bit [1] set starts the wide bandscope data)
+
+*/
+
void metis_start_receive_thread() {
int i;
int rc;
@@ -239,8 +255,8 @@ void metis_start_receive_thread() {
// send a packet to start the stream
buffer[0]=0xEF;
buffer[1]=0xFE;
- buffer[2]=0x04; // data send state
- buffer[3]=0x03; // send (0x00=stop)
+ buffer[2]=0x04; // data send state send (0x00=stop)
+ buffer[3]=0x01; // I/Q only
for(i=0;i<60;i++) {
buffer[i+4]=0x00;
@@ -260,6 +276,26 @@ fprintf(stderr,"starting metis_watchdog_thread\n");
static unsigned char input_buffer[2048];
+/*
+ Metis Discovery reply format
+
+ Upon receipt of this broadcast a Metis board will reply with a UDP/IP frame sent to the
+ ‘from port’ on the IP Address and MAC Address of the PC originating the Discovery
+ broadcast.
+
+ The payload of the UDP/IP reply frame is as follows:
+
+ <0xEFFE><Status>< Metis MAC Address><Code Version><Board_ID><49 bytes of 0x00>
+
+ where
+
+ Status = 1 byte, 0x02 if Metis is not sending data and 0x03 if it is
+ Metis MAC Address = 6 bytes (MAC Address of the Metis responding to the Discovery Broadcast)
+ Code Version = 1 byte, version number of code currently loaded into Metis
+ Board_ID = 1 byte, 0x00 = Metis, 0x01 = Hermes, 0x02 = Griffin
+
+*/
+
void* metis_receive_thread(void* arg) {
struct sockaddr_in addr;
int length;
@@ -301,8 +337,8 @@ void* metis_receive_thread(void* arg) {
fprintf(stderr,"unexpected data packet when in discovery mode\n");
}
break;
- case 2: // response to a discovery packet - not sending
- case 3: // response to a discovery packet - sending
+ case 2: // response to a discovery packet - hardware is not yet sending
+ case 3: // response to a discovery packet - hardware is already sending
if(discovering) {
if(found<MAX_METIS_CARDS) {
// get MAC address from reply
@@ -317,6 +353,24 @@ void* metis_receive_thread(void* arg) {
(addr.sin_addr.s_addr>>16)&0xFF,
(addr.sin_addr.s_addr>>24)&0xFF);
fprintf(stderr,"Metis IP address %s\n",metis_cards[found].ip_address);
+ metis_cards[found].code_version = input_buffer[9];
+ switch (input_buffer[10]) {
+ case 0x00:
+ metis_cards[found].board_id = "Metis";
+ break;
+ case 0x01:
+ metis_cards[found].board_id = "Hermes";
+ break;
+ case 0x02:
+ metis_cards[found].board_id = "Griffin";
+ break;
+ default:
+ metis_cards[found].board_id = "unknown";
+ break;
+ }
+ fprintf(stderr,"Board id: %s",metis_cards[found].board_id);
+ fprintf(stderr," version: %1.2F\n",metis_cards[found].code_version /10.0);
+
found++;
if(input_buffer[2]==3) {
fprintf(stderr,"Metis is sending\n");
View
2 trunk/src/server/metis.h
@@ -28,6 +28,8 @@
typedef struct _METIS_CARD {
char ip_address[16];
char mac_address[18];
+ char *board_id;
+ int code_version;
} METIS_CARD;
void metis_discover(char* interface,char* metisip);
View
10 trunk/src/server/ozy.c
@@ -125,7 +125,7 @@ static unsigned char control_out[5]={
CONFIG_BOTH | MERCURY_122_88MHZ_SOURCE | MERCURY_10MHZ_SOURCE | MIC_SOURCE_PENELOPE | SPEED_96KHZ,
MODE_OTHERS,
ALEX_ATTENUATION_0DB | LT2208_GAIN_OFF | LT2208_DITHER_ON | LT2208_RANDOM_ON,
- SIMPLEX
+ DUPLEX // changed from SIMPLEX in order to avoid Hermes frequency lagging
};
static int mox=0;
@@ -534,11 +534,11 @@ void write_ozy_output_buffer() {
ozy_output_buffer[6]=control_out[3];
ozy_output_buffer[7]=control_out[4];
} else if(receiver[current_receiver].frequency_changed) {
- if(receivers==1) {
- ozy_output_buffer[3]=control_out[0]|0x02;
- } else {
+ //if(receivers==1) {
+ // ozy_output_buffer[3]=control_out[0]|0x02;
+ //} else {
ozy_output_buffer[3]=control_out[0]|((current_receiver+2)<<1);
- }
+ //}
ozy_output_buffer[4]=receiver[current_receiver].frequency>>24;
ozy_output_buffer[5]=receiver[current_receiver].frequency>>16;
ozy_output_buffer[6]=receiver[current_receiver].frequency>>8;

0 comments on commit a2df832

Please sign in to comment.
Something went wrong with that request. Please try again.