This commit is contained in:
Gerolf Ziegenhain 2015-01-04 15:29:26 +01:00
parent 765cb854ed
commit f028280963
3 changed files with 16 additions and 18 deletions

View File

@ -8,7 +8,7 @@ int prepare_id (struct data_packet_format *id_packet, char *id)
snprintf(id_packet->id, SIZE_ID, id, "%s");
id_packet->sequence = 0;
id_packet->n = 0;
snprintf(id_packet->status, SIZE_ID, "irmc v0.02");
snprintf(id_packet->status, SIZE_ID, INTERFACE_VERSION);
id_packet->a21 = 1; /* These magic numbers was provided by Les Kerr */
id_packet->a22 = 755;
id_packet->a23 = 65535;

View File

@ -1,3 +1,5 @@
#define INTERFACE_VERSION "irmc v0.02"
// Structures for the packets: unsigned short command
#define DIS 0x0002 // disconnect
#define DAT 0x0003

View File

@ -284,11 +284,7 @@ int main(int argc, char *argv[])
prepare_id (&id_packet, id);
prepare_tx (&tx_data_packet, id);
connect_packet.command = CON;
connect_packet.channel = channel;
signal(SIGINT, inthandler);
@ -373,19 +369,19 @@ int main(int argc, char *argv[])
if(audio_status == 1)
{
int length = rx_data_packet.code[i];
if(length == 0 || abs(length) > 2000) {
}
else
{
if(length < 0) {
beep(0.0, abs(length)/1000.);
}
else
{
beep(1000.0, length/1000.);
}
}
int length = rx_data_packet.code[i];
if(length == 0 || abs(length) > 2000) {
}
else
{
if(length < 0) {
beep(0.0, abs(length)/1000.);
}
else
{
beep(1000.0, length/1000.);
}
}
}
break;
}