altos: add callsign to packet mode, increase payload to 64 bytes
authorKeith Packard <keithp@keithp.com>
Sat, 7 Aug 2010 04:40:59 +0000 (00:40 -0400)
committerKeith Packard <keithp@keithp.com>
Sat, 7 Aug 2010 04:40:59 +0000 (00:40 -0400)
Untested, but it 'should' work. Need to add callsign setting to packet
mode users.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/ao.h
src/ao_packet_master.c
src/ao_packet_slave.c

index 5dd756dac48e21671d1f66f0615cfc2abfdce8af..5f2b83394daf96eb78abd5f89bff2fb92ec35388 100644 (file)
--- a/src/ao.h
+++ b/src/ao.h
@@ -1034,7 +1034,7 @@ struct ao_fifo {
  * Packet-based command interface
  */
 
-#define AO_PACKET_MAX  8
+#define AO_PACKET_MAX          64
 #define AO_PACKET_SYN          (uint8_t) 0xff
 
 struct ao_packet {
@@ -1043,6 +1043,7 @@ struct ao_packet {
        uint8_t         seq;
        uint8_t         ack;
        uint8_t         d[AO_PACKET_MAX];
+       uint8_t         callsign[AO_MAX_CALLSIGN];
 };
 
 struct ao_packet_recv {
index ef86fa281a7f809e2c0ce38bdd6d45c823eaf710..72bb908a671e4e2f790f1f6492c340627e43468a 100644 (file)
@@ -77,12 +77,14 @@ ao_packet_master(void)
 {
        uint8_t status;
 
+       ao_config_get();
        ao_radio_set_packet();
        ao_tx_packet.addr = ao_serial_number;
        ao_tx_packet.len = AO_PACKET_SYN;
        ao_packet_master_time = ao_time();
        ao_packet_master_delay = AO_PACKET_MASTER_DELAY_SHORT;
        while (ao_packet_enable) {
+               memcpy(ao_tx_packet.callsign, ao_config.callsign, AO_MAX_CALLSIGN);
                ao_packet_send();
                if (ao_tx_packet.len)
                        ao_packet_master_busy();
index e03ebdc3a20cd90475ee00ea1610b3a3a6f28260..9b78767f55282b4e77c0f28f806124728151fccc 100644 (file)
@@ -27,8 +27,10 @@ ao_packet_slave(void)
        ao_tx_packet.len = AO_PACKET_SYN;
        while (ao_packet_enable) {
                status = ao_packet_recv();
-               if (status & AO_DMA_DONE)
+               if (status & AO_DMA_DONE) {
+                       memcpy(&ao_tx_packet.callsign, &ao_rx_packet.packet.callsign, AO_MAX_CALLSIGN);
                        ao_packet_send();
+               }
        }
        ao_exit();
 }