-#include <stdlib.h> /* utoa() */
-#include "uart.h"
-
-void nessie_print_block(uint8_t* block, uint16_t blocksize_bit){
- char tab [] = {'0', '1', '2', '3',
- '4', '5', '6', '7',
- '8', '9', 'A', 'B',
- 'C', 'D', 'E', 'F'};
+#include "nessie_common.h"
+#include "hexdigit_tab.h"
+
+#define nessie_out_file stdout
+
+void nessie_set_output_stream(FILE *out_stream){
+ nessie_out_file = out_stream;
+}
+
+
+#ifdef NESSIE_ALIVE
+void nessie_send_alive(void){
+ putc(NESSIE_ALIVE_CHAR, nessie_out_file);
+}
+
+void nessie_send_alive_a(uint16_t i){
+ if((i&31)==0)
+ putc(NESSIE_ALIVE_CHAR, nessie_out_file);
+}
+#endif
+
+void nessie_print_block(uint8_t *block, uint16_t blocksize_bit){