diff options
| author | Keith Packard <keithp@keithp.com> | 2010-08-07 00:40:59 -0400 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2010-08-07 00:40:59 -0400 | 
| commit | 4738cb2fc639adb1d9237e6c903479f0690dd81a (patch) | |
| tree | 5664b86fe4c3a8d94bf426b6f5cdd8e8d3fa429a /src | |
| parent | b7699a5907e64bc7547fcc27e73f4a35bbaabfff (diff) | |
altos: add callsign to packet mode, increase payload to 64 bytes
Untested, but it 'should' work. Need to add callsign setting to packet
mode users.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/ao.h | 3 | ||||
| -rw-r--r-- | src/ao_packet_master.c | 2 | ||||
| -rw-r--r-- | src/ao_packet_slave.c | 4 | 
3 files changed, 7 insertions, 2 deletions
@@ -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 { diff --git a/src/ao_packet_master.c b/src/ao_packet_master.c index ef86fa28..72bb908a 100644 --- a/src/ao_packet_master.c +++ b/src/ao_packet_master.c @@ -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(); diff --git a/src/ao_packet_slave.c b/src/ao_packet_slave.c index e03ebdc3..9b78767f 100644 --- a/src/ao_packet_slave.c +++ b/src/ao_packet_slave.c @@ -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();  }  | 
