1 (define STX (string #\stx))
2 (define RS (string #\rs))
3 (define ETX (string #\etx))
5 (define (list-ref-with-default lst n def)
11 (define (string->u8vector s)
12 (let ((result (make-u8vector (string-length s))))
13 (array-map! result char->integer s)
17 (define (u8vector->string v)
18 (apply string (map integer->char (u8vector->list v)))
21 (define (create-command cmd . args)
22 (let ((par (list-ref-with-default args 0 #f)))
24 (string-append STX cmd
27 ((string-append RS par))