cleanup
This commit is contained in:
parent
765cb854ed
commit
f028280963
@ -8,7 +8,7 @@ int prepare_id (struct data_packet_format *id_packet, char *id)
|
|||||||
snprintf(id_packet->id, SIZE_ID, id, "%s");
|
snprintf(id_packet->id, SIZE_ID, id, "%s");
|
||||||
id_packet->sequence = 0;
|
id_packet->sequence = 0;
|
||||||
id_packet->n = 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->a21 = 1; /* These magic numbers was provided by Les Kerr */
|
||||||
id_packet->a22 = 755;
|
id_packet->a22 = 755;
|
||||||
id_packet->a23 = 65535;
|
id_packet->a23 = 65535;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#define INTERFACE_VERSION "irmc v0.02"
|
||||||
|
|
||||||
// Structures for the packets: unsigned short command
|
// Structures for the packets: unsigned short command
|
||||||
#define DIS 0x0002 // disconnect
|
#define DIS 0x0002 // disconnect
|
||||||
#define DAT 0x0003
|
#define DAT 0x0003
|
||||||
|
30
src/irmc.c
30
src/irmc.c
@ -284,11 +284,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
prepare_id (&id_packet, id);
|
prepare_id (&id_packet, id);
|
||||||
prepare_tx (&tx_data_packet, id);
|
prepare_tx (&tx_data_packet, id);
|
||||||
|
|
||||||
|
|
||||||
connect_packet.command = CON;
|
|
||||||
connect_packet.channel = channel;
|
connect_packet.channel = channel;
|
||||||
|
|
||||||
|
|
||||||
signal(SIGINT, inthandler);
|
signal(SIGINT, inthandler);
|
||||||
|
|
||||||
@ -373,19 +369,19 @@ int main(int argc, char *argv[])
|
|||||||
if(audio_status == 1)
|
if(audio_status == 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
int length = rx_data_packet.code[i];
|
int length = rx_data_packet.code[i];
|
||||||
if(length == 0 || abs(length) > 2000) {
|
if(length == 0 || abs(length) > 2000) {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(length < 0) {
|
if(length < 0) {
|
||||||
beep(0.0, abs(length)/1000.);
|
beep(0.0, abs(length)/1000.);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
beep(1000.0, length/1000.);
|
beep(1000.0, length/1000.);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user