vovan@vovan-laptop:/tmp$ python t.py /dev/rfcomm0
< L40\n
> L40\r
> \n
< S400000
< S4101
< P\n
> # > cmd_start(0x40, 0)\r
> \n
> # > cmd_txc(0x00)\r
> \n
> # > cmd_txc(0x00)\r
> \n
> # > cmd_start(0x41, 1)\r
> \n
> # > cmd_rxc(0x41, 0)\r
> \n
> # > cmd_stop()\r
> \n
> SWAASR04P\r
> \n
< S400001
< S4106
< P\n
> # > cmd_start(0x40, 0)\r
> \n
> # > cmd_txc(0x00)\r
> \n
> # > cmd_txc(0x01)\r
> \n
> # > cmd_start(0x41, 1)\r
> \n
> # > cmd_rxc(0x41, 1)\r
> \n
> # > cmd_rxc(0x01, 1)\r
> \n
> # > cmd_rxc(0x00, 1)\r
> \n
> # > cmd_rxc(0x01, 1)\r
> \n
> # > cmd_rxc(0x00, 1)\r
> \n
> # > cmd_rxc(0x60, 0)\r
> \n
> # > cmd_stop()\r
> \n
> SWAASR010001006004P\r
> \n
< S400002
< S4106
< P\n
> # > cmd_start(0x40, 0)\r
> \n
> # > cmd_txc(0x00)\r
> \n
> # > cmd_txc(0x02)\r
> \n
> # > cmd_start(0x41, 1)\r
> \n
> # > cmd_rxc(0x41, 1)\r
> \n
> # > cmd_rxc(0x10, 1)\r
> \n
> # > cmd_rxc(0x00, 1)\r
> \n
> # > cmd_rxc(0x01, 1)\r
> \n
> # > cmd_rxc(0x00, 1)\r
> \n
> # > cmd_rxc(0x51, 0)\r
> \n
> # > cmd_stop()\r
> \n
> SWAASR100001005102P\r
> \n
< S400003
< S4106
< P\n
> # > cmd_start(0x40, 0)\r
> \n
> # > cmd_txc(0x00)\r
> \n
> # > cmd_txc(0x03)\r
> \n
> # > cmd_start(0x41, 1)\r
> \n
> # > cmd_rxc(0x41, 1)\r
> \n
> # > cmd_rxc(0x00, 1)\r
> \n
> # > cmd_rxc(0x10, 1)\r
> \n
> # > cmd_rxc(0x01, 1)\r
> \n
> # > cmd_rxc(0x00, 1)\r
> \n
> # > cmd_rxc(0x44, 0)\r
> \n
> # > cmd_stop()\r
> \n
> SWAASR001001004408P\r
> \n
< S400004
< S4106
< P\n
> # > cmd_start(0x40, 0)\r
> \n
> # > cmd_txc(0x00)\r
> \n
> # > cmd_txc(0x04)\r
> \n
> # > cmd_start(0x41, 1)\r
> \n
> # > cmd_rxc(0x41, 1)\r
> \n
> # > cmd_rxc(0x00, 1)\r
> \n
> # > cmd_rxc(0x00, 1)\r
> \n
> # > cmd_rxc(0x01, 1)\r
> \n
> # > cmd_rxc(0x00, 1)\r
> \n
> # > cmd_rxc(0x00, 0)\r
> \n
> # > cmd_stop()\r
> \n
> SWAASR000001000001P\r
> \n
{'DIR2': 99, 'DIR1': 98, 'PORTD': 71, 'PORTB': 69, 'PORTC': 70, 'PORTA': 68, 'DDRD': 75, 'DDRB': 73, 'DDRC': 74, 'DDRA': 72, 'PWM1': 96, 'PWM2': 97}
vovan@vovan-laptop:/tmp$