summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b7699a5)
Untested, but it 'should' work. Need to add callsign setting to packet
mode users.
Signed-off-by: Keith Packard <keithp@keithp.com>
* Packet-based command interface
*/
* Packet-based command interface
*/
+#define AO_PACKET_MAX 64
#define AO_PACKET_SYN (uint8_t) 0xff
struct ao_packet {
#define AO_PACKET_SYN (uint8_t) 0xff
struct ao_packet {
uint8_t seq;
uint8_t ack;
uint8_t d[AO_PACKET_MAX];
uint8_t seq;
uint8_t ack;
uint8_t d[AO_PACKET_MAX];
+ uint8_t callsign[AO_MAX_CALLSIGN];
};
struct ao_packet_recv {
};
struct ao_packet_recv {
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) {
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();
ao_packet_send();
if (ao_tx_packet.len)
ao_packet_master_busy();
ao_tx_packet.len = AO_PACKET_SYN;
while (ao_packet_enable) {
status = ao_packet_recv();
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);