private void bACK_Click(object sender, EventArgs e) { if (acc != null) { acc.send(CMDPDU.encode_ack()); log("ACK Enviado!"); } }
public override void on_data() { LOG.log(String.Format("DATA:[{0}];", Encoding.ASCII.GetString(get_buffer(), 0, get_read_bytes()))); if ((get_buffer()[0] == '?') || // WAKEUP (get_buffer()[0] == '!') || // ATTACK DELAY (get_buffer()[0] == 'T') || // GPS Autostatus (get_buffer()[0] == 'T') || // TEXT MESSAGE (get_buffer()[0] == 'M')) // PREDEFINED MESSAGE { // esta version no hace nada con lo que pida el command data asi que simplemente nos limitamos a contestar con un ACK send(CMDPDU.encode_ack()); LOG.log(String.Format("Mensaje del HOST type={0}, se contesto con ACK y se ignoro.", get_buffer()[0])); } else if (get_buffer()[0] == 0x06 || get_buffer()[0] == 'A') // RECIBIMOS ACK { LOG.ack(true); } else { // cualquier rta incomprensible decimos NACK.. LOG.ack(false); } }